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
Forum Updated to NodeBB v4.3 + New Features

How to select complete row from QTableWidget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 16.4k 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 11 Oct 2011, 08:53 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 11 Oct 2011, 08:58 last edited by
      #2

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

      --
      Vasiliy

      J 1 Reply Last reply 15 May 2022, 08:08
      2
      • V vsorokin
        11 Oct 2011, 08:58

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

        J Offline
        J Offline
        Jimmy Crab
        wrote on 15 May 2022, 08:08 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