Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. modeldata
    Log in to post

    • UNSOLVED create listView with certain items from array
      General and Desktop • listview model array modeldata • • Ldweller  

      1
      0
      Votes
      1
      Posts
      383
      Views

      No one has replied

    • SOLVED Auto Generating Model code
      General and Desktop • modeldata • • clogwog  

      7
      0
      Votes
      7
      Posts
      1326
      Views

      What I usually feel like suggesting is not to subclass the model at all. use QStandardItemModel only via the QAbstractItemModel interface (you can force yourself by declaring QAbstractItemModel* model =new QStandardItemModel(parent);). If the model's performance is really a drag for your application you can go the length and implement a model subclass (with all its gotchas) changing just 1 line in your existing code
    • SOLVED How to create a new instance of a c++ Model exposed to qml via setContextProperty ?
      QML and Qt Quick • modelview modeldata • • Curtwagner1984  

      6
      0
      Votes
      6
      Posts
      2093
      Views

      The issue was solved by registering the C++ model with QML as an Instantiable Object Type as described here and then instantiating the model from QML for each new search page, as described in this topic: Is it possible to expose a C++ Class that doesn't have a default constructor to QML ? Thank you for everyone who tried to help!
    • UNSOLVED Unite data from two QSqlRelationTableModel into one TableView
      General and Desktop • sql modelview modeldata • • SergeyK12  

      8
      0
      Votes
      8
      Posts
      2448
      Views

      @SergeyK12 said in Unite data from two QSqlRelationTableModel into one TableView: I reimplement the following method of QIdentityProxyModel: data, index, columnCount add a private field with QSqlRelationTableModeland the setter. I suppose there is something alse which i should reimplement to make field in 5 cell editebel. SetData ofcource, but why is it in a gray mode? There is a method which make cells editable? You can't have a proxy model with 2 source models. internally it will rely on mapFromSource and mapToSource which won't work in your case, start directly from QAbstractItemModel. The methods you reimplemented are fine, you miss rowCount(), setData() and flags() use KDE (but its too hard to build a library). no it's not... detailed instructions to build any tier 1 KDE module (spoiler alert: it's only 9 cmd lines): https://forum.qt.io/topic/76533/copy-selected-rows-of-a-table-to-a-model/12
    • UNSOLVED Resizing axis causes artifacts in a LineSeries binded to QAbstractTableModel
      QML and Qt Quick • qml qtquick2 qtcharts modeldata • • nickaein  

      1
      0
      Votes
      1
      Posts
      669
      Views

      No one has replied

    • UNSOLVED How to pass a function as model data?
      QML and Qt Quick • qml model function modeldata role • • jdcordoba  

      4
      0
      Votes
      4
      Posts
      1526
      Views

      That's a brilliant and elegant solution! Thank you bro for spending your precious time with a newbie like me!