Results 1 to 2 of 2

Thread: Model View Controller in Qt

  1. #1
    Join Date
    Jul 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Model View Controller in Qt

    Hi everyone this is my first post on this forum and since i'm a Qt newbie, I' ll try to make my answer as clear as possible.

    As many other not-so-expert programmers I'm struggling to understand how to use Model-View-Controller in Qt. As far as I understood reading Qt docs and other question, there isn't a real MVC implementation in Qt, but there's a Model-View-Delegate paradigm, which is similar. However I can't understand how should I use the pre-defined Qt classes.

    My application should be a image comparator: You load two images from the filesystem, and the program displays them side by side so that you can actually see the differences. The problem is that I have to do that using MVC. So for the Model I choose the QStandardItemModel: with this I would store the images as QPixmap (At least I think.. ). But for the View part I don't know what to use: there are QColumnView, QHeaderView, QListView, QTableView, and QTreeView.

    Here is my issue. How can any of these classes be useful to display two images side by side?? I just can't figure it out. So if you could help me I' d be grateful!! Thank you!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Model View Controller in Qt

    I think you should rather have a custom model operating directly on QImage and use two QTableView instances for displaying the images.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Model-view-controller example?
    By brcain in forum Newbie
    Replies: 5
    Last Post: 25th November 2015, 04:24
  2. i dont understand Model-View-Controller (MVC)?
    By complexcoding in forum Qt Programming
    Replies: 1
    Last Post: 31st January 2013, 10:34
  3. Model view Controller Library
    By luisvaldes88 in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2011, 02:36
  4. File Manager - Model View Controller problem.
    By Mateusz1990 in forum Newbie
    Replies: 0
    Last Post: 10th April 2011, 12:20
  5. Replies: 0
    Last Post: 21st April 2010, 12:23

Tags for this Thread

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.