Qt-interest Archive, July 2007
close on exec()
Message 1 in thread
Hello All,
I'm new to qt. I have problem closing dialog during exec() or show(). Basically what I want to do is :
- check user permision (based on objectName()) to launch the form / dialog
- if user doesn't have proper permision, close the dialog / form
Here is my code.
Here is mydialog.h :
class MyForm : public QDialog, private Ui::MyGeneratedForm
{
Q_OBJECT
public:
MyForm();
public slots:
virtual int exec();
}
here is mydialog.cpp :
#include "mydialog.h"
MyForm::exec()
{
if (!qApp->GetPermission(objectName())) done(QDialog::Rejected);
return 1;
}
It compiles fine (no compilation error), but I didn't get the expected behaviour (my main window become not responding after launcing the dialog). Is it really posible to close dialog during exec() in qt ?. Am I missing something here ?.
thanks in advance for your help,
regards,
si_sol
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
--
[ signature omitted ]