mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-11 01:54:14 +01:00
Corrected GUI widget spacers, added OpenGL rendering.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2617 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
f6805de71e
commit
7c73f9c2c8
@ -1,6 +1,7 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = GCSControl
|
TARGET = GCSControl
|
||||||
QT += svg
|
QT += svg
|
||||||
|
QT += opengl
|
||||||
|
|
||||||
include(../../openpilotgcsplugin.pri)
|
include(../../openpilotgcsplugin.pri)
|
||||||
include(../../plugins/coreplugin/coreplugin.pri)
|
include(../../plugins/coreplugin/coreplugin.pri)
|
||||||
|
@ -20,6 +20,12 @@
|
|||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
@ -43,6 +49,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Flight Mode:</string>
|
<string>Flight Mode:</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -53,20 +62,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0">
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0">
|
|
||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
@ -83,8 +79,8 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>100</width>
|
||||||
<height>200</height>
|
<height>100</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="mouseTracking">
|
<property name="mouseTracking">
|
||||||
@ -92,7 +88,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="2">
|
||||||
<widget class="JoystickControl" name="widgetRightStick" native="true">
|
<widget class="JoystickControl" name="widgetRightStick" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
@ -102,12 +98,25 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>100</width>
|
||||||
<height>200</height>
|
<height>100</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>2</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -71,6 +71,9 @@ GCSControlGadgetWidget::GCSControlGadgetWidget(QWidget *parent) : QLabel(parent)
|
|||||||
leftY = 0;
|
leftY = 0;
|
||||||
rightX = 0;
|
rightX = 0;
|
||||||
rightY = 0;
|
rightY = 0;
|
||||||
|
|
||||||
|
m_gcscontrol->widgetLeftStick->enableOpenGL(true);
|
||||||
|
m_gcscontrol->widgetRightStick->enableOpenGL(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
GCSControlGadgetWidget::~GCSControlGadgetWidget()
|
GCSControlGadgetWidget::~GCSControlGadgetWidget()
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QtOpenGL/QGLWidget>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,6 +74,17 @@ JoystickControl::~JoystickControl()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Enables/Disables OpenGL
|
||||||
|
*/
|
||||||
|
void JoystickControl::enableOpenGL(bool flag)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
||||||
|
else
|
||||||
|
setViewport(new QWidget);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Update the displayed position based on an MCC update
|
* @brief Update the displayed position based on an MCC update
|
||||||
*/
|
*/
|
||||||
|
@ -46,6 +46,7 @@ class JoystickControl : public QGraphicsView
|
|||||||
public:
|
public:
|
||||||
explicit JoystickControl(QWidget *parent = 0);
|
explicit JoystickControl(QWidget *parent = 0);
|
||||||
~JoystickControl();
|
~JoystickControl();
|
||||||
|
void enableOpenGL(bool flag);
|
||||||
void paint();
|
void paint();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user