I am writing a Qt front end to replace the current front end for a very old report writer. The current report writer has good functionality, it just needs a better design/preview interface. The current report writer returns a list of report line objects after parsing its definition. Two of the objects are complex: the query definition and the detail line layout. I have a QTreeView with a StandardItemModel that contains a node with one column for each line of the report Each line's data is stored in a QStandardItem as a variant with a class type of the old report writer line class. I have an item delegate that correctly shows one element from each line type, with just a single widget in each editor.
GOAL: I would like to have the tree nodes for each of complex line types show a set of editing widgets - QLineEdits/QComboBoxes for the query definition and a QSplitter with the column list/layout for the detail text lines with QLineEdits and QComboBoxes for individual column attributes. So now to the design questions...
1. The data is stored inside a user defined class, so I have to use the item delegate's paint function (no default available). Is there a reasonably quicker way to draw a combo box or a splitter than having to paint each element separately? I have three paint commands for a combo box...and I haven't even tried the splitter with a list of columns yet!
2. Do I need a container of some sort if I have multiple widgets in a delegate editor? If so, what container is best? Is there an 'easier' way to keep the painting and the editor display in synch?
3. I've considered a persistent editor. But my research so far indicates that it may not behave for inserting new rows/parents for new queries and detail lines. In any case, I'm off to try that, next. Opinions on this approach are welcome!
I've seen the thread in this forum on the multiple line text editor/display, and that's been very helpful, but it's one widget. Does anyone have a link to an example of multiple widgets for a single editor? Thanks in advance for any assistance!
Bookmarks