Subarray in array
-
wrote on 26 Jul 2016, 08:52 last edited by
Hi,
I have a QTableView which displays the content of a database.
There is information like product reference, quantity, ...Is it possible, when the user click on a row, to display a detailed subarray.
I want something like this :
I currently display two QTableview but it's not really ergonomic.
Thanks :)
-
Hi
It sort of remind me of
http://doc.qt.io/qt-5/qtwidgets-itemviews-editabletreemodel-example.htmlExcept you want for another col.
-
Hi
It sort of remind me of
http://doc.qt.io/qt-5/qtwidgets-itemviews-editabletreemodel-example.htmlExcept you want for another col.
-
wrote on 27 Jul 2016, 08:54 last edited by
-
wrote on 27 Jul 2016, 10:58 last edited by
It might not be 100% what you want but KSelectionProxyModel from KDE API might be a good compromise
-
wrote on 28 Jul 2016, 10:23 last edited by
I looked at the KSelectionProxyModel but it seemed a bit hard for me ^^
I choose an other solution :
Because my tree widget is a two-level hierarchy, i can identify my top-level items because they have child.So i applied a stylesheet :
QString style = "QTreeWidget::item " "{ " "margin-bottom: 10px;" "}" "QTreeWidget::item:has-children " // Apply only on my top-level item "{" "border-top: 1px solid black;" "background-color: lightGray" "}";
1/6