开发者

How to view a table of tables in Qt?

I using Qt library. And I need to show a table of tables, and sort data in each sub-table.

For examlple something like this (2x2 table of 3x3 tables)

    sub 1   |  sub 2
-------------------------
| i | 0 | 0 | c | 0 | 0 |  s
-------------------------  u
| j | 0 | 0 | d | 0 | 0 |  b
-------------------------  1
| k | 0 | 0 | e | 0 | 0 |
-------------------------------
| a | 0 | 0 | c | 0 | 0 |
-------------------------  s
| b | 0 | 0 | d | 0 | 0 |  u
-------------------------  b
| c | 0 | 0开发者_如何学JAVA | e | 0 | 0 |  2
-------------------------

Any solutions are welcome.

ps. My idea is to implement a custom model with 2d array of models.


You can nest QTableView instances through use of the QAbstractItemView::setIndexWidget method. The data structure you use to maintain the QAbstractTableModel instances is inconsequential as long as each QTableView is assigned an appropriate model instance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