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
3
votes
4 answers

What are criticisms against using "display_order" fields in your database design?

In my company's software product, a number of database tables make use of a "display_order" field. It's an integer that controls the display order of the elements on the page. Deep down in my gut, I feel like this is a bad practice. (Or at least, a…
Tac-Tics
  • 1,895
  • 13
  • 19
3
votes
1 answer

How to take a RGBA screenshot with puppeteer?

Im working on a image comparison web application with puppeteer and here's what im trying to do: open a puppeteer page, go to a rendering page with a model-viewer(a google's web graphic API) web component. render something with model-viewer take a…
Jiaxin Sun
  • 71
  • 4
3
votes
1 answer

Advice on how to use Qt Model View classes

So I have been writing a Sudoku game in C++. I have most of the game logic done and tested, but I wanted to use Qt on top of it for the GUI. I was trying to figure out the best way to work with the Qt classes for my needs. As a test, I played…
Matt
  • 5,478
  • 9
  • 56
  • 95
3
votes
2 answers

QML TreeView display nodes by levels or custom delegate

I have a tree model derived from a QAbstractItemModel. And I can display the data in a tree like way. What I want is to display teh data by the layers. To display only one level of a layer at a time AND put each layer on a stack and navigate…
Bob
  • 1,433
  • 1
  • 16
  • 36
3
votes
2 answers

How to get other fragment's ViewModel

I have an external event that changes several fragments state, As I am using Android architecture components I've created several ModelViews for every fragment. What is the right way to send messages between ModelViews
Andrew Matiuk
  • 924
  • 1
  • 7
  • 21
3
votes
2 answers

MVC 5: ViewModel / Passing lists for the create

So I am currently studying and analyzing the use of ViewModels. In my Application (a so called "Restaurant") I want the ability for my "users" to create a menu. When they want to create a menu: They can choose the name + the amount of persons that…
Kahn Kah
  • 1,389
  • 7
  • 24
  • 49
3
votes
1 answer

Qt use same model for QListView and QTableView

I'm trying to use the same model to display pieces of information on 2 different kind of view. I need to show information about 150 objects that have a description and can be either on or off. One of the view is a summary of the on/off states of my…
3
votes
1 answer

Qt Model-View: What's the correct way to update the model and then the view when the data is stored and changed outside the model in a std::vector

I have subclassed a QTableModel and the data I want to be displayed is the contents of an std::vector which I keep a reference to in my model. I have subclassed a QTableView to represent MyClass objects and display different properties of MyClass…
nik4emniy
  • 143
  • 1
  • 9
3
votes
2 answers

how to store and retrieve custom data (using QtCore.Qt.UserRole?) with Qtableview /QAbstractTableModel in pyqt?

I'm quite new in the use of model/view framework and I'm having some trouble, I'm using a Qtableview and a QAbstractTableModel on a widget and I'm trying to store some custom data in the QModelIndex using the "data" method from the…
MrX
  • 33
  • 1
  • 1
  • 4
3
votes
1 answer

Sharing one model between two views that display different columns of data

In this case, I am working with legacy code. I have a large dequeue data structure. This is the data source. I need two QTableView widgets on a single dialog that utilize the same data source but show different columns of data. Since each table…
user2836797
3
votes
3 answers

Do I need to notify QTableView that the amount of columns changed in QAbstractTableModel subclass?

I have my own QAbstractTableModel subclass. When new data is inserted in it - I issue beginInsertRows/endInsertRows and then dataChanged with correct indexes. rowCount seems to be changed OK as I see scroller appear and grow, but .... columnCount is…
Zeks
  • 2,265
  • 20
  • 32
3
votes
2 answers

A checkbox only column in QTableView

I have a table in Sqlite database which I display using QTableview and QSqlQueryModel. The first column needs to have a header which is a checkbox and all the items in the column need to be checkboxes too. I have implemented the first column header…
gfernandes
  • 1,156
  • 3
  • 12
  • 29
3
votes
1 answer

Custom abstract widgets with PyQt

I have made a couple of projects in PyQt now, and I am becoming more familiar with the model/view school of thought that Qt adopts. I have used this for things like list and table views with a custom model behind them to display and manipulate data.…
horriblyUnpythonic
  • 853
  • 2
  • 14
  • 34
3
votes
1 answer

How to use QCalendarWidget with QDataWidgetMapper?

I currently have my calendar widget mapped using QDataWidgetMapper like this (using PySide): self.mapper.addMapping(self.ui.calendar, 2, "selectedDate") And it does display the correct date when I do: self.mapper.toFirst() But my problem is that…
3
votes
0 answers

Styling Qt Model/View items based on their ItemDataRole properties

I have a QTreeView with items from my own model (QAbstractItemModel derived). Now I would like to style the items (with a stylesheet on the QTreeView) so that depending on various properties they would have various backgrounds. Also it seems that…
Adam Badura
  • 5,069
  • 1
  • 35
  • 70
1 2
3
17 18