From 6e323dbea75ac249e1c092277b1055d6c40c957e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Mon, 24 Feb 2014 22:25:53 +0100 Subject: [PATCH] BasePreview no longer fix its own size in constructor This prevented free-sized previews from correctly sizing --- src/interface/desktop/baseform.cpp | 4 ++++ src/interface/desktop/formatmosphere.cpp | 4 ++-- src/render/preview/BasePreview.cpp | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/interface/desktop/baseform.cpp b/src/interface/desktop/baseform.cpp index 9283a4f..5b8faf4 100644 --- a/src/interface/desktop/baseform.cpp +++ b/src/interface/desktop/baseform.cpp @@ -374,6 +374,10 @@ void BaseForm::addPreview(BasePreview* preview, QString label) _previews->layout()->addWidget(label_widget); _previews->layout()->addWidget(preview); + preview->setMinimumSize(256, 256); + preview->setMaximumSize(256, 256); + preview->resize(256, 256); + _previews_list.append(preview); } diff --git a/src/interface/desktop/formatmosphere.cpp b/src/interface/desktop/formatmosphere.cpp index 37abd33..1285244 100644 --- a/src/interface/desktop/formatmosphere.cpp +++ b/src/interface/desktop/formatmosphere.cpp @@ -27,13 +27,13 @@ FormAtmosphere::FormAtmosphere(QWidget *parent): previewWest = new BasePreview(this); previewWestRenderer = new AtmosphereColorPreviewRenderer(_definition, M_PI / 2.0); - previewWest->setRenderer(previewWestRenderer); addPreview(previewWest, QString(tr("West preview"))); + previewWest->setRenderer(previewWestRenderer); previewEast = new BasePreview(this); previewEastRenderer = new AtmosphereColorPreviewRenderer(_definition, -M_PI / 2.0); - previewEast->setRenderer(previewEastRenderer); addPreview(previewEast, QString(tr("East preview"))); + previewEast->setRenderer(previewEastRenderer); //addInputEnum(tr("Color model"), (int*)&_definition->model, QStringList(tr("Simplified model (with weather)")) << tr("Complex model")); addInputInt(tr("Day time (hour)"), &_definition->hour, 0, 23, 1, 10); diff --git a/src/render/preview/BasePreview.cpp b/src/render/preview/BasePreview.cpp index 63f8d80..bbac1c1 100644 --- a/src/render/preview/BasePreview.cpp +++ b/src/render/preview/BasePreview.cpp @@ -413,9 +413,7 @@ DrawingWidget(parent) QObject::connect(this, SIGNAL(contentChange()), this, SLOT(update())); - this->setMinimumSize(256, 256); - this->setMaximumSize(256, 256); - this->resize(256, 256); + setMinimumSize(10, 10); startTimer(50); }