diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp index 2e2da505f0..d50953d050 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp @@ -67,11 +67,11 @@ RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent m_plotLayout = new QHBoxLayout; m_layout->addLayout( m_plotLayout ); - m_plotFrame = new QFrame; - m_plotFrame->setVisible( true ); - m_plotLayout->addWidget( m_plotFrame, 1 ); + m_trackFrame = new QFrame; + m_trackFrame->setVisible( true ); + m_plotLayout->addWidget( m_trackFrame, 1 ); - m_trackLayout = new QGridLayout( m_plotFrame ); + m_trackLayout = new QGridLayout( m_trackFrame ); m_trackLayout->setMargin( 0 ); m_trackLayout->setSpacing( 2 ); @@ -217,7 +217,6 @@ int RiuWellLogPlot::preferredWidth() const void RiuWellLogPlot::setTitleVisible( bool visible ) { m_plotTitle->setVisible( visible ); - this->updateChildrenLayout(); } //-------------------------------------------------------------------------------------------------- @@ -229,25 +228,6 @@ void RiuWellLogPlot::updateChildrenLayout() alignCanvasTops(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuWellLogPlot::showEvent( QShowEvent* ) -{ - updateChildrenLayout(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuWellLogPlot::changeEvent( QEvent* event ) -{ - if ( event->type() == QEvent::WindowStateChange ) - { - updateChildrenLayout(); - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -277,22 +257,6 @@ void RiuWellLogPlot::keyPressEvent( QKeyEvent* keyEvent ) m_plotDefinition->handleKeyPressEvent( keyEvent ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuWellLogPlot::resizeEvent( QResizeEvent* event ) -{ - QWidget::resizeEvent( event ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QSize RiuWellLogPlot::sizeHint() const -{ - return QSize( 1, 1 ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -414,7 +378,9 @@ void RiuWellLogPlot::clearTrackLayout() { } QWidget().setLayout( m_trackLayout ); - m_trackLayout = new QGridLayout( m_plotFrame ); + QPointer newGridLayout = new QGridLayout( m_trackFrame ); + m_trackLayout.swap( newGridLayout ); + newGridLayout->deleteLater(); } } diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.h b/ApplicationCode/UserInterface/RiuWellLogPlot.h index 7026f77c78..f704ca8ebb 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.h +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.h @@ -71,13 +71,8 @@ public slots: void updateChildrenLayout(); protected: - void showEvent( QShowEvent* ) override; - void changeEvent( QEvent* event ) override; void contextMenuEvent( QContextMenuEvent* ) override; void keyPressEvent( QKeyEvent* keyEvent ) override; - void resizeEvent( QResizeEvent* event ) override; - - QSize sizeHint() const override; QLabel* createTitleLabel() const; @@ -86,13 +81,14 @@ private: void alignCanvasTops(); void reinsertTracks(); void clearTrackLayout(); + private slots: void slotSetMinDepth( int value ); protected: QPointer m_layout; QPointer m_plotLayout; - QPointer m_plotFrame; + QPointer m_trackFrame; QPointer m_trackLayout; QPointer m_plotTitle; QPointer m_scrollBarLayout;