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. How to trigger on highlighted QTableWidget?

How to trigger on highlighted QTableWidget?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 509 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.
  • M Offline
    M Offline
    MasterBlade
    wrote on last edited by MasterBlade
    #1

    Hello, I have a QTableWidget that contains some card info.

    I want to display a card preview to the left. I used "on_CardList_pressed" function and it worked well when I click on any row.

    However, when I switch rows using arrow keys, the preview is not updating. I tried all other slots and none of them are working.

    Is there a way to know when a user highlights a different row using arrow keys?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      What about
      void QTableWidget::cellChanged(int row, int column)

      it should also trigger with keys ?

      M 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        What about
        void QTableWidget::cellChanged(int row, int column)

        it should also trigger with keys ?

        M Offline
        M Offline
        MasterBlade
        wrote on last edited by MasterBlade
        #3

        @mrjj said in How to trigger on highlighted QTableWidget?:

        Hi
        What about
        void QTableWidget::cellChanged(int row, int column)

        it should also trigger with keys ?

        Well, I tried this. It only display previews while the table is initializing. So I got a million debug errors.

        The most important thing is that after the table finishes initialization, it's not triggering anymore. Whether I click or use arrow keys the function is never called again.

        EDIT: Nevermind. I used on_CardList_currentCellChanged and everything worked just fine. Thanks for the suggestion.

        1 Reply Last reply
        1

        • Login

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