How to show on QML (Qt) from SQLite BLOB data as image?
<p>My code is like below.</p>

<p>Name - as TEXT field,</p>

<p>Photo - as BLOB data</p>

<pre><code>class SqlQueryModel: public QSqlQueryModel
{
    Q_OBJECT
    QHash&lt;int,QByteArray&gt; *hash;
public:
    explicit SqlQueryModel(QObject * parent) : QSqlQueryModel(parent)
    {
        hash = new QHash&lt;int,QByteArray&gt;;
        hash-&gt;insert(Qt::UserRole,      QByteArray("Name"));
        hash-&gt;insert(Qt::UserRole + 1,  QByteArray("Photo"));
    }
    inline RoleNameHash roleNames() const { return *hash; }
};
</code></pre>

<p>Selecting data</p>

<pre><code>view = new QQuickView();
QSqlQueryModel *someSqlModel = new SqlQueryModel(this);
someSqlModel-&gt;setQuery("SELECT Name, Photo FROM some_table");
QQmlContext *context = view-&gt;rootContext();
context-&gt;setContextProperty("someSqlModel", someSqlModel);
view-&gt;setSource(QUrl("qrc:///MainView.qml"));
view-&gt;show();
</code></pre>

<p>Binding in QML</p>

<pre><code>ListView {
    id: someListView
    model: SqlContactModel {}
    delegate: ItemDelegate {
        text: Name
        Image {
            id: Photo
            source: ???
        }
    }
}
</code></pre>

<p>How to show on QML (Qt) from SQLite BLOB data as image?</p>