Define closeDialog() method in Control as slot to allow delayed destruction of task dialogs

This commit is contained in:
wmayer 2012-11-28 13:48:22 +01:00
parent dd67c22837
commit 56e352c421
2 changed files with 6 additions and 3 deletions

View File

@ -64,20 +64,22 @@ public:
/// This method start an Task dialog in the TaskView
void showDialog(Gui::TaskView::TaskDialog *dlg);
Gui::TaskView::TaskDialog* activeDialog() const;
void closeDialog();
//@}
/** @name task view handling
*/
//@{
Gui::TaskView::TaskView* taskPanel() const;
void showTaskView();
//@}
bool isAllowedAlterDocument(void) const;
bool isAllowedAlterView(void) const;
bool isAllowedAlterSelection(void) const;
public Q_SLOTS:
void closeDialog();
void showTaskView();
private Q_SLOTS:
/// This get called by the TaskView when the Dialog is finished
void closedDialog();

View File

@ -26,6 +26,7 @@
#ifndef _PreComp_
# include <QAction>
# include <QMenu>
# include <QTimer>
# include <Standard_math.hxx>
# include <Inventor/actions/SoSearchAction.h>
# include <Inventor/draggers/SoDragger.h>
@ -534,7 +535,7 @@ void ViewProviderThickness::unsetEdit(int ModNum)
{
if (ModNum == ViewProvider::Default) {
// when pressing ESC make sure to close the dialog
Gui::Control().closeDialog();
QTimer::singleShot(0, &Gui::Control(), SLOT(closeDialog()));
}
else {
PartGui::ViewProviderPart::unsetEdit(ModNum);