1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

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
This commit is contained in:
cranphin 2010-08-30 22:00:48 +00:00 committed by cranphin
parent 131d3d7d26
commit f632e9c568
2 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -11,11 +11,17 @@
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>300</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>