8 changed files with 262 additions and 5 deletions
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
# ------------------------------------------------- |
||||
# QGroundControl - Micro Air Vehicle Groundstation |
||||
# Please see our website at <http://qgroundcontrol.org> |
||||
# Author: |
||||
# Lorenz Meier <mavteam@student.ethz.ch> |
||||
# (c) 2009-2010 PIXHAWK Team |
||||
# This file is part of the mav groundstation project |
||||
# QGroundControl is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
# QGroundControl is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>. |
||||
# ------------------------------------------------- |
||||
# Include QMapControl map library |
||||
# prefer version from external directory / |
||||
# from http://github.com/pixhawk/qmapcontrol/ |
||||
# over bundled version in lib directory |
||||
# Version from GIT repository is preferred |
||||
# include ( "../qmapcontrol/QMapControl/QMapControl.pri" ) #{ |
||||
# Include bundled version if necessary |
||||
|
||||
CONFIG += designer plugin |
||||
TARGET = $$qtLibraryTarget($$TARGET) |
||||
TEMPLATE = lib |
||||
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer |
||||
|
||||
FORMS = src/ui/designer/QGCParamSlider.ui |
||||
|
||||
HEADERS = src/ui/designer/QGCParamSlider.h \ |
||||
src/ui/designer/QGCParamSliderPlugin.h |
||||
SOURCES = src/ui/designer/QGCParamSlider.cc \ |
||||
src/ui/designer/QGCParamSliderPlugin.cc |
||||
|
||||
# install |
||||
target.path = $$[QT_INSTALL_PLUGINS]/designer |
||||
sources.files = $$SOURCES $$HEADERS *.pro |
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockplugin |
||||
INSTALLS += target |
||||
|
||||
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
#include "QGCParamSlider.h" |
||||
#include "ui_QGCParamSlider.h" |
||||
|
||||
QGCParamSlider::QGCParamSlider(QWidget *parent) : |
||||
QWidget(parent), |
||||
ui(new Ui::QGCParamSlider) |
||||
{ |
||||
ui->setupUi(this); |
||||
} |
||||
|
||||
QGCParamSlider::~QGCParamSlider() |
||||
{ |
||||
delete ui; |
||||
} |
||||
|
||||
void QGCParamSlider::changeEvent(QEvent *e) |
||||
{ |
||||
QWidget::changeEvent(e); |
||||
switch (e->type()) { |
||||
case QEvent::LanguageChange: |
||||
ui->retranslateUi(this); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
#ifndef QGCPARAMSLIDER_H |
||||
#define QGCPARAMSLIDER_H |
||||
|
||||
#include <QWidget> |
||||
#include <QtDesigner/QDesignerExportWidget> |
||||
|
||||
namespace Ui { |
||||
class QGCParamSlider; |
||||
} |
||||
|
||||
class QDESIGNER_WIDGET_EXPORT QGCParamSlider : public QWidget |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCParamSlider(QWidget *parent = 0); |
||||
~QGCParamSlider(); |
||||
|
||||
protected: |
||||
void changeEvent(QEvent *e); |
||||
|
||||
private: |
||||
Ui::QGCParamSlider *ui; |
||||
}; |
||||
|
||||
#endif // QGCPARAMSLIDER_H
|
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCParamSlider</class> |
||||
<widget class="QWidget" name="QGCParamSlider"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>400</width> |
||||
<height>22</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||
<property name="spacing"> |
||||
<number>8</number> |
||||
</property> |
||||
<property name="margin"> |
||||
<number>0</number> |
||||
</property> |
||||
<item> |
||||
<widget class="QLabel" name="nameLabel"> |
||||
<property name="text"> |
||||
<string>Name</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="valueLabel"> |
||||
<property name="text"> |
||||
<string>0.00</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QSlider" name="valueSlider"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
#include "QGCParamSliderPlugin.h" |
||||
#include "QGCParamSlider.h" |
||||
|
||||
#include <QtPlugin> |
||||
|
||||
QGCParamSliderPlugin::QGCParamSliderPlugin(QObject *parent) : |
||||
QObject(parent) |
||||
{ |
||||
initialized = false; |
||||
} |
||||
|
||||
void QGCParamSliderPlugin::initialize(QDesignerFormEditorInterface * /* core */) |
||||
{ |
||||
if (initialized) |
||||
return; |
||||
|
||||
initialized = true; |
||||
} |
||||
|
||||
bool QGCParamSliderPlugin::isInitialized() const |
||||
{ |
||||
return initialized; |
||||
} |
||||
|
||||
QWidget *QGCParamSliderPlugin::createWidget(QWidget *parent) |
||||
{ |
||||
return new QGCParamSlider(parent); |
||||
} |
||||
|
||||
QString QGCParamSliderPlugin::name() const |
||||
{ |
||||
return "QGCParamSlider"; |
||||
} |
||||
|
||||
QString QGCParamSliderPlugin::group() const |
||||
{ |
||||
return "QGroundControl"; |
||||
} |
||||
|
||||
QIcon QGCParamSliderPlugin::icon() const |
||||
{ |
||||
return QIcon(); |
||||
} |
||||
|
||||
QString QGCParamSliderPlugin::toolTip() const |
||||
{ |
||||
return ""; |
||||
} |
||||
|
||||
QString QGCParamSliderPlugin::whatsThis() const |
||||
{ |
||||
return ""; |
||||
} |
||||
|
||||
bool QGCParamSliderPlugin::isContainer() const |
||||
{ |
||||
return false; |
||||
} |
||||
|
||||
QString QGCParamSliderPlugin::domXml() const |
||||
{ |
||||
return "<ui language=\"c++\">\n" |
||||
" <widget class=\"QGCParamSlider\" name=\"paramSlider\">\n" |
||||
" <property name=\"geometry\">\n" |
||||
" <rect>\n" |
||||
" <x>0</x>\n" |
||||
" <y>0</y>\n" |
||||
" <width>150</width>\n" |
||||
" <height>16</height>\n" |
||||
" </rect>\n" |
||||
" </property>\n" |
||||
" </widget>\n" |
||||
"</ui>"; |
||||
} |
||||
|
||||
QString QGCParamSliderPlugin::includeFile() const |
||||
{ |
||||
return "QGCParamSlider.h"; |
||||
} |
||||
|
||||
Q_EXPORT_PLUGIN2(qgcparamsliderplugin, QGCParamSliderPlugin) |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
#ifndef QGCPARAMSLIDERPLUGIN_H |
||||
#define QGCPARAMSLIDERPLUGIN_H |
||||
|
||||
#include <QtDesigner/QDesignerCustomWidgetInterface> |
||||
|
||||
class QGCParamSliderPlugin : public QObject, |
||||
public QDesignerCustomWidgetInterface |
||||
{ |
||||
Q_OBJECT |
||||
Q_INTERFACES(QDesignerCustomWidgetInterface) |
||||
|
||||
public: |
||||
explicit QGCParamSliderPlugin(QObject *parent = 0); |
||||
|
||||
bool isContainer() const; |
||||
bool isInitialized() const; |
||||
QIcon icon() const; |
||||
QString domXml() const; |
||||
QString group() const; |
||||
QString includeFile() const; |
||||
QString name() const; |
||||
QString toolTip() const; |
||||
QString whatsThis() const; |
||||
QWidget *createWidget(QWidget *parent); |
||||
void initialize(QDesignerFormEditorInterface *core); |
||||
|
||||
private: |
||||
bool initialized; |
||||
}; |
||||
|
||||
#endif // QGCPARAMSLIDERPLUGIN_H
|
Loading…
Reference in new issue