1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Cosmetic changes to the look of the new map plug-in (buttons colours, widget borders etc).

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@907 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2010-06-27 18:59:40 +00:00 committed by pip
parent 4b9f224674
commit 82aa515a52
18 changed files with 945 additions and 231 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

View File

@ -10,16 +10,19 @@ HEADERS += opmapplugin.h \
opmapgadgetconfiguration.h \ opmapgadgetconfiguration.h \
opmapgadget.h \ opmapgadget.h \
opmapgadgetwidget.h \ opmapgadgetwidget.h \
opmap_waypointeditor_dialog.h opmap_waypointeditor_dialog.h \
opmap_mapoverlaywidget.h
SOURCES += opmapplugin.cpp \ SOURCES += opmapplugin.cpp \
opmapgadgetwidget.cpp \ opmapgadgetwidget.cpp \
opmapgadgetoptionspage.cpp \ opmapgadgetoptionspage.cpp \
opmapgadgetfactory.cpp \ opmapgadgetfactory.cpp \
opmapgadgetconfiguration.cpp \ opmapgadgetconfiguration.cpp \
opmapgadget.cpp \ opmapgadget.cpp \
opmap_waypointeditor_dialog.cpp opmap_waypointeditor_dialog.cpp \
opmap_mapoverlaywidget.cpp
OTHER_FILES += OPMapGadget.pluginspec OTHER_FILES += OPMapGadget.pluginspec
FORMS += opmapgadgetoptionspage.ui \ FORMS += opmapgadgetoptionspage.ui \
opmap_widget.ui \ opmap_widget.ui \
opmap_waypointeditor_dialog.ui opmap_waypointeditor_dialog.ui \
opmap_mapoverlaywidget.ui
RESOURCES += opmap.qrc RESOURCES += opmap.qrc

View File

@ -1,16 +1,18 @@
<RCC> <RCC>
<qresource prefix="/opmap"> <qresource prefix="/opmap">
<file>images/ok.png</file> <file>images/ok.png</file>
<file>images/circle.png</file>
<file>images/go.png</file>
<file>images/home.png</file>
<file>images/hover.png</file>
<file>images/uav.png</file> <file>images/uav.png</file>
<file>images/gcs.png</file> <file>images/gcs.png</file>
<file>images/plus.png</file> <file>images/plus.png</file>
<file>images/minus.png</file> <file>images/minus.png</file>
<file>images/waypoint.png</file> <file>images/waypoint.png</file>
<file>images/hold.png</file> <file>images/right_but.png</file>
<file>images/left_but.png</file>
<file>images/combobox_down_arrow.png</file> <file>images/combobox_down_arrow.png</file>
<file>images/home.png</file>
<file>images/hold.png</file>
<file>images/go.png</file>
<file>images/next_waypoint.png</file>
<file>images/prev_waypoint.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -0,0 +1,36 @@
#include "opmap_mapoverlaywidget.h"
#include "ui_opmap_mapoverlaywidget.h"
OPMap_MapOverlayWidget::OPMap_MapOverlayWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::OPMap_MapOverlayWidget)
{
ui->setupUi(this);
}
OPMap_MapOverlayWidget::~OPMap_MapOverlayWidget()
{
delete ui;
}
void OPMap_MapOverlayWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void OPMap_MapOverlayWidget::on_verticalSlider_sliderMoved(int position)
{
}
void OPMap_MapOverlayWidget::on_dial_sliderMoved(int position)
{
}

View File

@ -0,0 +1,27 @@
#ifndef OPMAP_MAPOVERLAYWIDGET_H
#define OPMAP_MAPOVERLAYWIDGET_H
#include <QWidget>
namespace Ui {
class OPMap_MapOverlayWidget;
}
class OPMap_MapOverlayWidget : public QWidget {
Q_OBJECT
public:
OPMap_MapOverlayWidget(QWidget *parent = 0);
~OPMap_MapOverlayWidget();
protected:
void changeEvent(QEvent *e);
private:
Ui::OPMap_MapOverlayWidget *ui;
private slots:
void on_dial_sliderMoved(int position);
void on_verticalSlider_sliderMoved(int position);
};
#endif // OPMAP_MAPOVERLAYWIDGET_H

View File

