From 8fa96ff273ba862301048013e2b14c055461f7ca Mon Sep 17 00:00:00 2001 From: abd Date: Wed, 23 Aug 2006 14:49:04 +0000 Subject: [PATCH] Using of QGuardedPtrs for SVTK_ViewWindow. BUG 12118 and 13026 --- src/VISUGUI/VisuGUI_ClippingDlg.cxx | 13 ++++++++++--- src/VISUGUI/VisuGUI_ClippingDlg.h | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index 54a1264b..bff927ae 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -210,7 +210,7 @@ void OrientedPlane::Init() OrientedPlane::~OrientedPlane() { - if (myViewWindow) + if ( !myViewWindow.isNull() ) myViewWindow->RemoveActor(myActor); myActor->Delete(); @@ -577,9 +577,15 @@ void VisuGUI_ClippingDlg::ClickOnHelp() if (app) app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), QObject::tr("BUT_OK")); } } @@ -1126,6 +1132,7 @@ void VisuGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled) VISU::RenderViewWindow(vw); } + //================================================================================= // function : keyPressEvent() // purpose : @@ -1141,4 +1148,4 @@ void VisuGUI_ClippingDlg::keyPressEvent( QKeyEvent* e ) e->accept(); ClickOnHelp(); } -} +} \ No newline at end of file diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.h b/src/VISUGUI/VisuGUI_ClippingDlg.h index c076f34d..be9dcb20 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingDlg.h @@ -27,6 +27,7 @@ // QT Includes #include +#include #include // VTK Includes @@ -74,7 +75,7 @@ namespace VISU { //================================================================================= class OrientedPlane: public vtkPlane { - SVTK_ViewWindow* myViewWindow; + QGuardedPtr myViewWindow; vtkDataSetMapper* myMapper; public: -- 2.39.2