[Interest] Custom Url in a QML ToolButton

Bruno Tezine bruno at tezine.com
Fri Oct 11 14:04:40 CEST 2013


Hi,
How can I use a custom url to load an image in a Qml ToolButton?
The following code works for the Image Element, but not for the ToolButton:
import QtQuick 2.1

import QtQuick.Controls 1.0
Image{
     source: 'image://eimageprovider/5' //ok

}

ToolButton{
     iconSource: 'image://eimageprovider/5' //does not work.
     //iconSource: 'data:image/png;base64,' +myCppObj.getData(); //does 
not work either. myCppObj.getData() returns a base64 QByteArray from a 
png file.
     iconSource: 'myhandler:///5' //does not work. Using my own 
QQmlNetworkAccessManagerFactory

}


Thank you.





More information about the Interest mailing list