From 6fc86589d9be950f95257752af95eef57bb53e30 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 29 Nov 2019 12:06:00 +0300 Subject: [PATCH] Issue #3098: Show warning windows. --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 11 +++++++++-- src/PartSet/PartSet_WidgetSketchLabel.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 9dbab08eb..0a14abf97 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -79,6 +79,7 @@ #include #include #include +#include #ifndef DBL_MAX #define DBL_MAX 1.7976931348623158e+308 @@ -578,6 +579,12 @@ void PartSet_WidgetSketchLabel::activateCustom() } void PartSet_WidgetSketchLabel::showEvent(QShowEvent* theEvent) +{ + ModuleBase_WidgetValidated::showEvent(theEvent); + QTimer::singleShot(10, this, SLOT(onShowPanel())); +} + +void PartSet_WidgetSketchLabel::onShowPanel() { if (mySizeOfViewWidget->isVisible()) { DocumentPtr aDoc = feature()->document(); @@ -586,12 +593,12 @@ void PartSet_WidgetSketchLabel::showEvent(QShowEvent* theEvent) myPartSetMessage->move(mapToGlobal(geometry().bottomLeft())); myPartSetMessage->show(); } - mySizeMessage->move(mySizeOfView->mapToGlobal(mySizeOfView->geometry().center())); + QPoint aPnt = mySizeOfView->mapToGlobal(mySizeOfView->geometry().center()); + mySizeMessage->move(aPnt); mySizeMessage->show(); } } - void PartSet_WidgetSketchLabel::deactivate() { ModuleBase_WidgetValidated::deactivate(); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 51ad42aba..ba5c2bb50 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -217,6 +217,8 @@ private slots: void onShowDOF(); + void onShowPanel(); + private: /// Set sketch plane by shape /// \param theShape a planar face -- 2.39.2