Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QTableView

    General and Desktop
    3
    6
    2247
    Loading More Posts
    • 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
      xcround last edited by

      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 Reply Quote 0
      • O
        octal last edited by

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

        1 Reply Last reply Reply Quote 0
        • X
          xcround last edited by

          I have not overloaded the setData for that model.

          1 Reply Last reply Reply Quote 0
          • A
            andre last edited by

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

            1 Reply Last reply Reply Quote 0
            • X
              xcround last edited by

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

              1 Reply Last reply Reply Quote 0
              • A
                andre last edited by

                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 Reply Quote 0
                • First post
                  Last post