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]QTableWidgetItem, detect when it is changed
QtWS25 Last Chance

[SOLVED]QTableWidgetItem, detect when it is changed

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 15.2k Views
  • 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.
  • J Offline
    J Offline
    Jake007
    wrote on last edited by
    #1

    Hi!

    I have a class which inhertis_QTableWidget_. I'd like to detect all changes made to it's QTableWidgetItems. I've looked through docs, but I did not find any method that does that. Only thing I found are signals with which I can track current selected cell.
    Can this be done with QTableWidget or will I have to either use models or inherit from QTableWidgetItem and write my own signals? ( But again, I haven't found any method that QTableWidgetItem has, to provide detection whenever it was changed).

    Thanks in advance.

    Regards,
    Jake


    Code is poetry

    1 Reply Last reply
    0
    • A Offline
      A Offline
      amban
      wrote on last edited by
      #2

      Hi Jake,
      You are correct, the signals are very useful in detecting any kind of change to your QTableWidget. Signals not only track current selected cell but following -

      @
      void cellActivated ( int row, int column )
      void cellChanged ( int row, int column )
      void cellClicked ( int row, int column )
      void cellDoubleClicked ( int row, int column )
      void cellEntered ( int row, int column )
      void cellPressed ( int row, int column )
      void currentCellChanged ( int currentRow, int currentColumn, int previousRow, int previousColumn )
      void currentItemChanged ( QTableWidgetItem * current, QTableWidgetItem * previous )
      void itemActivated ( QTableWidgetItem * item )
      void itemChanged ( QTableWidgetItem * item )
      void itemClicked ( QTableWidgetItem * item )
      void itemDoubleClicked ( QTableWidgetItem * item )
      void itemEntered ( QTableWidgetItem * item )
      void itemPressed ( QTableWidgetItem * item )
      void itemSelectionChanged ()
      @

      Remember the tablewidget items are not inherited from QObject and hence will NOT have signals.
      The signals can hence be tracked from the QTableWidget.

      Thanks
      Thanks

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jake007
        wrote on last edited by
        #3

        Hi!

        I've found this but there is a lot of confusion. Most of them are just for tracking. After looking through it again, I noticed itemChanged(QTableWidgetItem *). I completely missed it.

        Thanks!

        Marked as solved.

        Regards,
        Jake


        Code is poetry

        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