Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a GridView for Qt without QML

Tags:

qt

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

GridView in QML support dynamic rows/columns, it's friendly to the users when resizing. Or, I have to implement it with QWidget and QGridLayout?

like image 640
比尔盖子 Avatar asked May 31 '13 14:05

比尔盖子


2 Answers

In my experience you have several possibilities:

  • As you said, use QGridLayout to display your custom data
  • QTableView works out of the box with Qt model classes, you can pretty much customize it easily to include widgets and other data as you wish.
  • Use QGraphicsView/QGraphicsScene to draw a grid, basically QML is built on top of QGraphicsView... it shouldn't be too hard.
like image 107
milot Avatar answered Nov 02 '22 23:11

milot


QTableView or QTableWidget should be the starting points.

like image 38
Zlatomir Avatar answered Nov 03 '22 00:11

Zlatomir