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:
parent
8c11a03129
commit
4ef9c7de22
@ -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)
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user