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. QTableView
QtWS25 Last Chance

QTableView

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.6k Views
  • 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.
  • X Offline
    X Offline
    xcround
    wrote on last edited by
    #1

    Hi,

    I'm trying to update a content on QTableView.
    I have the following:
    @
    QVariant tempVariant("tester");
    QModelIndex tempIndex = this->tbView->model()->index(....); //This returns the valid index that I want to change the value
    this->tbView>model()->setData(tempIndex, tempVariant, Qt::EditRole+2);//Column I want to change is defined by Qt::EditRole+2
    @
    Shouldnt this be it?
    Thanks

    1 Reply Last reply
    0
    • O Offline
      O Offline
      octal
      wrote on last edited by
      #2

      Could you show us the implementation of your setData model function ?

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xcround
        wrote on last edited by
        #3

        I have not overloaded the setData for that model.

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

          Does the base model you use have a functional implementation of it? QAIM's implementation does nothing.

          1 Reply Last reply
          0
          • X Offline
            X Offline
            xcround
            wrote on last edited by
            #5

            Well that answers why its not doing anything. Thanks =)

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

              How could it do anything? After all, it does know nothing about how in your subclass the data will be stored...

              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