Is possible a component QWidget into QML/QtQuick 2.0.?
-
Re: Is it possible to integrate a QWidget into QML/QtQuick 2.0.
Good Morning,
Can i put component QTreeWidget into a QML file ? -
No, you can't.
But there is a TreeView in QML: https://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html
-
No, you can't.
But there is a TreeView in QML: https://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html
Good Morning, @sierdzio
Yes, I tried with treeView but I could not change the icon.
As I feed the treeview by reading a database table I have created a modelQStandardItem * item = new QStandardItem (QIcon ("qrc: /images/imagefolder.png"), "text item");Maybe I did not understand how to use the QIcon display?
-
In QML, you're responsible to populate the delegates yourself. https://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html#itemDelegate-prop You can add an Image component in the delegate and pass the path to your image through the model. Here's a tutorial for that https://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html
This does not looks very easy to do (I've never used TreeView in QML myself, though).
-
Hi,
You might want to take a look at KDAB's Declarative Widget project.
-
Good morning, here in Italy are 7.50 A.M.
The path of the model was started and also in the document "Using C ++ Models with Qt Quick" no reference is made to images or icons. Perhaps deepening is successful but I have not found any examples.
I used the QStandardItemModel because it indicated the possibility to associate an icon with the item.QStandardItemModel The QStandardItem class provides an item for use with the QStandardItemModel class QStandardItem(const QIcon & icon, const QString & text)Thanks for the indications of the Widget, I will ask the project manager if you can insert a widget not standard libraries.
As I have little time and since I'm working with WebEngine I will create the tree with an html page.
Thanks to everyone