I am currently making a University assignment using Qt.
What I am trying to achieve is for the application to start with an AuthenticationDialog and then hide the dialog and shop MainWindow but still have the option to go back from MainWindow to AuthenticationDialog.
I have tried launching the MainWindow from a function in the AuthenticationDialog.cpp file however as the function returns immediately after showing the main window the main window disappears.
I have tried defining the main window and authentication dialogs as globals in the main.h (main header) file like so:
#ifndef MAINWINDOW_H
#include "mainwindow.h"
#endif
MainWindow *mainWindow;
#ifndef AUTHENTICATIONDIALOG_H
#include "authenticationdialog.h"
#endif
AuthenticationDialog *authenticationDialog;
However when I call it in the main function like this:
mainWindow = new MainWindow();
authenticationDialog = new AuthenticationDialog();
authenticationDialog->show();
I get a 'AuthenticationDialog' does not name a type error.
I would really appreciate if someone could help me out with this as time is of the essence here.
Aucun commentaire:
Enregistrer un commentaire