Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Passing QImage to Qml

$
0
0
Right now i have got a Delegate of a PathView which Inherits a Image which get’s its source from the PathView Model. I am passing the source of my QImage’s to my PathView Model by adding it as a ContextProperty to my Model. But what i need is to pass the Image directly to QML, not just the Url to it. I’ve read about QDeclarativeImageProvider, but in fact it also just provides a Url to be passed to QML. Is there any way to pass a QImage to a QML Delegate Image? —Attach— Alright, i tried to pass aQAbstractItemModel to QML just to test if QML provides a Qt::DecorationRole in the data function, but it only access rowCount(const QModelIndex &parent). Every necessary function could be accessed by a TreeView. Does a QML Model get his Data only trough a Q_PROPERTY?

Viewing all articles
Browse latest Browse all 4972

Trending Articles