I have a class derived from QGraphicsView that creates a GUI only if created by the main.
So, this works:
Code:
int main(int argc, char *argv[]) { QGraphicsScene scene; scene.setSceneRect(0, 0, 1024, 768); gui view(&scene); view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setWindowFlags(Qt::FramelessWindowHint) ; view.setFixedSize(1024, 768); view.show(); return a.exec(); }
And this doesn't work:
Code:
Starter::Starter() { s.setSceneRect(0, 0, 1024, 768); gui view(&s); view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setWindowFlags(Qt::FramelessWindowHint) ; view.setFixedSize(1024, 768); view.show(); }
Why ?
The main problem is that I need a GUI with an empty constructor as my main application will load a plugin (the GUI) that will create a GUI based on a QGraphicsScene.
So the Starter could create the QGraphicsScene and pass it to the gui class, but it doesn't work.

