Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. mvc
    Log in to post

    • SOLVED How to store file metadata for desktop application
      General and Desktop • c++ mvc files qt 5.9.5 • • Daniel_Contro  

      2
      0
      Votes
      2
      Posts
      35
      Views

      Use QStandardPaths and store settings using QSettings. It's simple and the standard way of doing things.
    • UNSOLVED Decouple the graphical user interface from logic (MVC/3-Layer)?
      General and Desktop • qwidget mvc architecture pattern-design • • TUStudi  

      7
      0
      Votes
      7
      Posts
      232
      Views

      You can create custom views if you want. See the Chart Example
    • UNSOLVED Hide or unhide a section in QTreeView/Model
      General and Desktop • treeview mvc • • Rizwan94  

      7
      0
      Votes
      7
      Posts
      474
      Views

      Hello, Thanks a lot for the replies. I found out another way by which we can hide the 'section' if the parent doesn't have any childrens. ui.treeView->setRowHidden(parentRow, rootIndex, true) In my example, Fruits - ............Apple ............Orange Animals - .............Lion .............Tiger Colors - ............Red ............Green ............BLue Fruits is 0th parent Animals is 1st parent Colors is the 2nd parent So whenever any of the children's are missing ( which we come to know while filling up the model ), I am setting the respective "parent" row as hidden. This approach worked fine and as expected. Is anything wrong with this approach? Model remains the same, only the view is hidden or unhidden based on some condition. Please Let me know.
    • How to avoid C++ models in Qt and why you should care
      Announcements • qml listview mvc listmodel architecture • • GTDev  

      2
      2
      Votes
      2
      Posts
      457
      Views

      Waiting for guide "How to avoid JavaScript models in Qt and why should you care" (performance, memory usage)
    • UNSOLVED Proper way of resizing model in QTableView
      General and Desktop • qtableview model mvc • • JoseTomasTocino  

      5
      0
      Votes
      5
      Posts
      728
      Views

      @VRonin That's really useful, thank you very much. Also I didn't know about the "Model test", that's nice too.
    • SOLVED One or Multiple QtTreeModel(s) in different Tabs?
      General and Desktop • model-view mvc tabs treemodel • • Opa114  

      13
      0
      Votes
      13
      Posts
      2918
      Views

      thanks. i will try it :)
    • UNSOLVED MVC with QGraphicsScene
      General and Desktop • qgraphicsscene mvc game • • JaffaCakes  

      1
      0
      Votes
      1
      Posts
      557
      Views

      No one has replied

    • "ContentFlow"/"GridFlow" item view/positioner/layout
      QML and Qt Quick • mvc grid view layouts flow • • morte  

      6
      0
      Votes
      6
      Posts
      1433
      Views

      I have posted suggestion about adding such positioner to QtQuick: https://bugreports.qt.io/browse/QTBUG-57549
    • SOLVED [SOLVED] How to get Object's pointer instantiated in QML engine
      QML and Qt Quick • quick mvc engine • • Kofr  

      2
      0
      Votes
      2
      Posts
      1157
      Views

      http://www.qtcentre.org/threads/66403-How-to-get-Object-s-pointer-instantiated-in-QML-engine?p=291959#post291959
    • UNSOLVED selection update on model sorting/re-ordering with Qt
      General and Desktop • model selection mvc proxy sort • • JulienLopez  

      3
      0
      Votes
      3
      Posts
      1011
      Views

      Yeah but the user also want to be able to reorder things as he wants, not just sort (ie, put this row here, drag all my selection at this position, invert these two rows, ...)
    • UNSOLVED Dropping into the folder with QAbstractItemView.
      General and Desktop • qtableview mvc drag&drop • • tokafr  

      2
      0
      Votes
      2
      Posts
      612
      Views

      @tokafr if i got you correct you want to drag&drop from your Qt application to the filesystem? If so take a look here.
    • UNSOLVED Accessing item delegate by model index or why Quick sucks when working with models?
      QML and Qt Quick • model quick mvc treev • • Kofr  

      11
      0
      Votes
      11
      Posts
      4746
      Views

      @p3c0 said: @Kofr So is it that you want to access the roles (namely hue, saturation, brightness) values from outside of this ListView delegate ? If so then did you accessing ListVIew model from outside ? Once you get hold of it the data can be accessed too. code above is just example, not my case. what I need is to get model.roleName of delegate j when I work in delegate i
    • UNSOLVED Set minimum column width to QTableView.
      General and Desktop • qtableview model-view mvc qheaderview • • tokafr  

      5
      0
      Votes
      5
      Posts
      14575
      Views

      Hi, You can try with the QHeaderView::minimumSectionSize property
    • UNSOLVED Remove border lines from QHeaderView.
      General and Desktop • qtableview mvc qheaderview qframe • • tokafr  

      1
      0
      Votes
      1
      Posts
      646
      Views

      No one has replied

    • UNSOLVED Find if file exists in QFileSystemModel.
      General and Desktop • mvc • • tokafr  

      1
      0
      Votes
      1
      Posts
      484
      Views

      No one has replied

    • SOLVED MVC Example in Qt
      General and Desktop • mvc design pattern oops • • Rohith  

      3
      0
      Votes
      3
      Posts
      1736
      Views

      @Rohith A controller is simply an object that controls both the model and the view. The following brief example should get you started: class MyController : public QObject { Q_OBJECT public: MyController(QObject * parent = NULL) : QObject(parent) { view.setModel(&model); } int exec() { view.show(); return QApplication::exec(); } private: // ... QTreeView view; QFileSystemModel model; }; And you use simply by creating the object and invoking the appropriate method(s). int main(int argc, char ** argv) { QApplication app(argc, argv); MyController controller; return controller.exec(); } @asanka424 However in my experiece, MVC cannot be implemented as cleanly as in a web application for a desktop application. Main reasone is that all UI widgets have some sort of controller embedded in already. For that reason Qt has something called Model-View architecture which is not the MVC pattern but something similar to de-couple your data from the view. Qt only applies the view as controller, but doesn't actually "require" the user programmer to follow. The same effect as and I'd say better could be obtained by separating the logic. One thing that springs to mind: no need to derive a whole class only to have a form initialized in the constructor. The only problem with MVC is that it's used with and without reason (as all "architectural" and "design" patterns are), because people are mislead to believe them as one size fits all solution. Kind regards.
    • UNSOLVED How to add to QListView additional data?
      General and Desktop • qlistview mvc • • Kaluss  

      4
      0
      Votes
      4
      Posts
      1124
      Views

      Viele danke Herr Sam :)
    • UNSOLVED Model-View-Delegate Problem
      QML and Qt Quick • qml qtquick mvc filedialog folderlistmodel • • Anas A. Ismail  

      1
      0
      Votes
      1
      Posts
      557
      Views

      No one has replied

    • UNSOLVED Photo Album Example
      QML and Qt Quick • model-view mvc folderlistmodel xmllistmodel m-v-delegate • • Anas A. Ismail  

      1
      0
      Votes
      1
      Posts
      640
      Views

      No one has replied

    • How to serialize QAbstractItemModel in QDataStream?
      General and Desktop • qabstractitemmo mvc serialization qdatastream • • Ralf  

      2
      0
      Votes
      2
      Posts
      1215
      Views

      Hi, There's no ready made code to dump your model since only you know what make sense to dump. So yes you'll have to write the dumper and loader yourself. QDataStream comes to mind for that task. Hope it helps
    • How to remove items from c++ model inside qml?
      QML and Qt Quick • qml qtquick model mvc • • flashmozzg  

      38
      0
      Votes
      38
      Posts
      10524
      Views

      @CoderJeff Oh. Sorry, I thought its other way. Didn't understood what you meant here.
    • Wanted: QT UI Developer (UK)
      Jobs • qt5 qtquick mvc user interface open source maidsafe • • nicklambert  

      1
      0
      Votes
      1
      Posts
      1672
      Views

      No one has replied

    • [SOLVED] mvc - update items as result of changing other items
      General and Desktop • qtreeview qstandarditemmo mvc • • sahadum  

      5
      0
      Votes
      5
      Posts
      1457
      Views

      No problem ! That's probably because they are not enabled, check your account settings for that.