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. QStandardItem subclassing?
Forum Updated to NodeBB v4.3 + New Features

QStandardItem subclassing?

Scheduled Pinned Locked Moved General and Desktop
24 Posts 6 Posters 12.0k Views 1 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.
  • B Offline
    B Offline
    Beka
    wrote on last edited by
    #21

    Okay thank you, i try to override some other methods on model, which can be the problem, and if it wont wors, i paste the code

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Beka
      wrote on last edited by
      #22

      I have one more question, if I override operator<() will it be called by QStandardItem::sort() ?? because i was said to override operator<() to sort like we want, but would be it ever called from sort() ??

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #23

        It should be called from there yes. It is the whole point of the function being there and being virtual.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Beka
          wrote on last edited by
          #24

          I dont know how to reimplement method item, that it will return myItem, i looked into the sourcecodes, but i dont know what to do... a just think about copy data from myModel->item(r,c); but the method return the pointer, and i will then dont return the exact pointer
          @QStandardItem *QStandardItemModel::item(int row, int column) const
          {
          Q_D(const QStandardItemModel);
          return d->root->child(row, column);
          }@

          and i think about the reimplementing the setItem, because i dont know either how to do it :(
          i dont know what to do... sources doesnt help me much, that are so many functions i cant use

          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