比尔盖子
比尔盖子

Reputation: 3637

Need a GridView for Qt without QML

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?

Upvotes: 5

Views: 4306

Answers (3)

Gregorash
Gregorash

Reputation: 11

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

Upvotes: 0

milot
milot

Reputation: 1060

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.

Upvotes: 4

Zlatomir
Zlatomir

Reputation: 7044

QTableView or QTableWidget should be the starting points.

Upvotes: 2

Related Questions