Skip to content
  • 0 Votes
    3 Posts
    254 Views
    SGaistS

    Hi and welcome to devnet,

    To your last question, yes you should move to CMake. There have been new features added in Qt 6 that will likely be of use for your project but that are only available through cmake.

    As for examples... maybe check some of the KDE's core projects. They already use CMake and some mix QML and C++.

  • 0 Votes
    3 Posts
    399 Views
    HowardHarknessH

    @timob256 First of all, I recommend against using protected mode. It is a subtle violation of the Liskov Substitution Principle that will bite you (or whomever gets stuck with the maintenance of this code).

    The immediate cure is to add an accessor in the public section of class wgt_screen:

    public: ... texnStructur getMyTexpr() {return _myTexpr;} ...

    Then, wherever you use_myTexpr.[fieldname] in the main window, use getMyTexpr().[fieldname] instead.

    Example:
    if(wgt->_myTexpr.outline)
    would become
    if(wgt->getMyTexpr().outline)

  • 1 Votes
    7 Posts
    9k Views
    SGaistS

    The controller concept is not specific to the MVC. MVC uses one of its incarnation.

    You can have a controller class that does the abstraction and handling of the lower level bits of you application while your GUI connects directly to it happily ignoring the gory details. No model required.

  • 0 Votes
    15 Posts
    29k Views
    p3c0P

    Hi @Alper,
    Here is what works.
    Use ScrollView instead of Flickable for scrollbars. Then as per this we need to explicitly set the contentItem as this newly created component.
    A very minimal example:

    import QtQuick 2.6 import QtQuick.Controls 1.4 Item { id: root width: 200 height: 200 ScrollView { id: scroll anchors.fill: parent } Button { text: "Load" onClicked: { var component = Qt.createComponent("Dummy.qml"); var obj = component.createObject(scroll); scroll.contentItem = obj } } } //Dummy.qml import QtQuick 2.6 Image { id: image; source: "http://placehold.it/650x650&text=\"Qt\"" }