Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qml dynamic

    Log in to post
    • All categories
    • C

      Solved GUI Freezes When Loop is Started
      QML and Qt Quick • qml qml dynamic loop function thread • • closx

      7
      0
      Votes
      7
      Posts
      1002
      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!

    • B

      Solved ListView and PageIndicator - PageIndicator is not updated
      QML and Qt Quick • qml dynamic pageindicator listview flick listview • • BjoernK

      5
      0
      Votes
      5
      Posts
      1722
      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

    • B

      Unsolved Accessing either one of two components
      QML and Qt Quick • qt-quick qml binding qml dynamic • • ben80

      3
      0
      Votes
      3
      Posts
      660
      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?

    • C

      Unsolved Programmatic QML
      QML and Qt Quick • qml qml dynamic qml components • • corrino

      2
      0
      Votes
      2
      Posts
      1158
      Views

      S

      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(); } });
    • M

      Unsolved Path for SD Card.
      Mobile and Embedded • qml qml binding qml dynamic • • Mathan M

      6
      0
      Votes
      6
      Posts
      2458
      Views

      L

      Can you do

      property string strMmpkdataPath: "/sdcard/pathToMmpk/CARCommune.mmpk"
    • Z

      trying to use multiple columns with qml Tableview & QAbstractTableModel
      QML and Qt Quick • tableview qabstracttablem qml dynamic • • zeryx

      3
      0
      Votes
      3
      Posts
      1420
      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.

    • P

      Reference item id in a dynamic loaded file
      QML and Qt Quick • qml c++ embedded eglfs qml dynamic 5.4 • • PhTe

      6
      0
      Votes
      6
      Posts
      5458
      Views

      p3c0

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

    • A

      Define a delegate with different type elements
      QML and Qt Quick • qml dynamic qml delegate • • Arturo Pablo R

      5
      0
      Votes
      5
      Posts
      2048
      Views

      A

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

    • L

      How can the language translation in current screen possible?
      General and Desktop • qt5 qml dynamic • • lalvishnu12

      2
      0
      Votes
      2
      Posts
      708
      Views

      SGaist

      Hi,

      It's described here

    • K

      Dynamic create and delete Object
      QML and Qt Quick • qml dynamic • • kDohmen

      4
      0
      Votes
      4
      Posts
      1061
      Views

      sierdzio

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