Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [SOLVED]QTableWidgetItem, detect when it is changed

    General and Desktop
    2
    3
    13811
    Loading More Posts
    • 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
      Jake007 last edited by

      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 Reply Quote 0
      • A
        amban last edited by

        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 Reply Quote 0
        • J
          Jake007 last edited by

          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 Reply Quote 0
          • First post
            Last post