I have a QTableView with some items in it. If i click on any row, that particular row has to expand with some QPushButtons in it. I had attached the screen shot of it. How can i achieve this? Need ur help. Thanks in Advance.
Asked
Active
Viewed 3,153 times
0

New Moon
- 787
- 6
- 21
- 35
-
Would a two-level-depth [QTreeView](http://qt-project.org/doc/qt-4.8/qtreeview.html#details) with multiple columns be an alternative? – Andreas Fester Oct 02 '12 at 12:31
-
1This is not possible with a `QTableView`. As Andreas pointed out you should use a `QTreeView` instead – Chris Oct 02 '12 at 16:03
1 Answers
1
This could easily be done with QML.
If you check out the Models and Views: ListView Example, the expanding delegates example does exactly what you need.
The picture that you describe above could be built in QML as QML ListView with embedded QML Row Elements.

stackunderflow
- 10,122
- 4
- 20
- 29
-
2Thanks for your suggestion. But i dont want it to be done with QML. Can you plz suggest me a solution with Qt/C++ itself. – New Moon Oct 03 '12 at 05:23
-
1@stackunderflow thanks. 4 years later, your answer saved me lots of time. I tried to do this with tableview's rowDelegate, but apparently it is simply not designed for something like this. – Mar 07 '16 at 14:14