Proxy Model or Normal Model For This?
(I'll provide code if requested, but this is more of a "philosophy" question in my opinion)
I have a subclassed QAbstractListModel which doesn't do anything special except for custom data roles. That model is used for a bunch of stuff, so it should be its own "thing."
But I'm also making an "editor" proxy model which takes the single-column source model, and adds additional columns for options such as "edit" "hide" "delete." This will be hooked up to a QTableView, and will have an item delegate drawing those additional options as buttons and, ideally, handling the click events via editorEvent.
So my question is about the "Editor" model. Since it refers to the source model, my instinct was to subclass a QAbstractProxyModel. mapToSource and mapFromSource hard-codes the column to 0 in both cases, since I can't properly map a column from a one-column model to a many-column model.
But then, in my delegate's editorEvent, the index I receive is correctly from the editor proxy model, but it's always column=0, so I can't determine which column/button was "pressed." It appears there are built-in mechanisms (which I didn't write) which cause the index to get mapped from source?
So, that's getting into some nasty territory in my opinion.
Alternatively, I could just subclass a QAbstractTableModel instead of a "real" proxy, and do it that way. But isn't that "incorrect" since it would be dependent upon a source model anyway?