chart widget minimum size

This commit is contained in:
Benedek László 2024-05-19 18:23:54 +02:00
parent a844518a4b
commit 3694ebdcde
2 changed files with 3 additions and 3 deletions

View File

@ -95,9 +95,7 @@ void ChartWidget::clear() {
} }
QSize ChartWidget::sizeHint() const { QSize ChartWidget::sizeHint() const {
if (width() < minimumWidth() || height() < minimumHeight()) return QSize(600, 350);
return minimumSize();
return QSize(width(), height());
} }
QPointF ChartWidget::pointToCoord(const point_t& point) { QPointF ChartWidget::pointToCoord(const point_t& point) {

View File

@ -86,6 +86,8 @@ void MainWindow::on_action_Add_triggered() {
QListWidgetItem* item = new QListWidgetItem(); QListWidgetItem* item = new QListWidgetItem();
item->setSizeHint(chart->minimumSize());
ui->graphsListWidget->addItem(item); ui->graphsListWidget->addItem(item);
ui->graphsListWidget->setItemWidget(item, chart); ui->graphsListWidget->setItemWidget(item, chart);
} }