(#485) Grow plot size when adding tracks

This commit is contained in:
Magne Sjaastad
2015-09-21 15:00:54 +02:00
parent 5e58cb141e
commit 4d42fd37f5
2 changed files with 12 additions and 3 deletions

View File

@@ -115,6 +115,7 @@ public:
void tileWindows();
bool isAnyMdiSubWindowVisible();
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
protected:
virtual void closeEvent(QCloseEvent* event);
@@ -130,8 +131,6 @@ private:
void updateRecentFileActions();
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
void storeTreeViewState();
void restoreTreeViewState();

View File

@@ -31,6 +31,7 @@
#include <QHBoxLayout>
#include <QScrollBar>
#include <QFocusEvent>
#include <QMdiSubWindow>
#include <math.h>
@@ -73,7 +74,16 @@ void RiuWellLogPlot::insertTrackPlot(RiuWellLogTrackPlot* trackPlot)
{
// Insert the plot to the left of the scroll bar
m_layout->insertWidget(m_layout->count() - 1, trackPlot);
m_trackPlots.append(trackPlot);
m_trackPlots.append(trackPlot);
QMdiSubWindow* mdiWindow = RiuMainWindow::instance()->findMdiSubWindow(this);
if (mdiWindow)
{
QSize subWindowSize = mdiWindow->size();
subWindowSize.setWidth(subWindowSize.width() + trackPlot->width());
mdiWindow->resize(subWindowSize);
}
}
//--------------------------------------------------------------------------------------------------