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 share selections on different views with different models applied
Qt 6.11 is out! See what's new in the release blog

How to share selections on different views with different models applied

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 626 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.
  • K Offline
    K Offline
    KaoN
    wrote on last edited by
    #1

    Here is my case,
    I have one global model, but several proxy models to serve different views,
    so how can I share the selections between views easily?

    Thank you!

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I don't see a simple solution here. Imo you have to sync them manually because they rely on different indexes (the different proxy models).

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        KLinkItemSelectionModel from KDE is the solution: https://api.kde.org/frameworks/kitemmodels/html/classKLinkItemSelectionModel.html

        The KItemModels module is cross platform

        "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

        K 1 Reply Last reply
        3
        • VRoninV VRonin

          KLinkItemSelectionModel from KDE is the solution: https://api.kde.org/frameworks/kitemmodels/html/classKLinkItemSelectionModel.html

          The KItemModels module is cross platform

          K Offline
          K Offline
          KaoN
          wrote on last edited by
          #4

          @VRonin Thank you VRonin, looks like a charming solution.

          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