Questions tagged [model-view]

model-view describes the relationship between the model and the view when using model-view-controller

Model-view-controller is an architecture to separate the model (data) and the view (interface). The model contains the information for a program while the view is the interface with the user. The controller is used to update the model from user input and to update the view when the model changes.

259 questions
1
vote
1 answer

Transition from C#/WPF to C++/Qt: dinamically generate a button list

I'm trying to learn some Qt programming (C++) and for everything UI-related I come from C# with WPF/MVVM. The problem is that I'm having problems switching the reasoning process behind my choices. What I'm trying to do is to link a list (or vector…
Marco
  • 1,454
  • 1
  • 16
  • 30
1
vote
1 answer

How to properly design an MV application in Java Swing?

I'm trying to design an MV (Model-ViewController) application in Java swing. I'm having trouble with assigning the correct model to each ViewController. Here's my current design (not the actual names) : The idea is that I have two views : the Gui…
Rosh Donniet
  • 418
  • 2
  • 10
1
vote
1 answer

QAbstractItemModel for QMetaObject, do I have to write it myself?

A suite of data models built on top of Qt's reflection system seems like a natural synergy, but I haven't found such a beast in the Qt library itself or from a 3rd party. Does anyone know if such a thing exists? I'm look for data models for editing…
Dan O
  • 4,323
  • 5
  • 29
  • 44
1
vote
1 answer

How does @ModelAttribute send data to jsp

I have a query. I am using @ModelAttribute on a function in a formController. @ModelAttribute("modelAttrVar") public ModelAttr function(){ ModelAttr obj = new ModelAttr(); //...code return obj; } But this model attribute is not added…
Software Company
  • 151
  • 4
  • 15
1
vote
0 answers

How to represent a "choice" as a WFormModel::Field

By "choice" I mean something akin to ; that is, a selection from among multiple specific items. I know there's WAbstractListModel, but that doesn't offer any way to represent a chosen/selected item, and I can't determine how (or even if)…
feuGene
  • 3,931
  • 2
  • 33
  • 46
1
vote
0 answers

QT Quick Model Provider?

I have QT application that has a number of panels that I would like to flexibly load a run time. Instead of each View having a predefined singleton Model declared is it possible to declare a singleton "model provider" and have it return a model…
JeffV
  • 52,985
  • 32
  • 103
  • 124
1
vote
1 answer

PyQt4 - Using a QItemDelegate to display widget in a QListView

I want to have a QListView which displays custom widgets. I guess the best way to do this would be a QItemDelegate. Unfortunately I don't quite understand how to subclass it correctly and how to implement the paint() method, which seems to be the…
vicco
  • 1,049
  • 2
  • 14
  • 33
1
vote
2 answers

PyQt4 QAbstractListModel - Only first data widget is displayed

I'm trying to implement the QAbstractListModel class in order to display several similar widgets. The following code shows my problem: import sys from PyQt4 import QtCore from PyQt4 import QtGui class Model(QtCore.QAbstractListModel): def…
vicco
  • 1,049
  • 2
  • 14
  • 33
1
vote
1 answer

PyQt4 - How to get the QModelIndex of an element of a model

I have implemented the QAbstractItemModel as a tree structure. It is working fine, but for my next step I need to be able to get the QModelIndex of a node, but I'm not sure how to do that.ö This is my TreeModel class…
vicco
  • 1,049
  • 2
  • 14
  • 33
1
vote
1 answer

Qml equivalent of QDataWidgetMapper

I have a Tree based on a QAbstractItemModel and a qml TreeView to display its content. Now I would like to have a two-part UI with the TreeView on the left and some input form for different fields from the model on the right. The input fields should…
Simon Schmeißer
  • 324
  • 4
  • 12
1
vote
0 answers

Qt Model/View SQL recommandation

I'm just started with the Qt's Model/View framework and I try to find the best solution to a problem that seems commun and probably very simple. I have an Employee table (Id, LastName, FirstName, Salary) and I would like to display two different…
Aesope
  • 445
  • 6
  • 15
1
vote
2 answers

Propagate changes in model to view in Silverlight

in my Silverlight 4 Application I have an ObservableCollection that I data bind to two different listboxes. The listboxitems showing the content of the MyClass-Object. When I add an item to the ObservableCollection, the new item is displayed in both…
Aaginor
  • 4,516
  • 11
  • 51
  • 75
1
vote
1 answer

DataGrid Single Cell row and column from click using MVVM

I have DataGrid and I am trying to get the cell details (column,row and value) of a selected cell using MVVM and avoid putting in any changes to the code behind. My data grid looks like this
Nick Tucker
  • 323
  • 7
  • 14
1
vote
1 answer

Use viewmodel to bind data with html.dropdownlistFor in asp.net-MVC

I need to create @html.dropdownlistFor where data is coming from database. I have modelView which combining two classes. One for user and another one is Group. it suppose to show records of user in grid table along with drop down where group can be…
K.Z
  • 5,201
  • 25
  • 104
  • 240
1
vote
1 answer

Most efficient PyQt Model selection in big trees

I'm currently selecting multiple rows in a model tree with the code below. But it can be really slow in big sessions with loads of nodes. I suspect this is not very efficient as it's probably selecting the rows one by one. Is there anything that…
mtmt
  • 173
  • 1
  • 10