August 19, 2011

xcround xcround
Lab Rat
9 posts

QTableView

 

Hi,

I’m trying to update a content on QTableView.
I have the following:

  1. QVariant tempVariant("tester");
  2. QModelIndex tempIndex = this->tbView->model()->index(....); //This returns the valid index that I want to change the value
  3. 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

5 replies

August 19, 2011

octal octal
Lab Rat
74 posts

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

August 19, 2011

xcround xcround
Lab Rat
9 posts

I have not overloaded the setData for that model.

August 19, 2011

Andre Andre
Area 51 Engineer
6031 posts

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

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

August 19, 2011

xcround xcround
Lab Rat
9 posts

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

August 19, 2011

Andre Andre
Area 51 Engineer
6031 posts

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

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

 
  ‹‹ QList<QLabel *> static or dynamic?      SQL, export to word ››

You must log in to post a reply. Not a member yet? Register here!