gui: fixed gain plot size

This commit is contained in:
2019-07-18 10:20:33 +02:00
parent 3ef8b392db
commit 058e16b872
8 changed files with 64 additions and 23 deletions

View File

@ -47,10 +47,11 @@ void qCloneWidget::SetupWidgetWindow(QString title) {
if (gainplot2d == nullptr) {
plotLayout->addWidget(plot2d);
} else {
gainplot2d->setFixedWidth(plot2d->width() / 4);
gainplot2d->setFixedHeight(plot2d->height() / 4);
plotLayout->addWidget(plot2d, 0, 0, 4, 4);
plotLayout->addWidget(gainplot2d, 0, 4, 1, 1);
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
int ratio = qDefs::DATA_GAIN_PLOT_RATIO - 1;
plotLayout->addWidget(plot2d, 0, 0, ratio, ratio);
plotLayout->addWidget(gainplot2d, 0, ratio, 1, 1, Qt::AlignRight | Qt::AlignTop);
}
}
connect(actionSaveClone, SIGNAL(triggered()), this, SLOT(SavePlot()));
@ -89,3 +90,11 @@ void qCloneWidget::SavePlot() {
}
}
}
void qCloneWidget::resizeEvent(QResizeEvent *event) {
if (gainplot2d != nullptr) {
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
}
event->accept();
}