From f632e9c56878a3e4f299d42cbd844defa419e8b7 Mon Sep 17 00:00:00 2001 From: cranphin Date: Mon, 30 Aug 2010 22:00:48 +0000 Subject: [PATCH] Little bit of cleanup, move Designer set properties to designer and out of cpp, and update the comment on fitInView (it doesn't work cause we're not shown yet, but fixed is fine since the widget is fixed size too). git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1473 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp | 9 ++------- ground/src/plugins/gpsdisplay/gpsdisplaywidget.ui | 8 +++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp b/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp index 2285655aa..42800f05b 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp +++ b/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp @@ -42,9 +42,6 @@ */ GpsDisplayWidget::GpsDisplayWidget(QWidget *parent) : QWidget(parent) { - setMinimumSize(128,128); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - widget = new Ui_GpsDisplayWidget(); widget->setupUi(this); @@ -57,11 +54,9 @@ GpsDisplayWidget::GpsDisplayWidget(QWidget *parent) : QWidget(parent) scene->addItem(world); scene->setSceneRect(world->boundingRect()); widget->gpsWorld->setScene(scene); - // Somehow fitInView does not work there at all? Makes - // the 'world' element tiny tiny tiny. anyone knows why?? - //widget->gpsWorld->fitInView(world,Qt::KeepAspectRatio); + + // Scale, can't use fitInView since that doesn't work until we're shown. qreal factor = widget->gpsWorld->size().height()/world->boundingRect().height(); - widget->gpsWorld->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); world->setScale(factor); //Not elegant, just load the image for now diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaywidget.ui b/ground/src/plugins/gpsdisplay/gpsdisplaywidget.ui index 25889f4fd..b35abd5ab 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaywidget.ui +++ b/ground/src/plugins/gpsdisplay/gpsdisplaywidget.ui @@ -11,11 +11,17 @@ - + 0 0 + + + 500 + 300 + + Form