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 select complete row from QTableWidget

How to select complete row from QTableWidget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 16.7k 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.
  • I Offline
    I Offline
    Indrajeet
    wrote on last edited by
    #1

    Hi All

    I have created a Table using QtableWidget and inserted cells in it using QTableWidgetItem;
    When i click any cell only that particular cell gets displayed as selected.
    How to show that complete row as selected when user clicks any of the cell?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      Call this method for you QTableWidget
      @setSelectionBehavior(QAbstractItemView::SelectRows);@

      --
      Vasiliy

      Jimmy CrabJ 1 Reply Last reply
      2
      • V vsorokin

        Call this method for you QTableWidget
        @setSelectionBehavior(QAbstractItemView::SelectRows);@

        Jimmy CrabJ Offline
        Jimmy CrabJ Offline
        Jimmy Crab
        wrote on last edited by
        #3

        @vsorokin said in How to select complete row from QTableWidget:

        Call this method for you QTableWidget
        @setSelectionBehavior(QAbstractItemView::SelectRows);@

        It works, thank you for sharing.
        Here's the way in QtDesigner:
        2022-05-15_15-58-44.png

        Just do it.

        1 Reply Last reply
        2

        • Login

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