Hello Anyone,
I have Qt 4-7
I have a MainWindow and a Dialog for login.
In the Dialog i have 2 pushbuttons.
One pushbutton called Start is for Ok Signal to get to the MainWindow.
One pushbutton called Cancel is for Reject Signal to close the Dialog and for quit the MainWindow.
The point is i want with the Cancel pushbutton from Dialog to quit the MainWindow.
The Dialog login starts direct.
mainwindow.cc
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
productDialog *dlg = new productDialog(this);
dlg->exec(); //This starts the Dialog login
etc .....
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
productDialog *dlg = new productDialog(this);
dlg->exec(); //This starts the Dialog login
etc .....
To copy to clipboard, switch view to plain text mode
I have implement a Timer but if i click on the Cancel pushbutton in Dialog login i see still for halve second the MainWindow and this i don't want to see.
main.cc
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
QTimer::singleShot(0,
qApp,
SLOT(quit
()));
//I have used a Timer return a.exec();
}
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
QTimer::singleShot(0,qApp, SLOT(quit())); //I have used a Timer
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Thanks in advance.
Bookmarks