[SOLVED] QTableWidget SIGNAL for rowCountChanged() needed



  • 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:

    1. Calling a function (SLOT for my needed SIGNAL) after the button click directly
    2. Starting a QTimer that checks the rowCount every time

    Does anyone have a better solution?
    Thank you in anticipation.


  • Moderators

    Call model() to get a pointer to underlying model and connect to rowsInserted() and rowsRemoved() signals of it.



  • And again, thank you very much! It works fine :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.