To simplify the explanations I'd say I work by validating function parts, that are :
* using a QStatemachine :
QState *s1 = new QState();
QState *s2 = new QState();
QState *s3 = new QState();
s1->assignProperty(&button, "text", "Click me"); //Property is assign only when state-machine is started.
machine.addState(s1);
machine.addState(s2);
machine.addState(s3);
machine.setInitialState(s1);
// Definition de l'enchainement des états
s1->addTransition(&button, SIGNAL(clicked()), s2);
s2->addTransition(&button, SIGNAL(clicked()), s3);
s3->addTransition(&button, SIGNAL(clicked()), s1);
// Definition de l'action des états
s1->assignProperty(label1, "text", "Splash screen");
s2->assignProperty(label1, "text", "1 Menu");
s3->assignProperty(label1, "text", "3 Maintenance");
machine.start();
layout->addWidget(&button);
layout->addWidget(label1);
QState *s1 = new QState();
QLabel *label1 = new QLabel("Original state ");
QState *s2 = new QState();
QState *s3 = new QState();
s1->assignProperty(&button, "text", "Click me"); //Property is assign only when state-machine is started.
machine.addState(s1);
machine.addState(s2);
machine.addState(s3);
machine.setInitialState(s1);
// Definition de l'enchainement des états
s1->addTransition(&button, SIGNAL(clicked()), s2);
s2->addTransition(&button, SIGNAL(clicked()), s3);
s3->addTransition(&button, SIGNAL(clicked()), s1);
// Definition de l'action des états
s1->assignProperty(label1, "text", "Splash screen");
s2->assignProperty(label1, "text", "1 Menu");
s3->assignProperty(label1, "text", "3 Maintenance");
machine.start();
layout->addWidget(&button);
layout->addWidget(label1);
To copy to clipboard, switch view to plain text mode
------------------------------------------------------------
* I aim to use this code into whatever allows me to do what I want to, like any Qtcreator application wizard will generate :
I use the main (but not sure this is the best idea) :
SplashScreen *SScreen = new SplashScreen ();
SScreen ->show();
SplashScreen *SScreen = new SplashScreen ();
SScreen ->show();
To copy to clipboard, switch view to plain text mode
then in MainWindow I use :
void MainWindow::Splash_Timerout()
{
//this->show();
Frm_Warning_Sourceinvalide *Warning_window = new Frm_Warning_Sourceinvalide();
Warning_window->show();
}
void MainWindow::Splash_Timerout()
{
//this->show();
Frm_Warning_Sourceinvalide *Warning_window = new Frm_Warning_Sourceinvalide();
Warning_window->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks