Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ::index does no get called in QAbstractModel

::index does no get called in QAbstractModel

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 607 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by Qt Enthusiast
    #1

    I have a QAbstractModel and

    myAbstractModel* m = new QAbstractModel ;

    in that ::rowCount is 4

    but the function QModelIndex myTableModel::index(
    int xRow,
    int xCol,
    const QModelIndex & /xIndex/
    ) const
    {

    What can be the reason why ::index is not getting called

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Can you show the header file where you defined your model ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      Q 2 Replies Last reply
      0
      • dheerendraD dheerendra

        Can you show the header file where you defined your model ?

        Q Offline
        Q Offline
        Qt Enthusiast
        wrote on last edited by
        #3

        https://paste.ofcode.org/ym89AYX6yh66KVktDSQKZh

        Q 1 Reply Last reply
        0
        • dheerendraD dheerendra

          Can you show the header file where you defined your model ?

          Q Offline
          Q Offline
          Qt Enthusiast
          wrote on last edited by
          #4

          @dheerendra

          Send you
          https://paste.ofcode.org/ym89AYX6yh66KVktDSQKZh

          1 Reply Last reply
          0
          • Q Qt Enthusiast

            https://paste.ofcode.org/ym89AYX6yh66KVktDSQKZh

            Q Offline
            Q Offline
            Qt Enthusiast
            wrote on last edited by
            #5

            @Qt-Enthusiast

            Can u point me a basic example of how to create a QTableView with QAbstractModel

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              The pixelator example.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved