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. Complete Model / View Seperation
Forum Update on Monday, May 27th 2025

Complete Model / View Seperation

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 576 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.
  • D Offline
    D Offline
    DaveR
    wrote on last edited by DaveR
    #1

    My colleagues are interested in refactoring a mid-size (15,000 line) application to use a complete separation of Qt from the model. That is to say, the model would not contain any "Q" types at all and would live in a separate directory. A controller would then be used to talk to the view.

    We're used this architecture to good effect in the past, for a real-time application. In this case the threading model was more complex (since it was for real-time apps), so it was advantageous to have the underbelly in pure C++.

    In the case of our current application however I'm not so sure. It's a single-threaded application and most of the data that would be contained in the "model" is view-related data anyway, such as panel positions and widget sizes.

    My question is, how often is a complete separation of model from view an approach that is used in practice for Qt? Is this something you've personally used to good effect?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Honestly if you don't have constraints I suggest to use Qt classes also for the backend model side.

      Using Qt you can easily use the Model/View classes or other features that could be useful for the application logic like networking, thread management, database connection ans so on.

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      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