Home > Mobile >  Questions about tablewidget and tabwidget in QT
Questions about tablewidget and tabwidget in QT

Time:10-11

Have A, B, C three Windows, there is A window in the window A tabwidget controls B (including buttons and tablewidget), click on the button pop-up window C, input data to insert in the window of tablewidget B, test data into A success (mysql connection) but tablewidget display data is not updated, how to solve

CodePudding user response:

CodePudding user response:

When you insert the data need
beginInsertRows (QModelIndex (), 0, 0).
M_dataLst. Insert (0, data);
endInsertRows ();

Or all of the refresh (in the case of large amount of data will flash)
BeginResetModel ();
M_dataLst. Insert (0, data);
EndResetModel ();

CodePudding user response:

refer to the second floor the ghost grass response:
when you insert the data need
beginInsertRows (QModelIndex (), 0, 0).
M_dataLst. Insert (0, data);
endInsertRows ();

Or all of the refresh (in the case of large amount of data will flash)
BeginResetModel ();
M_dataLst. Insert (0, data);
EndResetModel ();


The code red?? Where is it?

CodePudding user response:

refer to 3rd floor is not easy to easy to reply:
Quote: refer to the second floor the ghost grass response:

When you insert the data need
beginInsertRows (QModelIndex (), 0, 0).
M_dataLst. Insert (0, data);
endInsertRows ();

Or all of the refresh (in the case of large amount of data will flash)
BeginResetModel ();
M_dataLst. Insert (0, data);
EndResetModel ();


The code red?? Where is it?

Oh oh, understand
  •  Tags:  
  • Qt
  • Related