[Qt-interest] New Bee Question: Quiting under followingsituation
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Tue Jun 9 21:04:27 CEST 2009
Since you are asking for our volunteer time, in order for me to help
you, what you have provided is not enough. Im really trying to help
here..
Let me give you and example, that based on YOUR code, works fine.
Main.h
#ifndef __MAIN_H
#define __MAIN_H
#include <QLabel>
class TestWidget : public QLabel
{
Q_OBJECT;
public:
TestWidget();
public slots:
void slotShowMsgBox();
};
#endif
Main.cpp
#include <QApplication>
#include "main.h"
#include <QMessageBox>
#include <QTimer>
TestWidget::TestWidget() :
QLabel( "Just a test Label", NULL )
{
QTimer::singleShot( 500, this, SLOT( slotShowMsgBox() ) );
}
void TestWidget::slotShowMsgBox()
{
QMessageBox::StandardButton reply;
reply = QMessageBox::information( this, "title", "msg" );
if ( reply == QMessageBox::Ok )
qApp->quit();
}
int main( int argc, char ** argv )
{
QApplication appl( argc, argv );
TestWidget widget;
widget.show();
return appl.exec();
}
Now, your code is obviously different.. How?
Scott
From: Rahulkumar Tibdewal [mailto:rahulkumar_tibdewal at persistent.co.in]
Sent: Tuesday, June 09, 2009 10:22 AM
To: Scott Aron Bloom; qt-interest
Subject: RE: [Qt-interest] New Bee Question: Quiting under
followingsituation
I feel this should be sufficient.
Try to have small program for the same and let it be open for some time
(5-6 min)after Message Box is launched.
QMessageBox::StandardButton reply;
reply = QMessageBox::information(this, tr("xyz"),tr("xyz"));
if(reply == QMessageBox::Ok)
{
QCoreApplication::quit(); //After some 5 - 6
min delay... application goes in unresponsive state.
}
Thanks
Rahul
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Scott Aron Bloom
Sent: Tuesday, June 09, 2009 9:58 PM
To: qt-interest
Subject: Re: [Qt-interest] New Bee Question: Quiting under
followingsituation
Provide a complete example that reproduces the problem.
Scott
From: Rahulkumar Tibdewal [mailto:rahulkumar_tibdewal at persistent.co.in]
Sent: Tuesday, June 09, 2009 9:08 AM
To: Scott Aron Bloom; qt-interest
Subject: RE: [Qt-interest] New Bee Question: Quiting under
followingsituation
Yes I have gone through documentation.
QMessageBox::StandardButton reply;
reply = QMessageBox::information(this, tr("xyz"),tr("xyz"));
if(reply == QMessageBox::Ok)
{
QCoreApplication::quit(); //After some 5 - 6
min delay... application goes in unresponsive state.
}
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Scott Aron Bloom
Sent: Tuesday, June 09, 2009 8:56 PM
To: qt-interest
Subject: Re: [Qt-interest] New Bee Question: Quiting under following
situation
Did you read the documentation?
What else did you try?
Did you look at the other parameters for the method "information" ?
Scott
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Rahulkumar
Tibdewal
Sent: Tuesday, June 09, 2009 8:18 AM
To: qt-interest
Subject: [Qt-interest] New Bee Question: Quiting under following
situation
Hi All,
I want to quit a application from the following code.
QMessageBox::StandardButton reply;
reply = QMessageBox::information(this, tr("xyz"),tr("xyz"));
if(reply == QMessageBox::Ok)
{
//Some to be done here to close the application.
}
In the code above, I am having a problem in getting reference of
OKButton.
So I was not able to quit application by using connect (okButton,
SIGNAL(clicked), qApp, SLOT(quit()));
Please help me in getting rid of this situation.
Thanks
Rahul
DISCLAIMER ========== This e-mail may contain privileged and
confidential information which is the property of Persistent Systems
Ltd. It is intended only for the use of the individual or entity to
which it is addressed. If you are not the intended recipient, you are
not authorized to read, retain, copy, print, distribute or use this
message. If you have received this communication in error, please notify
the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.
DISCLAIMER ========== This e-mail may contain privileged and
confidential information which is the property of Persistent Systems
Ltd. It is intended only for the use of the individual or entity to
which it is addressed. If you are not the intended recipient, you are
not authorized to read, retain, copy, print, distribute or use this
message. If you have received this communication in error, please notify
the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.
DISCLAIMER ========== This e-mail may contain privileged and
confidential information which is the property of Persistent Systems
Ltd. It is intended only for the use of the individual or entity to
which it is addressed. If you are not the intended recipient, you are
not authorized to read, retain, copy, print, distribute or use this
message. If you have received this communication in error, please notify
the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090609/a0fab8a3/attachment.html
More information about the Qt-interest-old
mailing list