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

No injector factory bound for Class<>

I saw the same question in stack but they try to fix the error with the @ContributesAndroidInjector but in Dagger documentation says use @ContributesAndroidInjector is only optional, so here are my classes: My…
David
  • 414
  • 7
  • 17
1
vote
2 answers

Dagger inject Context in a ModelView

I'm trying to inject the Context in my ModelView but I'm a little bit confused: Here is my Module, I send him an Application for later use the context from this, but I don't know where it comes from this Application or how to take it: @Module class…
David
  • 414
  • 7
  • 17
1
vote
1 answer

TableView: go to new line at the end of the window

I tried to explane my issue through and image.
Francesco
  • 21
  • 4
1
vote
0 answers

Qt::ToolTipRole not getting triggered

I am using a model implemented using QAbstractTableModel. I want to show individual tooltips for all the headers. In the data() and headerData() implementations, however, When I print the role, it is never becoming Qt::ToolTipRole. Is there anything…
1
vote
1 answer

How can I link a ListView to ModelView?

I want to create a ListView with the names and the codes of the products in my ModelView but when I do: Only the Product Guids are showed. How could I create…
Jaime Oro
  • 9,899
  • 8
  • 31
  • 39
1
vote
1 answer

How to restore Model state in MVP?

App Descripion I'm trying to implement for my first time an Android app with MVP, where a message (taken from a pool of messages) is displayed and it's changed when the user click on the screen. Once all message have been displayed, the process will…
justHelloWorld
  • 6,478
  • 8
  • 58
  • 138
1
vote
1 answer

What is the proper way of communicating data between data classes (model) and the View/Controller classes in Qt?

I am implementing an application that is like Facebook in Qt5. For now in my App I just want to view profiles of people, add new ones and view detailed info of a profile. I decided on a MVC archetecture for my app. I want to know how the…
rjasi
  • 11
  • 2
1
vote
2 answers

Removing rows from QAbstractTableModel derived class don't work, why?

I have a Qt application for which I derived my own model class from QAbstractTableModel. I have implemented the necessary methods as prescribed in the documentation. When I call removeRows method the changes are correct in my View (the rows I…
Symbiosoft
  • 4,681
  • 6
  • 32
  • 46
1
vote
1 answer

Creating SQL Database Table in C# using the existing Model class

I already have modelling classes for the tables for my sqlite database. I would like to use the same classes to create tables on the SQL localhost server. Is it possible to do it "automatically"? Or do I need to run the SQL command by inserting all…
1
vote
0 answers

Qt multiple views and same model with selected row

I've been working with Qt for around a year now and I still struggle the most with working with custom Models/Views. Especially tree like structures. I have a class called Account which represents website like account objects: class Account: …
Wallboy
  • 154
  • 5
  • 14
1
vote
0 answers

How to signal QAbstractItemModel::dataChanged with changes to few columns only?

After updating the model data of my derived class of a QAbstractItemModel, I do not want the listeners (assume a QTreeView) to completely update all of the tree representation, but only the data in an individual column of most of the rows. Example:…
Sty
  • 760
  • 1
  • 9
  • 30
1
vote
0 answers

QTableView displaying a subset of rows in a random order

I'm looking for a way to have a QTableView show a subset of the total rows in the QAbstractTableModel in a random order. I have found QSortFilterProxyModel to display a subset of rows (filter). However, it can't do a random order, it can only do…
Jeroen3
  • 919
  • 5
  • 20
1
vote
0 answers

Does Qt have a model-driven version of QTabBar or QTabWidget?

I want to create a Qt widget that looks like a QTabWidget but where the list of tabs is drawn from a (Qt Model View architecture) data model, like QListView etc. Since QTabWidget has to have separate widgets on each page, this will probably be…
Joe P
  • 466
  • 3
  • 8
1
vote
1 answer

how to set QLineEdit to readonly if the data mapped by QDataWidgetMapper is readonly?

I have a tree model and use QDataWidgetMapper to map the model data to some widgets. In the model, some of the data are flagged as read-only, so, what I would like to do is to let the mapped widget, say, a QLineEdit, be able to act upon this flag…
Jerry Ma
  • 511
  • 4
  • 15
1
vote
1 answer

How to split a complex hierarchical Model into two partial Views?

I'm learning the Model/View paradigm of Qt because it seems very well suited to edit the data structures I have to deal with, such as this one: Addition |_QuadraticFunction | |_intercept=0.2 | |_slope=0.0 | |_quadratic=1.2 …
jmborr
  • 1,215
  • 2
  • 13
  • 23