Use layouts for tracks in Well Log Plot

This commit is contained in:
Gaute Lindkvist
2019-09-06 15:52:45 +02:00
parent ff42e8b1be
commit 9fe021c6ca
6 changed files with 77 additions and 329 deletions

View File

@@ -23,6 +23,9 @@
#include "cafPdmPointer.h"
#include <QFrame>
#include <QGridLayout>
#include <QHBoxLayout>
#include <QList>
#include <QPointer>
#include <QWidget>
@@ -48,6 +51,7 @@ class RiuWellLogPlot : public QWidget, public RiuInterfaceToViewWindow
public:
RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent = nullptr );
~RiuWellLogPlot() override;
RimWellLogPlot* ownerPlotDefinition();
@@ -61,36 +65,33 @@ public:
void setPlotTitle( const QString& plotTitle );
virtual QSize preferredSize() const;
void showTitle();
void hideTitle();
public slots:
void updateChildrenLayout();
void setTitleVisible( bool visible );
protected:
void resizeEvent( QResizeEvent* event ) override;
void showEvent( QShowEvent* ) override;
void changeEvent( QEvent* ) override;
void contextMenuEvent( QContextMenuEvent* ) override;
QSize sizeHint() const override;
void keyPressEvent( QKeyEvent* keyEvent ) override;
QLabel* createTitleLabel() const;
private:
void updateScrollBar( double minDepth, double maxDepth );
std::map<int, int> calculateTrackWidthsToMatchFrame( int frameWidth ) const;
void placeChildWidgets( int frameHeight, int frameWidth );
void positionTitle( int frameWidth );
void updateScrollBar( double minDepth, double maxDepth );
// std::map<int, int> calculateTrackWidthsToMatchFrame( int frameWidth ) const;
// void placeChildWidgets( int frameHeight, int frameWidth );
// void positionTitle( int frameWidth );
private slots:
void slotSetMinDepth( int value );
void scheduleUpdateChildrenLayout();
protected:
QPointer<QVBoxLayout> m_layout;
QPointer<QHBoxLayout> m_plotLayout;
QPointer<QFrame> m_plotFrame;
QPointer<QGridLayout> m_trackLayout;
QPointer<QLabel> m_plotTitle;
QScrollBar* m_scrollBar;
QList<QPointer<QwtLegend>> m_legends;
QList<QPointer<RiuWellLogTrack>> m_trackPlots;
caf::PdmPointer<RimWellLogPlot> m_plotDefinition;
QTimer* m_scheduleUpdateChildrenLayoutTimer;
};