Forum
Sign Up
× DataGrid for Qt.C++

QtitanDataGrid ignores model headerDataChanged

9 years 8 months ago #1 by Josh Quigley
When the model raises 'headerDataChanged' signal, this is ignored by the QtitanDataGrid. Inspecting the dumpObject() output (shown below) it appears the view never connects to the signal.

Is there are way to trigger the view to update it's column headers?
OBJECT GenericParametersTableModel::unnamed

  SIGNALS OUT
        signal: destroyed(QObject*)
          --> Qtitan::GridModelController::unnamed modelDestroyed()
        signal: destroyed()
        signal: objectNameChanged(QString)
        signal: dataChanged(QModelIndex,QModelIndex,QVector<int>)
          --> Qtitan::GridModelController::unnamed modelDataChanged(QModelIndex,
QModelIndex)
        signal: dataChanged(QModelIndex,QModelIndex)
        signal: headerDataChanged(Qt::Orientation,int,int)      <---- No one is listening. 
        signal: layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::L
ayoutChangeHint)

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #2 by Developer Machines
In current implementation these signals are not handled. They will be added to the next major grid update - v 4.0.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #3 by ssss
I have the same Problem in Grid7.1, "headerDataChanged" donot work,and I cannot change head of tableview dynamicly

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #4 by Developer Machines
Implementation of this feature has been deferred as not a priority. We'll try to add it in the next update. Next update will be released next week.

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #5 by ssss
I have tried the recent update , with QtitanDataGrid 7.3.0 I can change content of the table header. But What I need is a dynamic change, the size of my header is not fixed; for example , I change the table from 5 columns to 6 columns, I failed again;

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago - 2 years 3 months ago #6 by Developer Machines
headerDataChanged() is used to notify about the text changing only.
To change the count of column you have to raise event QAbstractItemModel ::columnsInserted(const QModelIndex&, int, int). Also you can try to rebuild the layout completery with QAbstractItemModel::modelAboutToBeReset(), QAbstractItemModel::modelReset() events.
Last edit: 2 years 3 months ago by Developer Machines.

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.210 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )