1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Make the Airspeed gadget dials resize dynamically when the gadget size changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@555 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-04-27 14:04:06 +00:00 committed by edouard
parent 8c11a03129
commit 4ef9c7de22
2 changed files with 9 additions and 0 deletions

View File

@ -101,6 +101,14 @@ void AirspeedGadgetWidget::paintEvent(QPaintEvent *event)
QGraphicsView::paintEvent(event);
}
// This event enables the dial to be dynamically resized
// whenever the gadget is resized, taking advantage of the vector
// nature of SVG dials.
void AirspeedGadgetWidget::resizeEvent(QResizeEvent *event)
{
fitInView(m_background, Qt::KeepAspectRatio );
}
// Take a unitless speed value and sets the actual needle accordingly
// scale fixed at 0-90 for now
void AirspeedGadgetWidget::setActual(int speed)

View File

@ -50,6 +50,7 @@ public:
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
private: