Quote Originally Posted by Polnareff View Post
In my own code, I'd like to be able to have a Model for other widgets, like QTexEdit or QSpinBox.
Can you elaborate a bit on what you want to do... give us an example of the kind of problem you’re trying to solve?

The whole idea of what Qt calls a “model” is to manage a collection of data — a list, a table, a tree or some hybrid of those — in a consistent way that separates maintaining the data from displaying the data. Since QTextEdits and QSpinBoxes don’t display collections... it’s unclear, at least to me, what you’re hoping to accomplish.

If you really do want to display a Qt model — something derived from QAbstractItemModel — in a custom GUI widget, then subclassing QAbstractItemView would usually be the way to go.