Results 1 to 6 of 6

Thread: MVC question

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default MVC question

    Hi,

    I have a class (class CTool) that I want to be represented using MVC approach.
    Class CTool has three types of parameters that have to be represented on a QTreeView, Configuration, Input and Output. The parameters are stored on a single QList.

    I'm thinking on creating a QDockWidget that will contain a QTabWidget(three tabs for each parameter type). Each tab have a QTreeView(I think so).

    Have I to use three QTreeViews, one for each tab? Have you a better idea how to represent this data?

    Thanks,
    Òscar Llarch i Galán

  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: MVC question

    If you want them to be independent then you need three views. But you can represent three types of information in one view, where the type of information is one level of data and the information itself is a sub-level. In other words parameters are child items of parameter types.
    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.


  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MVC question

    Hi,

    And what about representing it on a QTableView(or a Tree view)? First row "Configuration", then the Configuration parameters. Then another row "Input" and the Input parameters, ...

    I think that maybe will be clearer by the user.

    Sometimes I don't really know how to represent some data to be beautiful because I'm the only programmer. An then, asking here and reading your ideas is perfect.

    Thanks,
    Òscar Llarch i Galán

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MVC question

    Hi,

    I'm creating the Model that will represent my classes.

    I have a list like "QList<myClass>" and I want to represent "myClass" at index depending on the application state, so one time I have to show the "myClass" at position 0, then maybe I need to shot the "myClass" at position N.
    Have I to create a Model for each "myClass" instance or can I use the same model clearing it and filling it again with the new data?
    Òscar Llarch i Galán

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MVC question

    Hi,

    Have I to create a Model for every "myClass" instance and change the model of the view?

    Thanks,
    Òscar Llarch i Galán

  6. #6
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MVC question

    Hi,

    I don't know where to start.
    I have a class "CTool" that have a "QList<CParameter>". Each parameter can store "int", "double" or "QString" depending on its type. The "CTool" objects are created dynamically and also can be deleted.
    I want to create a Model that have two columns, first one "parameter name" and the second one "value".
    When I create a "CTool" object I have also to create a model that represent it, right? Where I create it? Have I to create a "CToolModel" into the "CTool" class?

    I'm reading the docs and don't know how to do this.

    Thanks,
    Òscar Llarch i Galán

Similar Threads

  1. Replies: 0
    Last Post: 31st May 2009, 16:51
  2. Useless but curious compiler warning question
    By Raccoon29 in forum General Programming
    Replies: 4
    Last Post: 30th July 2008, 20:46
  3. SQL Question
    By ^NyAw^ in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2008, 19:36
  4. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38

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.