From 7625da7a2132cf525e90454b2edce1a4ac0cfc57 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Fri, 27 Sep 2019 15:29:14 +0200 Subject: [PATCH] #4790 Make sure window maximation state is restored after project load + tiling fixes --- .../RicSummaryPlotFeatureImpl.cpp | 10 +- .../UserInterface/RiuMainWindow.cpp | 186 +++++++++--------- ApplicationCode/UserInterface/RiuMainWindow.h | 4 +- .../UserInterface/RiuMainWindowBase.cpp | 27 ++- .../UserInterface/RiuMainWindowBase.h | 10 +- ApplicationCode/UserInterface/RiuMdiArea.cpp | 4 +- .../UserInterface/RiuPlotMainWindow.cpp | 55 ++++-- .../UserInterface/RiuPlotMainWindow.h | 1 + .../UserInterface/RiuWellLogPlot.cpp | 8 + .../UserInterface/RiuWellLogPlot.h | 1 + 10 files changed, 177 insertions(+), 129 deletions(-) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp index 0e9382cc6f..a3857194cb 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp @@ -418,7 +418,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin if ( summaryAddressFilters.size() ) { - RimSummaryCaseCollection* ensemble = nullptr; + RimSummaryCaseCollection* ensemble = nullptr; if ( isEnsembleMode ) { @@ -680,11 +680,11 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin RiuPlotMainWindow* mpw = RiaGuiApplication::instance()->mainPlotWindow(); // Needed to avoid unneccessary activation of sub windows (plots) - // which results in population of property editor, and missing deleteLater because we are outside any event loop - // when switching object. Results in stray widgets. - mpw->setBlockSlotSubWindowActivated( true ); + // which results in population of property editor, and missing deleteLater because we are outside any event + // loop when switching object. Results in stray widgets. + mpw->setBlockSubWindowProjectTreeSelection( true ); RiuPlotMainWindowTools::showPlotMainWindow(); - mpw->setBlockSlotSubWindowActivated( false ); + mpw->setBlockSubWindowProjectTreeSelection( false ); RiuPlotMainWindowTools::setExpanded( lastPlotCreated ); RiuPlotMainWindowTools::selectAsCurrentItem( lastPlotCreated ); diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index 579f1d59ca..3ac9091a69 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -97,6 +97,8 @@ #include #include +#include + #include //================================================================================================== @@ -1029,14 +1031,17 @@ QMdiSubWindow* RiuMainWindow::findMdiSubWindow( QWidget* viewer ) //-------------------------------------------------------------------------------------------------- RimViewWindow* RiuMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWindow ) { - std::vector allViewWindows; - RiaApplication::instance()->project()->descendantsIncludingThisOfType( allViewWindows ); - - for ( RimViewWindow* viewWindow : allViewWindows ) + if ( subWindow ) { - if ( viewWindow->viewWidget() == subWindow->widget() ) + std::vector allViewWindows; + RiaApplication::instance()->project()->descendantsIncludingThisOfType( allViewWindows ); + + for ( RimViewWindow* viewWindow : allViewWindows ) { - return viewWindow; + if ( viewWindow->viewWidget() == subWindow->widget() ) + { + return viewWindow; + } } } return nullptr; @@ -1225,109 +1230,90 @@ void RiuMainWindow::slotViewFromBelow() //-------------------------------------------------------------------------------------------------- void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow ) { - if ( !subWindow ) return; - if ( blockSlotSubWindowActivated() ) return; + if ( blockSubWindowActivation() ) return; - RimProject* proj = RiaApplication::instance()->project(); - if ( !proj ) return; + Rim3dView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView(); + Rim3dView* activatedView = dynamic_cast( findViewWindowFromSubWindow( subWindow ) ); - // Find the activated 3D view + if ( !activatedView ) return; + RiaApplication::instance()->setActiveReservoirView( activatedView ); - Rim3dView* activatedView = nullptr; - - std::vector allCases; - proj->allCases( allCases ); - - for ( RimCase* reservoirCase : allCases ) + if ( !blockSubWindowProjectTreeSelection() ) { - if ( reservoirCase == nullptr ) continue; + selectViewInProjectTree( previousActiveReservoirView, activatedView ); + } - std::vector views = reservoirCase->views(); + slotRefreshViewActions(); + refreshAnimationActions(); + refreshDrawStyleActions(); +} - size_t viewIdx; - for ( viewIdx = 0; viewIdx < views.size(); viewIdx++ ) +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindow::selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView ) +{ + bool is3dViewCurrentlySelected = false; + if ( caf::SelectionManager::instance()->selectedItem() ) + { + if ( caf::SelectionManager::instance()->selectedItemAncestorOfType() ) { - Rim3dView* riv = views[viewIdx]; - - if ( riv && riv->viewer() && riv->viewer()->layoutWidget() && - riv->viewer()->layoutWidget()->parent() == subWindow ) - { - activatedView = riv; - break; - } + is3dViewCurrentlySelected = true; } } + if ( is3dViewCurrentlySelected && ( previousActiveReservoirView != activatedView ) ) { - Rim3dView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView(); - RiaApplication::instance()->setActiveReservoirView( activatedView ); + QModelIndex newViewModelIndex = m_projectTreeView->findModelIndex( activatedView ); + QModelIndex newSelectionIndex = newViewModelIndex; - bool is3dViewCurrentlySelected = false; - if ( caf::SelectionManager::instance()->selectedItem() ) + if ( previousActiveReservoirView && is3dViewCurrentlySelected ) { - if ( caf::SelectionManager::instance()->selectedItemAncestorOfType() ) + // Try to select the same entry in the new View, as was selected in the previous + + QModelIndex previousViewModelIndex = m_projectTreeView->findModelIndex( previousActiveReservoirView ); + QModelIndex currentSelectionIndex = m_projectTreeView->treeView()->selectionModel()->currentIndex(); + + if ( currentSelectionIndex != newViewModelIndex && currentSelectionIndex.isValid() ) { - is3dViewCurrentlySelected = true; - } - } + QVector route; // Contains all model indices from current selection up to previous view - if ( is3dViewCurrentlySelected && ( previousActiveReservoirView != activatedView ) ) - { - QModelIndex newViewModelIndex = m_projectTreeView->findModelIndex( activatedView ); - QModelIndex newSelectionIndex = newViewModelIndex; + QModelIndex tmpModelIndex = currentSelectionIndex; - if ( previousActiveReservoirView && is3dViewCurrentlySelected ) - { - // Try to select the same entry in the new View, as was selected in the previous - - QModelIndex previousViewModelIndex = m_projectTreeView->findModelIndex( previousActiveReservoirView ); - QModelIndex currentSelectionIndex = m_projectTreeView->treeView()->selectionModel()->currentIndex(); - - if ( currentSelectionIndex != newViewModelIndex && currentSelectionIndex.isValid() ) + while ( tmpModelIndex.isValid() && tmpModelIndex != previousViewModelIndex ) { - QVector route; // Contains all model indices from current selection up to previous view + // NB! Add model index to front of vector to be able to do a for-loop with correct ordering + route.push_front( tmpModelIndex ); - QModelIndex tmpModelIndex = currentSelectionIndex; + tmpModelIndex = tmpModelIndex.parent(); + } - while ( tmpModelIndex.isValid() && tmpModelIndex != previousViewModelIndex ) + // Traverse model indices from new view index to currently selected item + int i; + for ( i = 0; i < route.size(); i++ ) + { + QModelIndex tmp = route[i]; + if ( newSelectionIndex.isValid() ) { - // NB! Add model index to front of vector to be able to do a for-loop with correct ordering - route.push_front( tmpModelIndex ); - - tmpModelIndex = tmpModelIndex.parent(); - } - - // Traverse model indices from new view index to currently selected item - int i; - for ( i = 0; i < route.size(); i++ ) - { - QModelIndex tmp = route[i]; - if ( newSelectionIndex.isValid() ) - { - newSelectionIndex = m_projectTreeView->treeView()->model()->index( tmp.row(), - tmp.column(), - newSelectionIndex ); - } - } - - // Use view model index if anything goes wrong - if ( !newSelectionIndex.isValid() ) - { - newSelectionIndex = newViewModelIndex; + newSelectionIndex = m_projectTreeView->treeView()->model()->index( tmp.row(), + tmp.column(), + newSelectionIndex ); } } - } - m_projectTreeView->treeView()->setCurrentIndex( newSelectionIndex ); - if ( newSelectionIndex != newViewModelIndex ) - { - m_projectTreeView->treeView()->setExpanded( newViewModelIndex, true ); + // Use view model index if anything goes wrong + if ( !newSelectionIndex.isValid() ) + { + newSelectionIndex = newViewModelIndex; + } } } - slotRefreshViewActions(); - refreshAnimationActions(); - refreshDrawStyleActions(); + m_projectTreeView->treeView()->setCurrentIndex( newSelectionIndex ); + if ( newSelectionIndex != newViewModelIndex ) + { + m_projectTreeView->treeView()->setExpanded( newViewModelIndex, true ); + } } } @@ -1456,9 +1442,9 @@ void RiuMainWindow::selectedObjectsChanged() // Set focus in MDI area to this window if it exists if ( selectedReservoirView->viewer() ) { - setBlockSlotSubWindowActivated(true); - setActiveViewer(selectedReservoirView->viewer()->layoutWidget()); - setBlockSlotSubWindowActivated(false); + setBlockSubWindowProjectTreeSelection( true ); + setActiveViewer( selectedReservoirView->viewer()->layoutWidget() ); + setBlockSubWindowProjectTreeSelection( false ); isActiveViewChanged = true; } @@ -1975,7 +1961,7 @@ void RiuMainWindow::tileSubWindows() } // Perform stable sort of list so we first sort by window position but retain activation order - // for windows with the same position. Needs to be sorted in decreasing order for the workaround below. + // for windows with the same position. windowList.sort( [this, viewLinker]( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) { RimViewWindow* lhsViewWindow = findViewWindowFromSubWindow( lhs ); RimViewWindow* rhsViewWindow = findViewWindowFromSubWindow( rhs ); @@ -1993,28 +1979,36 @@ void RiuMainWindow::tileSubWindows() return false; } } - return lhs->frameGeometry().topLeft().rx() > rhs->frameGeometry().topLeft().rx(); + if ( lhs->frameGeometry().topLeft().ry() == rhs->frameGeometry().topLeft().ry() ) + { + return lhs->frameGeometry().topLeft().rx() < rhs->frameGeometry().topLeft().rx(); + } + return lhs->frameGeometry().topLeft().ry() < rhs->frameGeometry().topLeft().ry(); } ); // Based on workaround described here // https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode - bool prevActivationBlock = blockSlotSubWindowActivated(); - // Force activation order so they end up in the order of the loop. - m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder ); + bool prevActivationBlock = blockSubWindowActivation(); + QMdiSubWindow* a = m_mdiArea->activeSubWindow(); - setBlockSlotSubWindowActivated( true ); - for ( QMdiSubWindow* subWindow : windowList ) + // Force activation order so they end up in the order of the loop. + m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder ); + + setBlockSubWindowActivation( true ); + + // Activate in reverse order + for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it ) { - m_mdiArea->setActiveSubWindow( subWindow ); + m_mdiArea->setActiveSubWindow( *it ); } m_mdiArea->tileSubWindows(); // Set back the original activation order to avoid messing with the standard ordering m_mdiArea->setActivationOrder( currentActivationOrder ); m_mdiArea->setActiveSubWindow( a ); - setBlockSlotSubWindowActivated( prevActivationBlock ); + setBlockSubWindowActivation( prevActivationBlock ); storeSubWindowTiling( true ); } @@ -2033,6 +2027,7 @@ void RiuMainWindow::storeSubWindowTiling( bool tiled ) //-------------------------------------------------------------------------------------------------- void RiuMainWindow::clearWindowTiling() { + setBlockSubWindowActivation( true ); QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder(); for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) ) @@ -2041,6 +2036,7 @@ void RiuMainWindow::clearWindowTiling() subWindow->showNormal(); } storeSubWindowTiling( false ); + setBlockSubWindowActivation( false ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuMainWindow.h b/ApplicationCode/UserInterface/RiuMainWindow.h index 4b50786c4b..4e845efcc2 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.h +++ b/ApplicationCode/UserInterface/RiuMainWindow.h @@ -40,6 +40,7 @@ class QSpinBox; class QTimer; class QUndoView; +class Rim3dView; class RimCase; class RimViewWindow; @@ -230,9 +231,10 @@ private slots: // Windows slots void slotBuildWindowActions(); - void slotSubWindowActivated( QMdiSubWindow* subWindow ); + void selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView ); + void selectedObjectsChanged(); void customMenuRequested( const QPoint& pos ); diff --git a/ApplicationCode/UserInterface/RiuMainWindowBase.cpp b/ApplicationCode/UserInterface/RiuMainWindowBase.cpp index a13423c98e..6436f40a26 100644 --- a/ApplicationCode/UserInterface/RiuMainWindowBase.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindowBase.cpp @@ -42,7 +42,8 @@ RiuMainWindowBase::RiuMainWindowBase() : m_projectTreeView( nullptr ) , m_allowActiveViewChangeFromSelection( true ) , m_showFirstVisibleWindowMaximized( true ) - , m_blockSlotSubWindowActivated( false ) + , m_blockSubWindowActivation( false ) + , m_blockSubWindowProjectTreeSelection( false ) { setDockNestingEnabled( true ); } @@ -216,17 +217,33 @@ void RiuMainWindowBase::enableShowFirstVisibleMdiWindowMaximized( bool enable ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuMainWindowBase::setBlockSlotSubWindowActivated( bool block ) +void RiuMainWindowBase::setBlockSubWindowActivation( bool block ) { - m_blockSlotSubWindowActivated = block; + m_blockSubWindowActivation = block; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RiuMainWindowBase::blockSlotSubWindowActivated() const +bool RiuMainWindowBase::blockSubWindowActivation() const { - return m_blockSlotSubWindowActivated; + return m_blockSubWindowActivation; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindowBase::setBlockSubWindowProjectTreeSelection( bool block ) +{ + m_blockSubWindowProjectTreeSelection = block; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiuMainWindowBase::blockSubWindowProjectTreeSelection() const +{ + return m_blockSubWindowProjectTreeSelection; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuMainWindowBase.h b/ApplicationCode/UserInterface/RiuMainWindowBase.h index 8858dde9b9..895bf24d73 100644 --- a/ApplicationCode/UserInterface/RiuMainWindowBase.h +++ b/ApplicationCode/UserInterface/RiuMainWindowBase.h @@ -75,8 +75,11 @@ public: virtual void clearWindowTiling() = 0; virtual bool subWindowsAreTiled() const = 0; - void setBlockSlotSubWindowActivated( bool block ); - bool blockSlotSubWindowActivated() const; + void setBlockSubWindowActivation( bool block ); + bool blockSubWindowActivation() const; + + void setBlockSubWindowProjectTreeSelection( bool block ); + bool blockSubWindowProjectTreeSelection() const; protected: void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer ); @@ -94,5 +97,6 @@ private: private: bool m_showFirstVisibleWindowMaximized; - bool m_blockSlotSubWindowActivated; + bool m_blockSubWindowActivation; + bool m_blockSubWindowProjectTreeSelection; }; diff --git a/ApplicationCode/UserInterface/RiuMdiArea.cpp b/ApplicationCode/UserInterface/RiuMdiArea.cpp index 8c181b391a..ffc1cbd972 100644 --- a/ApplicationCode/UserInterface/RiuMdiArea.cpp +++ b/ApplicationCode/UserInterface/RiuMdiArea.cpp @@ -58,7 +58,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent ) } RiuMainWindowBase* mainWindow = dynamic_cast( window() ); - mainWindow->setBlockSlotSubWindowActivated( true ); + mainWindow->setBlockSubWindowActivation( true ); // Workaround for Qt bug #51761: https://bugreports.qt.io/browse/QTBUG-51761 // Set the first window to be the active window then perform resize event and set back. @@ -70,7 +70,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent ) setActiveSubWindow( a ); - mainWindow->setBlockSlotSubWindowActivated( false ); + mainWindow->setBlockSubWindowActivation( false ); for ( auto subWindow : subWindowList() ) { diff --git a/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp b/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp index d4465cea83..10fca9d492 100644 --- a/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp @@ -445,7 +445,6 @@ void RiuPlotMainWindow::createDockPanels() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- - QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer ) { QList subws = m_mdiArea->subWindowList(); @@ -461,6 +460,19 @@ QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer ) return nullptr; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimViewWindow* RiuPlotMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWindow ) +{ + RimProject* proj = RiaApplication::instance()->project(); + if ( subWindow && proj ) + { + return RiuInterfaceToViewWindow::viewWindowFromWidget( subWindow->widget() ); + } + return nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -642,20 +654,16 @@ void RiuPlotMainWindow::setPdmRoot( caf::PdmObject* pdmRoot ) //-------------------------------------------------------------------------------------------------- void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow ) { - if ( !subWindow ) return; - if ( blockSlotSubWindowActivated() ) return; + if ( blockSubWindowActivation() ) return; - RimProject* proj = RiaApplication::instance()->project(); - if ( !proj ) return; + RimViewWindow* activatedView = findViewWindowFromSubWindow( subWindow ); - // Select in Project Tree + if ( !activatedView ) return; + m_activePlotViewWindow = activatedView; - RimViewWindow* viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget( subWindow->widget() ); - - if ( viewWindow && viewWindow != m_activePlotViewWindow ) + if ( !blockSubWindowProjectTreeSelection() ) { - selectAsCurrentItem( viewWindow ); - m_activePlotViewWindow = viewWindow; + selectAsCurrentItem( activatedView ); } updateWellLogPlotToolBar(); @@ -761,9 +769,9 @@ void RiuPlotMainWindow::selectedObjectsChanged() { if ( selectedWindow->viewWidget() ) { - setBlockSlotSubWindowActivated( true ); + setBlockSubWindowProjectTreeSelection( true ); setActiveViewer( selectedWindow->viewWidget() ); - setBlockSlotSubWindowActivated( false ); + setBlockSubWindowProjectTreeSelection( false ); } // The only way to get to this code is by selection change initiated from the project tree view // As we are activating an MDI-window, the focus is given to this MDI-window @@ -840,26 +848,35 @@ void RiuPlotMainWindow::tileSubWindows() } // Perform stable sort of list so we first sort by window position but retain activation order - // for windows with the same position. Needs to be sorted in decreasing order for workaround below. + // for windows with the same position. windowList.sort( []( const QMdiSubWindow* lhs, const QMdiSubWindow* rhs ) { - return lhs->frameGeometry().topLeft().rx() > rhs->frameGeometry().topLeft().rx(); + if ( lhs->frameGeometry().topLeft().ry() == rhs->frameGeometry().topLeft().ry() ) + { + return lhs->frameGeometry().topLeft().rx() < rhs->frameGeometry().topLeft().rx(); + } + return lhs->frameGeometry().topLeft().ry() < rhs->frameGeometry().topLeft().ry(); } ); // Based on workaround described here // https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode - QMdiSubWindow* a = m_mdiArea->activeSubWindow(); + bool prevActivationBlock = blockSubWindowActivation(); // Force activation order so they end up in the order of the loop. m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder ); - for ( QMdiSubWindow* subWindow : windowList ) + QMdiSubWindow* a = m_mdiArea->activeSubWindow(); + + setBlockSubWindowActivation( true ); + // Activate in reverse order + for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it ) { - m_mdiArea->setActiveSubWindow( subWindow ); + m_mdiArea->setActiveSubWindow( *it ); } m_mdiArea->tileSubWindows(); // Set back the original activation order to avoid messing with the standard ordering m_mdiArea->setActivationOrder( currentActivationOrder ); m_mdiArea->setActiveSubWindow( a ); + setBlockSubWindowActivation( prevActivationBlock ); storeSubWindowTiling( true ); } @@ -878,6 +895,7 @@ void RiuPlotMainWindow::storeSubWindowTiling( bool tiled ) //-------------------------------------------------------------------------------------------------- void RiuPlotMainWindow::clearWindowTiling() { + setBlockSubWindowActivation( true ); QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder(); for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) ) @@ -886,6 +904,7 @@ void RiuPlotMainWindow::clearWindowTiling() subWindow->showNormal(); } storeSubWindowTiling( false ); + setBlockSubWindowActivation( false ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuPlotMainWindow.h b/ApplicationCode/UserInterface/RiuPlotMainWindow.h index 39f140d58a..8ba6e0ccb2 100644 --- a/ApplicationCode/UserInterface/RiuPlotMainWindow.h +++ b/ApplicationCode/UserInterface/RiuPlotMainWindow.h @@ -73,6 +73,7 @@ public: bool isAnyMdiSubWindowVisible(); QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override; + RimViewWindow* findViewWindowFromSubWindow( QMdiSubWindow* subWindow ); QList subWindowList( QMdiArea::WindowOrder order ); void setWidthOfMdiWindow( QWidget* mdiWindowWidget, int newWidth ); diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp index 34e6f6353d..48efc5dea0 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp @@ -315,6 +315,14 @@ void RiuWellLogPlot::keyPressEvent( QKeyEvent* keyEvent ) m_plotDefinition->handleKeyPressEvent( keyEvent ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuWellLogPlot::resizeEvent( QResizeEvent* event ) +{ + QWidget::resizeEvent( event ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.h b/ApplicationCode/UserInterface/RiuWellLogPlot.h index 8467fe04a7..38bcd88f16 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.h +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.h @@ -75,6 +75,7 @@ protected: void changeEvent( QEvent* event ) override; void contextMenuEvent( QContextMenuEvent* ) override; void keyPressEvent( QKeyEvent* keyEvent ) override; + void resizeEvent( QResizeEvent* event ) override; QSize sizeHint() const override;