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. Proxy Models
Forum Updated to NodeBB v4.3 + New Features

Proxy Models

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

    Hello,

    I've one genreral question regarding view-proxymodel-model desgin within qt.

    My sourceModel tracks e.g. 10 different measurement values. It should be the source model of a proxymodel connected to
    a GridView. The displayed measurement values can be configured by the GUI.

    Now it should be possible to display 10 times the same measurement value or 10 different mesaurement values.

    My proxymodel has to map the GridView index via mapToSource to an valid source model index. I think that this works already.

    But how do i map a source Index to multiple proxyIndexes? This is allways the case when I configuring the GUI to display the same measurement value multiple times. Studying the interface of mapFromSource only one QModelIndex is returned.

    So the general problem can be formulated as:
    Is it possible to implement 1:n and n:1 index mapping from source to proxy and vice versa?

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

      @approx said in Proxy Models:

      Is it possible to implement 1:n and n:1 index mapping from source to proxy and vice versa?

      short answer: not out of the box and even a manual solution seems quite challenging
      details: https://forum.qt.io/topic/71784/simplest-way-to-write-m-to-n-eg-aggregating-proxy-models

      "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

      A 1 Reply Last reply
      1
      • VRoninV VRonin

        @approx said in Proxy Models:

        Is it possible to implement 1:n and n:1 index mapping from source to proxy and vice versa?

        short answer: not out of the box and even a manual solution seems quite challenging
        details: https://forum.qt.io/topic/71784/simplest-way-to-write-m-to-n-eg-aggregating-proxy-models

        A Offline
        A Offline
        approx
        wrote on last edited by
        #3

        @VRonin

        Many thanks for answering.

        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