how to open several ui from a main menu
-
I was doing a graphical interface with a side menu that agreed to press one or the other or different.
The program opens my windows perfectly. And every window the first time I enter works correctly, however, the second time I enter, nothing works.
I suspect it is because an object is created ui every time I enter the window.
The each button where I want the window to open I use this code.close(); siguiente *prueba=new siguiente(); prueba->showFullScreen();
There is a possible solution for this.
Greetings and thanks forward -
Hi
Something likeput in .h file inside the class definition siguiente *prueba=NULL; then in void ShowTheWindow() { if (prueba == NULL ) // only create ONCE prueba=new siguiente(); prueba->showFullScreen(); } then also have a function to hide it void HideTheWindow() { if (prueba == NULL ) return; // not created prueba->hide(); or showNormal or what you need }
-
Hi
Something likeput in .h file inside the class definition siguiente *prueba=NULL; then in void ShowTheWindow() { if (prueba == NULL ) // only create ONCE prueba=new siguiente(); prueba->showFullScreen(); } then also have a function to hide it void HideTheWindow() { if (prueba == NULL ) return; // not created prueba->hide(); or showNormal or what you need }
Hi,
Just a small addition to what @mrjj wrote:@mrjj said in how to open several ui from a main menu:
put in .h file
siguiente *prueba=NULL;That should be a member variable of your class.
-
Hi
Something likeput in .h file inside the class definition siguiente *prueba=NULL; then in void ShowTheWindow() { if (prueba == NULL ) // only create ONCE prueba=new siguiente(); prueba->showFullScreen(); } then also have a function to hide it void HideTheWindow() { if (prueba == NULL ) return; // not created prueba->hide(); or showNormal or what you need }
-
put in .h file inside the class definition
siguiente *prueba=NULL;in mainWindows.h
error de compilation
-
@Paulo-G said in how to open several ui from a main menu:
mainwindow.h:30: error: 'siguiente' does not name a type
include the header file where siguiente is declared. Or if it is already the case is this siguiente in a namespace?
MaybeUi::siguiente vRoll = NULL;
?
-
Hi
siguiente seems to be a dialog so not very likely its inside
UI::
You did have
#include "siguiente.h" in top of the mainwindow.h ? -
Hi
siguiente seems to be a dialog so not very likely its inside
UI::
You did have
#include "siguiente.h" in top of the mainwindow.h ?