Results 1 to 4 of 4

Thread: qmlfolderlistmodelplugin

  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default qmlfolderlistmodelplugin

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qmlfolderlistmodelplugin

    If you need a model that represents the file system, have a look at QFileSystemModel

    Cheers,
    _

  3. #3
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Re: qmlfolderlistmodelplugin

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qmlfolderlistmodelplugin

    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,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    codeman (3rd March 2014)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.