Multiple QGraphicsScene's view by one QGraphicsView's ?
Is this even possible?
I am trying to put multiple QGraphicsScene's into a widget, and then have tab bars along the top as a QTabBar.
The changing of the tabs in the QTabBar, trigger the single QGraphicsView to .setScene() to other QGraphicsScene's.
The problem I am having is that I get:
RuntimeError: 'init' method of object's base class (SubClassed_QGraphicsScene) not called.
Does anyone have any suggestions?
Hi and welcome to devnet,
Can you show the code that triggers this ?
Ah, your question has solved my answer I think.
They are basically being garbage collected before I get a chance to use them, as I am just creating them as instances without a QObject parent.
I will try that and see how I go.
Do you mean you are allocating them on the stack ?
No, I had a get method that created a copy then returned it, and therefore the original object no longer existed.