in the past, I have done a few small applications in QT. The user interfaces of my applications only contained a bunch of "standard" widgets (a few buttons, spacer, text fields...). However now, I want to build something bigger and more complex. The application I want to create, contains a pretty complex (at least for me) table structure.
I tried to design the layout in Excel (to see, if this kind of table structure is user friendly and works in general) and now I want to implement it with QT. I attached a picture, so that you can see how the table should look like at the end. For each day some kind of "sub-table" should be created, where the user can enter some values. If the user scrolls to the right, a new sub-table (with a new date) should be created. So basically, I want to create a pretty dynamic table. If the user scrolls to the left, he sees the old entries and if he scrolls to the right, new entries are created.
What's the best way to create this kind of table structure? Should I use a QTableWidget/QTableView structure and modify it like Excel does it (color cells, add spacings between cells...) or is it better to create some kind of custom widget (maybe a few textfields grouped together?)?
I would really appreciate if someone could give me an advice on how to start. At the moment, I am kind of lost...
Warning: Answers to this question will be largely opinion based.
One problem that I see with creating one huge complex table is adaptability: what if you ever want to start grouping cells, collapsing/expanding sections, styling, enable/disable whole days, etc? Sure you could do this by hiding table cells and tracking which cells are headers and such but this approach will be missing many of the benefits that predefined controls provide.
You might want to consider subdividing your table into hierarchy of "panels": the top level panel is one row: your left-most static panel and then one panel per day; your next level is, within each day, you have a table with one column, the top row is your values panel, then your parameters panel, then your products panel. Finally, in each of those you have a "regular" table.
The actual Qt widgets you would use: one or more of QtGridLayout, QtBoxLayout, QtHBoxLayout, QtVBoxLayout, and maybe QtStackedLayout. See http://qt-project.org/doc/qt-4.8/layout.html for examples.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments