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. [solved]sort 2 tablewidgets simultaneously
Forum Update on Monday, May 27th 2025

[solved]sort 2 tablewidgets simultaneously

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 720 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.
  • I Offline
    I Offline
    iskenderoguz
    wrote on 11 Mar 2015, 11:51 last edited by iskenderoguz 3 Dec 2015, 14:27
    #1

    I have 2 tablewidgets in form. I clicked column of first tablewidget and it was sorted. I want that second tablewidget was sorted wit same order. For example:

    first tablewidget

    ee
    cc
    bb
    aa
    dd
    ff

    and second tablewidget

    1
    2
    3
    4
    5
    6

    When I click column of first tablewidget, it becomes

    aa
    bb
    cc
    dd
    ee
    ff

    is it possible to second tablewidget is sorted automcatically like

    4
    3
    2
    5
    1
    6

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Mar 2015, 21:47 last edited by
      #2

      Hi,

      To be sure: QTableView or QTableWidget ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • I Offline
        I Offline
        iskenderoguz
        wrote on 11 Mar 2015, 22:33 last edited by
        #3

        QTableWidget

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 11 Mar 2015, 22:44 last edited by
          #4

          Then AFAIK, you will have to do it manually.

          It might be simpler to use 2 QTableViews with a common QAstractTableModel containing all the data

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • I Offline
            I Offline
            iskenderoguz
            wrote on 12 Mar 2015, 14:27 last edited by iskenderoguz 3 Dec 2015, 14:33
            #5

            Thanks to you and this topic I solved my problem

            1 Reply Last reply
            0

            4/5

            11 Mar 2015, 22:44

            • Login

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