Need a GridView for Qt without QML

Is there a GridView implementation for native Qt (and not for QML)? I need to read some data from the model and put it in a GridView.

GridView in QML supports dynamic rows / columns, it is convenient for users when resizing. Or should I implement it using QWidget and QGridLayout ?

+4
source share
3 answers

In my experience, you have several options:

  • As you said, use QGridLayout to display your user data.
  • QTableView works out of the box with the Qt model classes, you can easily customize it easily to include widgets and other data.
  • Use QGraphicsView / QGraphicsScene to draw the grid, basically QML is built on top of QGraphicsView ... it should not be too complicated.
+4
source

QTableView or QTableWidget should be the starting points.

+2
source

Here is a commercial data grid for Qt / C ++ http://www.devmachines.com/qtitandatagrid-overview.html We use it without any problems.

0
source

Source: https://habr.com/ru/post/1483808/


All Articles