Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Row Selection in QTableWidget
Forum Updated to NodeBB v4.3 + New Features

Row Selection in QTableWidget

Scheduled Pinned Locked Moved Solved Qt for Python
2 Posts 2 Posters 496 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.
  • R Offline
    R Offline
    Richie123
    wrote on last edited by Richie123
    #1

    Hi all, In my project, I am populating a TableWidget with Names sorted in alphabetical order. The selected (checked) names will be printed out and further used.
    At present, it starts scanning from top to check and get all the selected rows.
    I want a behaviour where the scanning happens in the order, user selected. Eg:
    Qtablewidget rows.
    A
    B
    C
    D

    If user selected First C, then D and then A, output should be C D A...
    At present it is giving A C D order.

    Is there a way to capture the selected rows continuosly ??
    Also i had another thought where as soon as user selects a row that row can be moved to top (swap or shifting the already existing row) but cannot find a way to implement it !!! Is it possible?

    jsulmJ 1 Reply Last reply
    0
    • R Richie123

      Hi all, In my project, I am populating a TableWidget with Names sorted in alphabetical order. The selected (checked) names will be printed out and further used.
      At present, it starts scanning from top to check and get all the selected rows.
      I want a behaviour where the scanning happens in the order, user selected. Eg:
      Qtablewidget rows.
      A
      B
      C
      D

      If user selected First C, then D and then A, output should be C D A...
      At present it is giving A C D order.

      Is there a way to capture the selected rows continuosly ??
      Also i had another thought where as soon as user selects a row that row can be moved to top (swap or shifting the already existing row) but cannot find a way to implement it !!! Is it possible?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Richie123 said in Row Selection in QTableWidget:

      Is there a way to capture the selected rows continuosly ??

      Yes, for example https://doc.qt.io/qt-5/qtablewidget.html#cellClicked

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      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