dragon
21st February 2012, 19:23
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) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
productDialog *dlg = new productDialog(this);
dlg->exec(); //This starts the Dialog login
etc .....
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[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
QTimer::singleShot(0,qApp, SLOT(quit())); //I have used a Timer
return a.exec();
}
Thanks in advance.
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) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
productDialog *dlg = new productDialog(this);
dlg->exec(); //This starts the Dialog login
etc .....
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[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
QTimer::singleShot(0,qApp, SLOT(quit())); //I have used a Timer
return a.exec();
}
Thanks in advance.