[Qt-interest] QTableWidget refresh

Lucas.Betschart at crypto.ch Lucas.Betschart at crypto.ch
Tue Jun 21 09:23:10 CEST 2011


Thats my function. It's triggered when you press a button.

The table has 3 rows (username, password, protokoll).

{

chatAccount newAccount ={ui->lineEditChatUsername->text(),ui->lineEditChatPassword->text(),ui->comboBoxChatProtokoll->itemData(ui->comboBoxChatProtokoll->currentIndex()).toString()};

int nextAccountNr = chatAccountList.count();

chatAccountList.append(newAccount);

QTableWidgetItem *chatUsername = new QTableWidgetItem(ui->lineEditChatUsername->text());

ui->tableWidgetChat->setItem(nextAccountNr, 0, chatUsername);

QTableWidgetItem *chatProtokoll = new QTableWidgetItem(ui->comboBoxChatProtokoll->itemData(ui->comboBoxChatProtokoll->currentIndex()).toString());

ui->tableWidgetChat->setItem(nextAccountNr, 0, chatProtokoll);

ui->lineEditChatUsername->clear();

ui->lineEditChatPassword->clear();

ui->tableWidgetChat->repaint();

}

________________________________
Von: Lodron, Gerald [mailto:Gerald.Lodron at joanneum.at]
Gesendet: Dienstag, 21. Juni 2011 08:58
An: Betschart Lucas
Betreff: AW: QTableWidget refresh

Its a little bit hard to find the error on that two line description, can you post your code of adding/deleting table entries?

________________________________
Von: qt-interest-bounces+gerald.lodron=joanneum.at at qt.nokia.com [mailto:qt-interest-bounces+gerald.lodron=joanneum.at at qt.nokia.com] Im Auftrag von Lucas.Betschart at crypto.ch
Gesendet: Dienstag, 21. Juni 2011 08:56
An: qt-interest at qt.nokia.com
Betreff: [Qt-interest] QTableWidget refresh

Hello,

When I add or delete columns to my table I can't see them.

I already tried QTableWidget->repaint(), and refresh, but that didn't work.


Any ideas?..

Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110621/fc9d119f/attachment.html 


More information about the Qt-interest-old mailing list