@ -0,0 +1,438 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OPMap_MapOverlayWidget</class>
<widget class="QWidget" name="OPMap_MapOverlayWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>287</width>
<height>299</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string/>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">/*background-color: rgba(0, 0, 0, 0);*/
background-color: transparent;
QFrame {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(110, 110, 110, 255), stop:1 rgba(71, 71, 71, 255));
color: rgba(255, 255, 255, 70);
}
QLabel { /* all label types */
/* background-color: rgba(255, 255, 255, 0); */
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255));
color: rgb(255, 255, 255);
}
QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QSlider::groove:horizontal {
border: none;
height: 4px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255));
margin: 2px 0;
}
QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255));
width: 24px;
margin: -2px 0;
border-radius: 3px;
}
QComboBox {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QComboBox:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
background-color: rgb(197, 138, 0);
}
QComboBox::down-arrow {
image: url(:/opmap/images/combobox_down_arrow.png);
}
QComboBox:drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
border-left-style: none;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
}
QToolTip {
background-color: white;
color: black;
border: 1px solid black;
padding: 5px;
border-radius: 2px;
/* opacity: 170; */
}
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="rightMargin">
<number>10</number>
</property>
<item row="0" column="3" rowspan="2">
<widget class="QSlider" name="verticalSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QSlider::handle:vertical {
border: 1px solid #5c5c5c;
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(128, 128, 128, 255), stop:1 rgba(255, 255, 255, 255));
width: 24px;
height: 20px;
margin: -2px 0;
border-radius: 3px;
}
</string>
</property>
<property name="minimum">
<number>2</number>
</property>
<property name="maximum">
<number>19</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="tracking">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDial" name="dial">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>180</number>
</property>
<property name="wrapping">
<bool>true</bool>
</property>
<property name="notchTarget">
<double>1.000000000000000</double>
</property>
<property name="notchesVisible">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<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 row="0" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="toolButtonLeftPanel">
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/left_but.png</normaloff>:/opmap/images/left_but.png</iconset>
</property>
<property name="iconSize">
<size>
<width>17</width>
<height>48</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<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>
<widget class="QToolButton" name="toolButtonRightPanel">
<property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/right_but.png</normaloff>:/opmap/images/right_but.png</iconset>
</property>
<property name="iconSize">
<size>
<width>17</width>
<height>48</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>20</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<item>
<widget class="QLabel" name="labelUAV_2">
<property name="styleSheet">
<string notr="true">QLabel { /* all label types */
/* background-color: rgba(0, 0, 0, 0); */
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0.778409 rgba(0, 0, 0, 176), stop:1 rgba(0, 0, 0, 0));
color: rgb(255, 255, 255);
}</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="margin">
<number>8</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<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>
<widget class="QLabel" name="labelMouse">
<property name="styleSheet">
<string notr="true">QLabel { /* all label types */
/* background-color: rgba(0, 0, 0, 0); */
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0.778409 rgba(0, 0, 0, 176), stop:1 rgba(0, 0, 0, 0));
color: rgb(255, 255, 255);
}</string>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="margin">
<number>8</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="opmap.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>704</width> <width>704</width>
<height>475</height> <height>327</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -44,7 +44,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frame_2"> <widget class="QFrame" name="frameToolBar">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum"> <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -120,10 +120,16 @@ QComboBox::down-arrow {
QComboBox:drop-down { QComboBox:drop-down {
subcontrol-origin: padding; subcontrol-origin: padding;
subcontrol-position: top right; subcontrol-position: top right;
border-left-style: none; border-left-style: 1px solid black;
border-top-right-radius: 1px; border-top-right-radius: 1px;
border-bottom-right-radius: 1px; border-bottom-right-radius: 1px;
} }
QComboBox QAbstractItemView { /* the drop down list */
background-color: rgb(255, 255, 255);
color: rgb(0, 0, 0);
border: 2px solid darkgray;
selection-background-color: lightgray;
}
QToolTip { QToolTip {
background-color: white; background-color: white;
@ -136,7 +142,7 @@ border-radius: 2px;
</string> </string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Plain</enum> <enum>QFrame::Plain</enum>
@ -149,13 +155,13 @@ border-radius: 2px;
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>3</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>3</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="layoutWidget_8"> <layout class="QHBoxLayout" name="layoutWidget_8">
@ -163,10 +169,10 @@ border-radius: 2px;
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>8</number> <number>3</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>8</number> <number>3</number>
</property> </property>
<item> <item>
<widget class="QToolButton" name="toolButtonWaypointsTreeViewShowHide"> <widget class="QToolButton" name="toolButtonWaypointsTreeViewShowHide">
@ -190,19 +196,25 @@ border-radius: 2px;
<normaloff>:/core/images/prev.png</normaloff>:/core/images/prev.png</iconset> <normaloff>:/core/images/prev.png</normaloff>:/core/images/prev.png</iconset>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line_9"> <spacer name="horizontalSpacer">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboBoxFindPlace"> <widget class="QComboBox" name="comboBoxFindPlace">
@ -224,6 +236,9 @@ border-radius: 2px;
<property name="editable"> <property name="editable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="maxVisibleItems"> <property name="maxVisibleItems">
<number>20</number> <number>20</number>
</property> </property>
@ -233,6 +248,21 @@ border-radius: 2px;
<property name="frame"> <property name="frame">
<bool>false</bool> <bool>false</bool>
</property> </property>
<item>
<property name="text">
<string>london</string>
</property>
</item>
<item>
<property name="text">
<string>new york</string>
</property>
</item>
<item>
<property name="text">
<string>paris</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item> <item>
@ -257,7 +287,7 @@ border-radius: 2px;
</size> </size>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="arrowType"> <property name="arrowType">
<enum>Qt::NoArrow</enum> <enum>Qt::NoArrow</enum>
@ -265,14 +295,20 @@ border-radius: 2px;
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line_4"> <spacer name="horizontalSpacer_5">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="toolButtonMapHome"> <widget class="QToolButton" name="toolButtonMapHome">
@ -299,7 +335,7 @@ border-radius: 2px;
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -331,19 +367,25 @@ border-radius: 2px;
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line_5"> <spacer name="horizontalSpacer_6">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="toolButtonAddWaypoint"> <widget class="QToolButton" name="toolButtonAddWaypoint">
@ -370,7 +412,7 @@ border-radius: 2px;
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -399,19 +441,22 @@ border-radius: 2px;
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line_6"> <spacer name="horizontalSpacer_4">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="toolButtonZoomM"> <widget class="QToolButton" name="toolButtonZoomM">
@ -435,7 +480,7 @@ border-radius: 2px;
</size> </size>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -465,7 +510,7 @@ p, li { white-space: pre-wrap; }
</size> </size>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -522,39 +567,22 @@ color: rgb(255, 255, 255);</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line_7">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>15</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="Line" name="line_8">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="toolButtonReload"> <widget class="QToolButton" name="toolButtonReload">
<property name="sizePolicy"> <property name="sizePolicy">
@ -579,23 +607,13 @@ color: rgb(255, 255, 255);</string>
</size> </size>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="arrowType"> <property name="arrowType">
<enum>Qt::NoArrow</enum> <enum>Qt::NoArrow</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line_3">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="toolButtonFlightControlsShowHide"> <widget class="QToolButton" name="toolButtonFlightControlsShowHide">
<property name="sizePolicy"> <property name="sizePolicy">
@ -618,7 +636,7 @@ color: rgb(255, 255, 255);</string>
<normaloff>:/core/images/next.png</normaloff>:/core/images/next.png</iconset> <normaloff>:/core/images/next.png</normaloff>:/core/images/next.png</iconset>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -637,7 +655,8 @@ color: rgb(255, 255, 255);</string>
<item> <item>
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));</string> <string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(71, 71, 71, 255), stop:1 rgba(110, 110, 110, 255));
</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
@ -652,7 +671,7 @@ color: rgb(255, 255, 255);</string>
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="handleWidth"> <property name="handleWidth">
<number>5</number> <number>7</number>
</property> </property>
<property name="childrenCollapsible"> <property name="childrenCollapsible">
<bool>false</bool> <bool>false</bool>
@ -672,7 +691,7 @@ color: rgb(255, 255, 255);</string>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>600</width> <width>300</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -682,6 +701,17 @@ color: rgb(255, 255, 255);</string>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(71, 71, 71, 255), stop:1 rgba(110, 110, 110, 255)); <string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(71, 71, 71, 255), stop:1 rgba(110, 110, 110, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
/*
QTreeView::item {
border: 1px solid #d9d9d9;
border-top-color: transparent;
border-bottom-color: transparent;
}
*/
QTreeView::item:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
border: 1px solid #bfcde4;
}
QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings { QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings {
border-image: none; border-image: none;
@ -728,16 +758,75 @@ QTreeView::branch:open:has-children:!has-siblings, QTreeView::branch:open:has-ch
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QWidget { <string notr="true">
background-color: black; background-color: black;
border: 1px solid black;
QLabel { /* all label types */
/* background-color: rgba(255, 255, 255, 0); */
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255));
color: rgb(255, 255, 255);
}
QToolButton { /* all types of tool button */
background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);
/*border-style: none;*/
border: 0px;
}
QToolButton:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 160, 0, 255), stop:1 rgba(160, 100, 0, 255));
color: rgb(255, 255, 255);
}
QToolButton:pressed {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QToolButton:checked {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QSlider::groove:horizontal {
border: none;
height: 4px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(80, 80, 80, 255));
margin: 2px 0;
}
QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(255, 255, 255, 255), stop:1 rgba(128, 128, 128, 255));
width: 24px;
margin: -2px 0;
border-radius: 3px;
}
QComboBox {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255);
}
QComboBox:hover {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
background-color: rgb(197, 138, 0);
}
QComboBox::down-arrow {
image: url(:/opmap/images/combobox_down_arrow.png);
}
QComboBox:drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
border-left-style: none;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
} }
QToolTip { QToolTip {
background-color: white; background-color: white;
color: black; color: black;
border: 1px solid black; border: 1px solid black;
padding: 2px; padding: 5px;
border-radius: 3px; border-radius: 2px;
/* opacity: 170; */ /* opacity: 170; */
} }
</string> </string>
@ -746,22 +835,22 @@ border-radius: 3px;
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="widgetFlightControls" native="true"> <widget class="QFrame" name="frameFlightControls">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>87</width> <width>48</width>
<height>50</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>87</width> <width>70</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -799,21 +888,33 @@ border-radius: 3px;
} }
</string> </string>
</property> </property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin"> <property name="spacing">
<number>8</number> <number>1</number>
</property> </property>
<property name="topMargin"> <property name="margin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QToolButton" name="toolButtonHome"> <widget class="QToolButton" name="toolButtonHome">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>0</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>UAV go home</string> <string>UAV go home</string>
</property> </property>
@ -840,12 +941,100 @@ border-radius: 3px;
<enum>Qt::ToolButtonIconOnly</enum> <enum>Qt::ToolButtonIconOnly</enum>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonPrevWaypoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Move UAV to previous waypoint</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/prev_waypoint.png</normaloff>:/opmap/images/prev_waypoint.png</iconset>
</property>
<property name="iconSize">
<size>
<width>70</width>
<height>70</height>
</size>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonNextWaypoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Move UAV to next waypoint</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="opmap.qrc">
<normaloff>:/opmap/images/next_waypoint.png</normaloff>:/opmap/images/next_waypoint.png</iconset>
</property>
<property name="iconSize">
<size>
<width>70</width>
<height>70</height>
</size>
</property>
<property name="autoRaise">
<bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="toolButtonHoldPosition"> <widget class="QToolButton" name="toolButtonHoldPosition">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>0</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>UAV hold position</string> <string>UAV hold position</string>
</property> </property>
@ -866,12 +1055,24 @@ border-radius: 3px;
</size> </size>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="toolButtonGo"> <widget class="QToolButton" name="toolButtonGo">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>48</width>
<height>0</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>UAV go!</string> <string>UAV go!</string>
</property> </property>
@ -892,7 +1093,7 @@ border-radius: 3px;
</size> </size>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -913,7 +1114,7 @@ border-radius: 3px;
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frameStatusBar">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum"> <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -934,8 +1135,10 @@ color: rgba(255, 255, 255, 70);
QLabel { /* all label types */ QLabel { /* all label types */
/* background-color: rgba(255, 255, 255, 0); */ /* background-color: rgba(255, 255, 255, 0); */
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 255), stop:1 rgba(128, 128, 128, 255)); background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(64, 64, 64, 128), stop:1 rgba(128, 128, 128, 128));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
/*border: 1px solid black;*/
border: none;
} }
QToolTip { QToolTip {
@ -949,22 +1152,31 @@ border-radius: 3px;
</string> </string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Plain</enum>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="margin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="layoutWidgetStatusBar"> <layout class="QHBoxLayout" name="layoutWidgetStatusBar">
<property name="spacing"> <property name="spacing">
<number>3</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>3</number> <number>3</number>
@ -972,6 +1184,62 @@ border-radius: 3px;
<property name="rightMargin"> <property name="rightMargin">
<number>8</number> <number>8</number>
</property> </property>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelUAVPos">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<kerning>true</kerning>
</font>
</property>
<property name="toolTip">
<string>Map position</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="text">
<string>labelUAVPos</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>5</number>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="labelMapPos"> <widget class="QLabel" name="labelMapPos">
<property name="sizePolicy"> <property name="sizePolicy">
@ -982,7 +1250,7 @@ border-radius: 3px;
</property> </property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>9</pointsize> <pointsize>8</pointsize>
<weight>50</weight> <weight>50</weight>
<italic>false</italic> <italic>false</italic>
<bold>false</bold> <bold>false</bold>
@ -1019,7 +1287,7 @@ border-radius: 3px;
</property> </property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>9</pointsize> <pointsize>8</pointsize>
<weight>50</weight> <weight>50</weight>
<italic>false</italic> <italic>false</italic>
<bold>false</bold> <bold>false</bold>
@ -1032,6 +1300,12 @@ border-radius: 3px;
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="text"> <property name="text">
<string>labelMousePos</string> <string>labelMousePos</string>
</property> </property>
@ -1073,7 +1347,7 @@ border-radius: 3px;
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>10</height> <height>12</height>
</size> </size>
</property> </property>
<property name="autoFillBackground"> <property name="autoFillBackground">
@ -1081,7 +1355,7 @@ border-radius: 3px;
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QProgressBar { <string notr="true">QProgressBar {
border: none; border: nonei;
padding: 1px; padding: 1px;
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255)); background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(48, 48, 48, 255), stop:1 rgba(120, 120, 120, 255));
color: rgb(255, 255, 255); color: rgb(255, 255, 255);

View File

@ -47,27 +47,20 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
waypoint_editor = NULL; waypoint_editor = NULL;
wayPoint_treeView_model = NULL; wayPoint_treeView_model = NULL;
findPlaceCompleter = NULL; findPlaceCompleter = NULL;
m_map_graphics_scene = NULL;
// setMouseTracking(true); m_map_scene_proxy = NULL;
m_map_overlay_widget = NULL;
prev_tile_number = 0; prev_tile_number = 0;
// **************
// Get required UAVObjects
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
m_positionActual = PositionActual::GetInstance(objManager);
// ************** // **************
// create the widget that holds the user controls and the map // create the widget that holds the user controls and the map
m_widget = new Ui::OPMap_Widget(); m_widget = new Ui::OPMap_Widget();
// m_widget = new Ui_OPMap_Widget();
m_widget->setupUi(this); m_widget->setupUi(this);
// ************** // **************
// create the map display // create the map widget
m_map = new mapcontrol::OPMapWidget(); m_map = new mapcontrol::OPMapWidget();
@ -76,22 +69,54 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
m_map->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_map->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_map->setMinimumSize(64, 64); m_map->setMinimumSize(64, 64);
m_map->setFrameStyle(QFrame::NoFrame);
m_map->configuration->DragButton = Qt::LeftButton; // use the left mouse button for map dragging m_map->configuration->DragButton = Qt::LeftButton; // use the left mouse button for map dragging
} }
// ************** // **************
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
QVBoxLayout *layout = new QVBoxLayout;
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_map);
// layout->addChildWidget();
m_widget->mapWidget->setLayout(layout);
// **************
// create the user controls overlayed onto the map
/*
m_map_overlay_widget = new OPMap_MapOverlayWidget();
m_map_graphics_scene = m_map->scene();
m_map_scene_proxy = m_map_graphics_scene->addWidget(m_map_overlay_widget);
m_map_overlay_widget->setGeometry(m_map->geometry());
*/
// **************
// Get required UAVObjects
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
m_positionActual = PositionActual::GetInstance(objManager);
// **************
// create various context (mouse right click) menu actions
createActions(); createActions();
// ************** // **************
// set the user control options // set the user control options
// m_widget->labelNumTilesToLoad->setText(" 0"); m_widget->labelUAVPos->setText("---");
m_widget->labelMapPos->setText(""); m_widget->labelMapPos->setText("---");
m_widget->labelMousePos->setText(""); m_widget->labelMousePos->setText("---");
m_widget->progressBarMap->setMaximum(1); m_widget->progressBarMap->setMaximum(1);
m_widget->widgetFlightControls->setVisible(false); m_widget->frameFlightControls->setVisible(false);
m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/prev.png"))); m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/prev.png")));
m_widget->treeViewWaypoints->setVisible(false); m_widget->treeViewWaypoints->setVisible(false);
@ -138,16 +163,6 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
m_map->SetCurrentPosition(internals::PointLatLng(data.Latitude, data.Longitude)); // set the default map position m_map->SetCurrentPosition(internals::PointLatLng(data.Latitude, data.Longitude)); // set the default map position
} }
// **************
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
QVBoxLayout *layout = new QVBoxLayout;
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_map);
m_widget->mapWidget->setLayout(layout);
// ************** // **************
// create the waypoint editor dialog // create the waypoint editor dialog
@ -216,11 +231,6 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
// **************
// create the user controls overlayed onto the map
// createMapOverlayUserControls();
// ************** // **************
// create the desired timers // create the desired timers
@ -242,6 +252,7 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
OPMapGadgetWidget::~OPMapGadgetWidget() OPMapGadgetWidget::~OPMapGadgetWidget()
{ {
if (m_map_overlay_widget) delete m_map_overlay_widget;
if (wayPoint_treeView_model) delete wayPoint_treeView_model; if (wayPoint_treeView_model) delete wayPoint_treeView_model;
if (waypoint_editor) delete waypoint_editor; if (waypoint_editor) delete waypoint_editor;
if (m_map) delete m_map; if (m_map) delete m_map;
@ -411,7 +422,7 @@ void OPMapGadgetWidget::updatePosition()
" " + QString::number(uav_heading, 'f', 1) + "deg" + " " + QString::number(uav_heading, 'f', 1) + "deg" +
" " + QString::number(uav_height_feet, 'f', 1) + "feet" + " " + QString::number(uav_height_feet, 'f', 1) + "feet" +
" " + QString::number(uav_ground_speed, 'f', 1) + "mph"; " " + QString::number(uav_ground_speed, 'f', 1) + "mph";
if (m_widget) m_widget->labelMapPos->setText(str); if (m_widget) m_widget->labelUAVPos->setText(str);
if (m_map && followUAVpositionAct && followUAVheadingAct) if (m_map && followUAVpositionAct && followUAVheadingAct)
{ {
@ -493,7 +504,7 @@ void OPMapGadgetWidget::OnCurrentPositionChanged(internals::PointLatLng point)
if (m_widget) if (m_widget)
{ {
QString coord_str = " " + QString::number(point.Lat(), 'f', 6) + " " + QString::number(point.Lng(), 'f', 6) + " "; QString coord_str = " " + QString::number(point.Lat(), 'f', 6) + " " + QString::number(point.Lng(), 'f', 6) + " ";
// m_widget->labelMapPos->setText(coord_str); m_widget->labelMapPos->setText(coord_str);
} }
} }
@ -575,6 +586,7 @@ void OPMapGadgetWidget::on_comboBoxFindPlace_returnPressed()
void OPMapGadgetWidget::on_toolButtonFindPlace_clicked() void OPMapGadgetWidget::on_toolButtonFindPlace_clicked()
{ {
m_widget->comboBoxFindPlace->setFocus();
on_comboBoxFindPlace_returnPressed(); on_comboBoxFindPlace_returnPressed();
} }
@ -605,9 +617,9 @@ void OPMapGadgetWidget::on_toolButtonFlightControlsShowHide_clicked()
{ {
if (m_widget) if (m_widget)
{ {
m_widget->widgetFlightControls->setVisible(!m_widget->widgetFlightControls->isVisible()); m_widget->frameFlightControls->setVisible(!m_widget->frameFlightControls->isVisible());
if (m_widget->widgetFlightControls->isVisible()) if (m_widget->frameFlightControls->isVisible())
m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/next.png"))); m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/next.png")));
else else
m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/prev.png"))); m_widget->toolButtonFlightControlsShowHide->setIcon(QIcon(QString::fromUtf8(":/core/images/prev.png")));
@ -735,86 +747,6 @@ void OPMapGadgetWidget::setCacheLocation(QString cacheLocation)
m_map->configuration->SetCacheLocation(cacheLocation); m_map->configuration->SetCacheLocation(cacheLocation);
} }
// *************************************************************************************
// create some user controls overlayed onto the map area
QPushButton * OPMapGadgetWidget::createTransparentButton(QWidget *parent, QString text, QString icon)
{
QPixmap pix;
pix.load(icon);
QPushButton *but = new QPushButton(parent);
QColor transparent_color(0,0,0,0);
QPalette but_pal(but->palette());
but_pal.setColor(QPalette::Button, transparent_color);
but->setPalette(but_pal);
but->setIcon(pix);
but->setText(text);
but->setIconSize(pix.size());
return but;
}
void OPMapGadgetWidget::createMapOverlayUserControls()
{
QPushButton *zoomout = new QPushButton("");
zoomout->setToolTip(tr("Zoom out"));
zoomout->setCursor(Qt::OpenHandCursor);
zoomout->setFlat(true);
zoomout->setIcon(QIcon(QString::fromUtf8(":/opmap/images/minus.png")));
zoomout->setIconSize(QSize(32, 32));
zoomout->setFixedSize(28, 28);
connect(zoomout, SIGNAL(clicked(bool)), this, SLOT(zoomOut()));
// QPushButton *zoomin = createTransparentButton(map, "", QString::fromUtf8(":/core/images/plus.png"));
// zoomin->setStyleSheet("");
QPushButton *zoomin = new QPushButton("");
zoomin->setFlat(true);
zoomin->setToolTip(tr("Zoom in"));
zoomin->setCursor(Qt::OpenHandCursor);
zoomin->setIcon(QIcon(QString::fromUtf8(":/opmap/images/plus.png")));
// zoomin->setIconSize(QSize(12, 12));
zoomin->setIconSize(QSize(28, 28));
zoomin->setFixedSize(32, 32);
// zoomin->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
connect(zoomin, SIGNAL(clicked(bool)), this, SLOT(zoomIn()));
// statusLabel.font().setPointSize(20);
// add zoom buttons to the layout of the MapControl
QVBoxLayout* overlay_layout_v1 = new QVBoxLayout;
overlay_layout_v1->setMargin(4);
overlay_layout_v1->setSpacing(4);
QHBoxLayout* overlay_layout_h1 = new QHBoxLayout;
overlay_layout_h1->setMargin(0);
overlay_layout_h1->setSpacing(4);
// overlay_layout_h1->addWidget(gcsButton);
// overlay_layout_h1->addWidget(uavButton);
// overlay_layout_h1->addSpacing(10);
overlay_layout_h1->addWidget(zoomout);
overlay_layout_h1->addWidget(zoomin);
overlay_layout_h1->addStretch(0);
QHBoxLayout* overlay_layout_h2 = new QHBoxLayout;
overlay_layout_h2->setMargin(0);
overlay_layout_h2->setSpacing(4);
overlay_layout_h2->addStretch(0);
// overlay_layout_h2->addWidget(&statusLabel);
overlay_layout_h2->addStretch(0);
overlay_layout_v1->addSpacing(10);
overlay_layout_v1->addLayout(overlay_layout_h1);
overlay_layout_v1->addStretch(0);
// overlay_layout_v1->addLayout(overlay_layout_h2);
overlay_layout_v1->addSpacing(10);
m_map->setLayout(overlay_layout_v1);
}
// ************************************************************************************* // *************************************************************************************
// Context menu stuff // Context menu stuff

View File

@ -38,9 +38,11 @@
#include "uavobjects/uavobjectmanager.h" #include "uavobjects/uavobjectmanager.h"
#include "uavobjects/positionactual.h" #include "uavobjects/positionactual.h"
#include "opmap_mapoverlaywidget.h"
#include "opmap_waypointeditor_dialog.h" #include "opmap_waypointeditor_dialog.h"
namespace Ui { namespace Ui
{
class OPMap_Widget; class OPMap_Widget;
} }
@ -163,9 +165,9 @@ private:
opmap_waypointeditor_dialog *waypoint_editor; opmap_waypointeditor_dialog *waypoint_editor;
QPushButton * createTransparentButton(QWidget *parent, QString text, QString icon); QGraphicsScene *m_map_graphics_scene;
void createMapOverlayUserControls(); QGraphicsProxyWidget *m_map_scene_proxy;
OPMap_MapOverlayWidget *m_map_overlay_widget;
QStandardItemModel *wayPoint_treeView_model; QStandardItemModel *wayPoint_treeView_model;