Results 1 to 2 of 2

Thread: Basic Qt Application Design

  1. #1

    Default Basic Qt Application Design

    I want to build a flowcharting application in Qt to get some practice modeling GUI applications. All it has are draggable boxes and circles that can be connected with straight lines.

    As this is my first GUI application, I am unsure how one typically designs such a project. Here are my two designs.

    1) Build a bunch of model classes (Box, Circle, Line, etc) and associated views (e.g. BoxView, CircleView, etc). The model objects have properties like color, x, y, width, height. The view classes subclass Qt UI elements. Then there are controllers like BoxMoveController that receives mouse events from the UI and updates the box view and box model appropriately. Or perhaps it is better if the box view receives the event, updates itself, and then passes the event to the controller to update the model? Now, I create application logic for the flowcharting logic that works on the model (like connect lines to boxes). The UI updates itself accordingly by the model notifying the view objects when an update to the model occurs.

    2) Forget about the model stuff and build a "view-centric" application. Build a bunch of classes (Box, Circle, Line, etc) that subclass Qt UI elements. Then build application logic for the flowcharting stuff on top of these classes.

    Which is better? What would you do differently?

  2. #2
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Basic Qt Application Design

    You should look at the documentation for the Diagram Scene Example. It is launchable with the Demo tool under Graphics View as well.

Similar Threads

  1. Multiplatform Video Viewer Application Design Options
    By PhilippB in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2008, 09:38
  2. Client-Server Application design suggestion
    By berzeck in forum Qt Programming
    Replies: 6
    Last Post: 17th December 2007, 18:13
  3. Application design using MVC
    By markd_mms in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2007, 08:32
  4. Basic: problem building designer application
    By kingslee in forum Qt Tools
    Replies: 2
    Last Post: 31st August 2006, 15:26
  5. application design questions
    By nikita in forum Qt Programming
    Replies: 6
    Last Post: 28th August 2006, 00:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.