Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. how to find the number of entered cells in QTableWidget

how to find the number of entered cells in QTableWidget

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 333 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.
  • Q Offline
    Q Offline
    qtqt5
    wrote on last edited by
    #1

    Hi, I'm using Pyqt5.I made a table with 100 rows and 2 columns by using QTableWidget.
    The rows are user defined. Not all rows have to be used but the rows entered must be entered in order. If the user will use 5 rows, she/he must fill in from the 1st to the 5th rows.
    There should be no rows skipped in between

    With which code I can find out how many rows of the table are used.
    I'm wondering how many rows are active in the table ?
    I entered 5 rows out of 100 rows. I want to know that 5 rows are used or I entered 27 rows out of 100 rows I should retrieve "27 rows " .
    rowCount or selectedIndexes are not useful , I've tried many things. Answer can be very easy but I'm confused. If you have any experience, can you share with me ?
    Thank you for your attention.

    1 Reply Last reply
    0
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      https://doc.qt.io/qt-5/qtablewidget.html#cellChanged could be part of a solution, along with tracking each edited cell in a set.
      Another alternative is https://doc.qt.io/qt-5/qtablewidget.html#findItems using a regular expression match.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      0

      • Login

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