mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-31 16:52:10 +01:00
OP-1222 Added support for correct image scaling on open and resize.
This commit is contained in:
parent
271f6090b5
commit
d87cf62c00
@ -174,6 +174,7 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
|||||||
QGraphicsScene *scene = new QGraphicsScene();
|
QGraphicsScene *scene = new QGraphicsScene();
|
||||||
scene->addItem(planeimg);
|
scene->addItem(planeimg);
|
||||||
scene->setSceneRect(planeimg->boundingRect());
|
scene->setSceneRect(planeimg->boundingRect());
|
||||||
|
m_aircraft->planeShape->fitInView(planeimg, Qt::KeepAspectRatio);
|
||||||
m_aircraft->planeShape->setScene(scene);
|
m_aircraft->planeShape->setScene(scene);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -620,3 +621,18 @@ bool ConfigFixedWingWidget::throwConfigError(QString airframeType)
|
|||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ConfigFixedWingWidget::resizeEvent(QResizeEvent *)
|
||||||
|
{
|
||||||
|
if (planeimg) {
|
||||||
|
m_aircraft->planeShape->fitInView(planeimg, Qt::KeepAspectRatio);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigFixedWingWidget::showEvent(QShowEvent *)
|
||||||
|
{
|
||||||
|
if (planeimg) {
|
||||||
|
m_aircraft->planeShape->fitInView(planeimg, Qt::KeepAspectRatio);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -65,10 +65,13 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void enableControls(bool enable);
|
void enableControls(bool enable);
|
||||||
|
void resizeEvent(QResizeEvent *);
|
||||||
|
void showEvent(QShowEvent *);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
virtual void setupUI(QString airframeType);
|
virtual void setupUI(QString airframeType);
|
||||||
virtual bool throwConfigError(QString airframeType);
|
virtual bool throwConfigError(QString airframeType);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONFIGFIXEDWINGWIDGET_H
|
#endif // CONFIGFIXEDWINGWIDGET_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user