QCustomPlot Discussion and Comments

qcpaxisrect height in QScrollAreaReturn to overview

Hello is there a way to change the size of the QCPAxisrect embedded in a QscrollArea? I tried setting the customPlot->setMinimumHeight(a number) but it didn't change anything. Here is my code along with my ui.

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "qcustomplot.h"
#include <QWidget>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QWidget plotWidget;
    QCustomPlot* customPlot = new QCustomPlot;

    for(int i = 0; i < 100; i++)
    {
        customPlot->plotLayout()->insertRow(i);
        QCPAxisRect *ar = new QCPAxisRect(customPlot);
        customPlot->plotLayout()->addElement(i, 0, ar);

    }
    customPlot->setMinimumWidth(1800);
    this->setWindowState(Qt::WindowMaximized);

    ui->plotArea_SA->setWidget(customPlot);
}

MainWindow::~MainWindow()
{
    delete ui;
}

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1214</width>
    <height>638</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="cursor">
   <cursorShape>ArrowCursor</cursorShape>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <property name="autoFillBackground">
   <bool>false</bool>
  </property>
  <widget class="QWidget" name="centralWidget">
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
     <widget class="QScrollArea" name="searchTable_SA">
      <property name="maximumSize">
       <size>
        <width>300</width>
        <height>16777215</height>
       </size>
      </property>
      <property name="widgetResizable">
       <bool>true</bool>
      </property>
      <widget class="QWidget" name="scrollAreaWidgetContents_2">
       <property name="geometry">
        <rect>
         <x>0</x>
         <y>0</y>
         <width>298</width>
         <height>279</height>
        </rect>
       </property>
       <zorder>displayTable_SA</zorder>
      </widget>
     </widget>
    </item>
    <item row="1" column="0">
     <widget class="QScrollArea" name="displayTable_SA">
      <property name="maximumSize">
       <size>
        <width>300</width>
        <height>16777215</height>
       </size>
      </property>
      <property name="widgetResizable">
       <bool>true</bool>
      </property>
      <widget class="QWidget" name="scrollAreaWidgetContents_3">
       <property name="geometry">
        <rect>
         <x>0</x>
         <y>0</y>
         <width>298</width>
         <height>278</height>
        </rect>
       </property>
       <zorder>searchTable_SA</zorder>
      </widget>
     </widget>
    </item>
    <item row="0" column="1" rowspan="2">
     <widget class="QScrollArea" name="plotArea_SA">
      <property name="minimumSize">
       <size>
        <width>0</width>
        <height>0</height>
       </size>
      </property>
      <property name="horizontalScrollBarPolicy">
       <enum>Qt::ScrollBarAlwaysOff</enum>
      </property>
      <property name="sizeAdjustPolicy">
       <enum>QAbstractScrollArea::AdjustIgnored</enum>
      </property>
      <property name="widgetResizable">
       <bool>false</bool>
      </property>
      <widget class="QWidget" name="scrollAreaWidgetContents">
       <property name="geometry">
        <rect>
         <x>0</x>
         <y>0</y>
         <width>1000</width>
         <height>1000</height>
        </rect>
       </property>
       <property name="sizePolicy">
        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
         <horstretch>0</horstretch>
         <verstretch>2</verstretch>
        </sizepolicy>
       </property>
       <property name="minimumSize">
        <size>
         <width>1000</width>
         <height>1000</height>
        </size>
       </property>
       <zorder>displayTable_SA</zorder>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>1214</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>
   <attribute name="toolBarBreak">
    <bool>false</bool>
   </attribute>
  </widget>
  <widget class="QStatusBar" name="statusBar"/>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>

By default, height of the axis is set to the height of the layout which is fixed by setting the layout to a minimum height.