HI @ all,
wie kann ich bei QT Spalten einer Tabelle zur Laufzeit erzeugen. Sprich, wie kann ich zur Laufzeit meine Tabelle variabel abändern (Spalten ausblenden / einblenden)
Gruß
Erzeugen von Tabellenspalten zur Laufzeit
Code: Alles auswählen
tableWidget->column(item)->hide()
http://doc.trolltech.com/4.3/qtablewidg ... Count-prop
die Doku hilft...
AlLternativ in deinem Datamodell auf grund geaenderter daten zur Lufzeit das reset() aufrufen .... und das (Table)Widget hat dann nix besseres zu tun als sich komplett neu aufzubauen
Performanter iss dem widget mit
void beginInsertColumns ( const QModelIndex & parent, int first, int last )
void beginInsertRows ( const QModelIndex & parent, int first, int last )
void beginRemoveColumns ( const QModelIndex & parent, int first, int last )
void beginRemoveRows ( const QModelIndex & parent, int first, int last )
void endInsertColumns ()
void endInsertRows ()
void endRemoveColumns ()
void endRemoveRows ()
genauer mitzuteilen was man tut und das widget kann (oder koennte) viel subtiler auf die aenderungen reagieren ....
Ciao....
Performanter iss dem widget mit
void beginInsertColumns ( const QModelIndex & parent, int first, int last )
void beginInsertRows ( const QModelIndex & parent, int first, int last )
void beginRemoveColumns ( const QModelIndex & parent, int first, int last )
void beginRemoveRows ( const QModelIndex & parent, int first, int last )
void endInsertColumns ()
void endInsertRows ()
void endRemoveColumns ()
void endRemoveRows ()
genauer mitzuteilen was man tut und das widget kann (oder koennte) viel subtiler auf die aenderungen reagieren ....
Ciao....