Hello friends,
is the above mentioned plugin only for usage in qml project or can I use QQuickFolderListModel also from c++?
How should I link against the plugin??
Thanks
Printable View
Hello friends,
is the above mentioned plugin only for usage in qml project or can I use QQuickFolderListModel also from c++?
How should I link against the plugin??
Thanks
If you need a model that represents the file system, have a look at QFileSystemModel
Cheers,
_
The main reason why i ask is, the possible feasibility to use components developed for qml use also to use in normal c++ apps. For reducing redundant development efforts. So what do i have to keep in mind for the hybrid usage of components which are mainly developped for qml usage.
Ah, but that is an entirely different question.
The QQuickFolderListModel is, judging by its name, obviously something that is intended to be used in conjecture with QtQuick. Its API will likely specifically address the needs of QtQuick, e.g. mapping roles into role names, not exposing a tree (no tree view in QtQuick yet).
Also it apparently comes as a plugin, probably to enable "apps" with only QML code, or to not require build time linking.
A class designed for use with QML doesn't have to be QtQuick friendly unless QtQuick is one of the deployment scenarios. It doesn't have to be in a plugin if the application(s) using that class have a C++ starter (i.e. main() function).
The only hard requirement for classes directly instantiable from QML is that they are QObject derived.
It is additionally best to have setter/getters also available through a Q_PROPERTY declaration, as this enables property bindings in QML code instead of just calling the functions (setters are often slots already).
In some cases it makes sense to have the same class available to both language environments, in some cases it doesn't.
Cheers,
_