Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create ms-access like continuous subforms (widgets) in Qt?

Tags:

c++

qt

qt4

pyqt

I'm thinking of porting my access application to Qt. I am interested to learn how to do continouos subforms, sub custom widgets for presenting/editing/inserting data from recordset in a verically scrollable non datagrid fashion. Meaning I could put button, label, combo, lineEdit... whatever, for every record.

I like QTableView and delegates. I just don't know if it could be modified to fully emulate access subform.

Sidequestion(maybe the same answer)... how do they DO those continuous forms in access under the hood.

thanks

... not real application data in that example recordset

design

the works

like image 981
Josip Avatar asked Apr 28 '12 06:04

Josip


1 Answers

Qt MVC is probably the best/easiest answer for your question ( http://qt-project.org/doc/qt-4.8/model-view-programming.html ), and with QTableView you should be able to achieve what you want.

Another solution could be: if you have a fix set of column items in every row you could simply design a QWidget with the contents of the row and paste your items (rows) into a QVerticalLayout.

Although I would sugget to try with MVC because that's the preferred way and in this case you could even port it to use QML UI if you want (while you can use the same data classes for the 'backend'). QML is definitely the best approach for (even slightly) animated UIs, and it's mature enough to use it already (it's part of Qt 4.8 and will be the 'star' of Qt 5).

like image 127
Viktor Benei Avatar answered Nov 16 '22 09:11

Viktor Benei