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. QTableWidget, how to check if a certain row is selected or not?
Forum Updated to NodeBB v4.3 + New Features

QTableWidget, how to check if a certain row is selected or not?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 7.3k 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.
  • A Offline
    A Offline
    azyx12
    wrote on last edited by
    #1

    Hi,

    In my code, I used selectRow(int) to select rows. Now, I need to know if a certain row is selected. Is there such a function in Qt? Thanks in advance.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Not directly, but you can call selectedItems() or selectedIndexes() method and check if the row you're looking for is on the list.
      Other method would be to take a first item in that row and check if isSelected() returns true.

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