Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QTableWidget SIGNAL for rowCountChanged() needed
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QTableWidget SIGNAL for rowCountChanged() needed

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Binary91
    wrote on 7 Dec 2014, 11:25 last edited by
    #1

    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.

    1 Reply Last reply
    0
    • C Online
      C Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on 7 Dec 2014, 12:24 last edited by
      #2

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Binary91
        wrote on 7 Dec 2014, 13:03 last edited by
        #3

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

        1 Reply Last reply
        0
        • J JonB referenced this topic on 10 Apr 2024, 11:11

        1/3

        7 Dec 2014, 11:25

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved