Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Comparing two abstractItemModels
Qt 6.11 is out! See what's new in the release blog

Comparing two abstractItemModels

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Suths
    wrote on last edited by
    #1

    Hi all this is more of a design question.

    Say I have two QAbstractItemModels where i would like to compare the elements with in each to find elements that are different, where each element contains a comparison function. What approach would you take.

    Cheers

    1 Reply Last reply
    0
    • VinorcolaV Offline
      VinorcolaV Offline
      Vinorcola
      wrote on last edited by
      #2

      Well, are those two QAbstractItemModel objects instances of the same class? Because, if it is, you can easily create a method that take the other instance as a parameter, and returns a list of the elements that are not in the two models.
      If it is two different classes, well, I'll be a bit more difficult ^^.

      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
      • Unsolved