mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2102 Statistics dialog. Adjust text edit height to its contents
This commit is contained in:
@@ -67,6 +67,7 @@ RicGridStatisticsDialog::RicGridStatisticsDialog(QWidget* parent)
|
||||
|
||||
QVBoxLayout* plotLayout = new QVBoxLayout();
|
||||
plotLayout->setSpacing(0);
|
||||
//plotLayout->addStretch();
|
||||
plotLayout->addWidget(m_historgramPlot);
|
||||
plotLayout->addWidget(m_aggregatedPlot);
|
||||
layout->addLayout(plotLayout);
|
||||
@@ -102,6 +103,7 @@ void RicGridStatisticsDialog::setInfoText(RimView* view)
|
||||
text = overlayInfo->caseInfoText();
|
||||
text += overlayInfo->resultInfoText(overlayInfo->histogramData());
|
||||
m_textEdit->setText(text);
|
||||
adjustTextEditHeightToContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,6 +225,15 @@ QwtPlotMarker* RicGridStatisticsDialog::createVerticalPlotMarker(const QColor& c
|
||||
return marker;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicGridStatisticsDialog::adjustTextEditHeightToContent()
|
||||
{
|
||||
int docHeight = m_textEdit->document()->size().height();
|
||||
m_textEdit->setFixedHeight(docHeight + 10);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user