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 display selected row from a qtableview in annother one

How to display selected row from a qtableview in annother one

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5.11.3 c++
6 Posts 3 Posters 1.0k 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.
  • P Offline
    P Offline
    Protobot
    wrote on last edited by aha_1980
    #1

    Hi...! Please i want to display the selected row from second tableview in the first qtableview.I mean,the first window have a tableview and buttons ,so when you click on the button it open a second window containing the second qtablview displaying database contents.
    My problem is that I don't know how to display in the first qtableview the row i selected in the second one.
    i tried using selectedindexes() to take the index but don't know exactly how to call it in the first window's class.
    Thanks for helping me

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Something like this? https://api.kde.org/frameworks/kitemmodels/html/classKSelectionProxyModel.html

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Protobot
        wrote on last edited by
        #3

        Yes something like that.......!!!!

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Protobot
          wrote on last edited by
          #4

          But in my case i got two different windows (a QTabwidget button which open a QDialog),so you select in the QDialog and display the selected one in QTabwidget

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            You can pass the selection model to your dialog and create the proxy there.

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

            P 1 Reply Last reply
            1
            • SGaistS SGaist

              Hi,

              You can pass the selection model to your dialog and create the proxy there.

              P Offline
              P Offline
              Protobot
              wrote on last edited by
              #6

              @SGaist please an example to guide me on the right way,because i don't know how to do it

              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