Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get value of cell in QTableWidget on double clicking?
Qt 6.12 LTS is out! See what's new in the release blog

How to get value of cell in QTableWidget on double clicking?

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

    I am trying to get the value of a cell and store it in a variable, on double clicking a cell (itemdoubleclicked event) in QTableWidget. I know that it should be done by itemdoubleclicked event handler, but not sure how to get value of that cell.
    How to solve this
    thank you

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2
      QObject::connect(tableWidget,&QTableWidget::itemDoubleClicked,[](QTableWidgetItem *item){
      QVariant myData = item->data(Qt::DisplayRole);
      qDebug() << myData;
      });
      

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      3
      • D Offline
        D Offline
        dziko147
        wrote on last edited by
        #3

        thanks for your fast reply

        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
        • Unsolved