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. MVP Using Qt
Forum Updated to NodeBB v4.3 + New Features

MVP Using Qt

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 6.8k 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.
  • N Offline
    N Offline
    narayanan.krish
    wrote on 17 Jan 2014, 04:56 last edited by
    #1

    Hello all !
    Can someone help me to find any good links for tutorials/examples for MVP (Model-View-Presenter) using Qt.

    Thanks & Regards,
    Narayanan K

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 17 Jan 2014, 05:28 last edited by
      #2

      You can refer this "here":http://qt-project.org/doc/qt-4.8/model-view-programming.html

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • N Offline
        N Offline
        narayanan.krish
        wrote on 17 Jan 2014, 09:08 last edited by
        #3

        Hi,
        I was looking for Model View Presenter (MVP) which I feel is somewhat different from MVC. Kindly correct me if my understanding is wrong.

        Thanks & Regards,
        Narayanan K

        1 Reply Last reply
        0
        • R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 17 Jan 2014, 10:03 last edited by
          #4

          since Qt provided classes follow the MVC principle you would have to code your own classes to implement the MVP pattern.

          A rather "dirty" way to achieve what you want would be to get all the logic inside the model, when you want to use Qt provided classes.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • N Offline
            N Offline
            NicuPopescu
            wrote on 17 Jan 2014, 11:56 last edited by
            #5

            Hi,

            imho comparing qt MVC principle with whatever application design pattern MVC,MVP,MVCP is confusing, since the first one has an architectural focus and the second one has the "real" application design perspective. Qt MV, like MS MFC doc/view architecture, focused on how to display a model object data in several different views(in general of the same type, I mean it's not trivial to display a tree model in a list view): I have not longer mentioned the controller part because qt doc says "If the view and the controller objects are combined, the result is the model/view architecture", I think by setModel() view, meaning that the model is manged direct by view, without any controller class. The model's internal data is meant to be actually the data model in the application's MVC design, or part of it in most of the cases. The application MVC design has different perspective and for simplicity I would say : an UI has more than one view widgets and it displays data models whose parts are integrated in qt views models.

            in MVC, the controller object, at some point in the application, must become aware of model and view, in some applications even it creates them and it is the bridge between them. The controller must be accessible from anywhere in the application, or at least from any view. Now the presenter takes some roles from the controller: it is the bridge between one view and the controller, it creates the view, and have methods called in view(UI) event handlers: in this way the UI is kept very light, as much as possible having just the creating and event handling code; the interaction with the rest of the application is done through the presenter: the presenter updates data (through app controller->model) and shows them in the related view. Actually as far as I know it is practiced that for any different view is there a different presenter in the application...

            1 Reply Last reply
            0
            • N Offline
              N Offline
              narayanan.krish
              wrote on 17 Jan 2014, 13:00 last edited by
              #6

              Thanks a lot for the reply...
              It was really useful.

              Thanks & Regards,
              Narayanan K

              1 Reply Last reply
              0

              1/6

              17 Jan 2014, 04:56

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved