Hi,
I have written a program in which i have implemented Graphics View Framework..the output is there and it s perfect ,but the problem is that i have written the command of show() in my class constructor while in the main where i have instantiate the object of that class ,the
show() shows an empty screen...
but i think its the common and good practice to put show() command in the main
In Conctsructor It work fine
{
..
view.setScene(scene);
view.show(); // WORKS FINE HERE
..
}
TrainingUI::TrainingUI(QGraphicsView *parent):QGraphicsView(parent)
{
..
view.setScene(scene);
view.show(); // WORKS FINE HERE
..
}
To copy to clipboard, switch view to plain text mode
But in Main it shows an empty screen
#include "trainingui.h"
int main(int argc, char *argv[])
{
TrainingUI w;
w.show(); // EMPTY SCREEN
return a.exec();
}
#include "trainingui.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
TrainingUI w;
w.show(); // EMPTY SCREEN
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks