Skip to content
  • 0 Votes
    3 Posts
    186 Views
    C

    Thanks for your reply.
    One thing to note is that if I hadn't turned on the virtual keyboard on MacOS, this Dialog destruction wouldn't have caused the program to crash.

  • 0 Votes
    1 Posts
    133 Views
    No one has replied
  • 0 Votes
    7 Posts
    1k Views
    C

    @jsulm U are da king!

    I am dealing with QML for months, and just learning the property variables! That kinda saved my life mate!
    Thank you very much!

  • 0 Votes
    5 Posts
    2k Views
    B

    @jpnurmi said in ListView and PageIndicator - PageIndicator is not updated:

    The bindings are fine. The problem is that the ListView has only snapMode set, but highlightRangeMode seems to be missing. Therefore the ListView is not changing its currentIndex while flicking.

    snapMode does not affect the currentIndex. To update the currentIndex as the list is moved, set highlightRangeMode to ListView.StrictlyEnforceRange.

    https://doc-snapshots.qt.io/qt5-5.9/qml-qtquick-listview.html#snapMode-prop

    Thank you @jpnurmi.
    The following line solved the problem:

    highlightRangeMode: ListView.StrictlyEnforceRange

    Somehow I missed another thread: https://forum.qt.io/topic/81429/listview-does-not-change-currentindex-when-scrolling/6

  • 0 Votes
    3 Posts
    856 Views
    B

    Good idea, i will try that as soon as i find some spare time.

    Though, that cannot be the final solution. I would have to copy too much code.
    So, what's the right way of doing it?

  • Programmatic QML

    Unsolved QML and Qt Quick
    2
    0 Votes
    2 Posts
    1k Views
    shavS

    Hi,

    If I understand correctly you want to load some components dynamically, right? If so you can read this document.

    Also you can use Loder component for load QML file dynamically. This component can be use for load qml files from local resource or from public server.

    In my application I use this methods for load qml components dynamically:

    /** @brief Create dynamic object from QML file. * @param qml Path to QML file. * @param parent Parent instance. * @param options List of options fields. * @param onComplete Callback function which will call when qml component will be loaded.*/ function createComponentFromQMLFile(qml, parent, options, onComplete) { if(qml !== null && qml !== undefined && qml.length > 0 && parent !== null && parent !== undefined && options !== null && options !== undefined && onComplete !== null && onComplete !== undefined && onComplete instanceof Function) { var tmp = Qt.createComponent(qml); if(tmp !== null) { if(tmp.status === Component.Ready) { var itemInstance = tmp.createObject(parent, options); if(itemInstance !== null) { onComplete(itemInstance); } else { console.log("[EditorHelper] ERROR: Can't create object."); onComplete(null); } } else if (tmp.status === Component.Error) { console.log("[EditorHelper] ERROR: "+tmp.errorString()); onComplete(null); } else { tmp.statusChanged.connect(function () { if (tmp.status === Component.Ready) { var item = tmp.createObject(parent, options); if(item !== null) { onComplete(item); } else { console.log("[EditorHelper] ERROR: Can't create object."); onComplete(null); } } else if (tmp.status === Component.Error) { console.log("[EditorHelper] ERROR: "+tmp.errorString()); onComplete(null); } }); } } else { console.log("[EditorHelper] ERROR: Can't load QML file '"+qml+"'."); onComplete(null); } } else { console.log("[EditorHelper] ERROR: Incorrect parameters."); onComplete(null); } }

    usnig like this:

    options = {}; //here you can set any properties from you qml object which need to create. var qml = "qrc:/qml/Components/ErrorMessageWindow.qml"; //Path to qml file from resources for load. //appRootWnd - parent element to which you want to add you dynamic object. EditorHelper.createComponentFromQMLFile(qml, appRootWnd, options, function(wnd) { //here you can set any code which was called when objections will be created and loaded. if(wnd) { wnd.open(); } });
  • Path for SD Card.

    Unsolved Mobile and Embedded
    6
    0 Votes
    6 Posts
    3k Views
    L

    Can you do

    property string strMmpkdataPath: "/sdcard/pathToMmpk/CARCommune.mmpk"
  • 0 Votes
    3 Posts
    2k Views
    R

    Hi @zeryx
    I've tried your code with the change below and it works fine (columns are getting populated at runtime)

    use var headerData = baseTableModel.headerList
    instead of var headerData = headers at line number 11 in schedulerViewingPane.qml (http://hastebin.com/genuhisodu.sm).

    Since you are already passing EmployeeModelTable instance baseTableModel to the qml then why not use the headerList property from the instance instead of setting it again.

  • 0 Votes
    6 Posts
    6k Views
    p3c0P

    @PhTe Right it wont work. It cannot anchor to an item which is not its parent or sibling.

  • 0 Votes
    5 Posts
    2k Views
    A

    @Quteroid Thanks, i really bealive i will learn more about javascript

  • 0 Votes
    2 Posts
    805 Views
    SGaistS

    Hi,

    It's described here

  • 0 Votes
    4 Posts
    1k Views
    sierdzioS

    Check with valgrind to be sure, but I think it is OK (use deleteLater() or destroy() method: link).