[SOLVED] QTableWidget SIGNAL for rowCountChanged() needed
General and Desktop
3
Posts
2
Posters
2.1k
Views
1
Watching
-
wrote on 7 Dec 2014, 11:25 last edited by
Hi,
I have a QTableWidget with two columns and zero rows at the beginning. The user can now add/remove rows dynamically by button click.
What I need now is a SIGNAL that detects when the rowCount changes, because I need to check the inputs and whether the table is empty or not..I have two solutions which are not much pretty:
- Calling a function (SLOT for my needed SIGNAL) after the button click directly
- Starting a QTimer that checks the rowCount every time
Does anyone have a better solution?
Thank you in anticipation. -
Call model() to get a pointer to underlying model and connect to rowsInserted() and rowsRemoved() signals of it.
-
wrote on 7 Dec 2014, 13:03 last edited by
And again, thank you very much! It works fine :-)
-
1/3