From ea20d256386c2c83a9d7c20c06b978a7d009b9b1 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 13 Nov 2014 09:05:50 +0100 Subject: [PATCH] Restoring Animation Widget hack to have the "plus" icon properly displayed. Bug should be fowarded upstream to KitWare. --- src/PVGUI/PVGUI_Module_widgets.cxx | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/PVGUI/PVGUI_Module_widgets.cxx b/src/PVGUI/PVGUI_Module_widgets.cxx index cead1a0b..7ddee81b 100644 --- a/src/PVGUI/PVGUI_Module_widgets.cxx +++ b/src/PVGUI/PVGUI_Module_widgets.cxx @@ -69,6 +69,34 @@ #include +class ResizeHelper : public pqPVAnimationWidget +{ + // TEMPORARILY WORKAROUND AROUND PARAVIEW 3.14 BUG: + // WHEN ANIMATION VIEW IS RESIZED, ITS CONTENTS IS NOT PREPERLY RE-ARRANGED + // CAUSING SOME CONTROLS TO STAY NON-VISIBLE + // THIS BUG IS NATURALLY FIXED BY ADDING + // this->updateGeometries(); + // TO THE + // void pqAnimationWidget::resizeEvent(QResizeEvent* e); + // BUT THIS CANNOT BE DONE DIRECTLY, SINCE CORRESPONDING API IS NOT PUBLIC + // THE ONLY WAY TO DO THIS BY SENDING SHOW EVENT TO THE WIDGET + +public: + ResizeHelper( QWidget* parent ) : pqPVAnimationWidget( parent ) {} +protected: + void resizeEvent(QResizeEvent* e) + { + pqAnimationWidget* w = findChild( "pqAnimationWidget" ); + if ( w ) { + QShowEvent e; + QApplication::sendEvent( w, &e ); + } + pqPVAnimationWidget::resizeEvent( e ); + } +}; + + + /*! \brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc. ParaView pqMainWindowCore class is fully responsible for these dock widgets' contents. @@ -213,7 +241,7 @@ void PVGUI_Module::setupDockWidgets() QDockWidget* animationViewDock = new QDockWidget( tr( "TTL_ANIMATION_VIEW" ), desk ); animationViewDock->setObjectName("animationViewDock"); desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock ); - pqPVAnimationWidget* animation_panel = new pqPVAnimationWidget(animationViewDock); // [ABN] was resizeHelper + pqPVAnimationWidget* animation_panel = new ResizeHelper(animationViewDock); // [ABN] was resizeHelper animationViewDock->setWidget(animation_panel); myDockWidgets[animationViewDock] = false; // hidden by default -- 2.39.2