I've the following problem, i want to block the user to close dialog using the 'X' icon or escape key, i know that using something like this will work
void MyMainDialog::done( int res )
{
if( allowClose )
}
{
if( allowClose )
e->accept();
else
e->ignore();
}
void MyMainDialog::done( int res )
{
if( allowClose )
QDialog::done(res);
}
void MyMainDialog::closeEvent( QCloseEvent* e )
{
if( allowClose )
e->accept();
else
e->ignore();
}
To copy to clipboard, switch view to plain text mode
Above code works fine and blocks the main dialog,
but now i created this dialog called from maindialog and i want also to block it
void MyMainDialog::text_dialog()
{
..........
..........
text_dlg->exec();
}
void MyMainDialog::text_dialog()
{
text_dlg = new QDialog( this );
dlg_layout = new QVBoxLayout( text_dlg );
..........
..........
text_dlg->exec();
}
To copy to clipboard, switch view to plain text mode
Something like connect( on_close_text_dlg, SIGNAL(clicked()), this, SLOT( block_it() ));
will be the proper way to do this? i tried, but couldn't find what will be the way to receive the event type for a on_close_text_dlg
How i block the text_dlg?
Bookmarks