Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
dc46e15d
Commit
dc46e15d
authored
May 03, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mp_merge_new' of
https://github.com/diydrones/qgroundcontrol
into config_improvements
parents
8ba039ec
edcb9fe6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
229 additions
and
35 deletions
+229
-35
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
MainWindow.cc
src/ui/MainWindow.cc
+161
-29
MainWindow.h
src/ui/MainWindow.h
+10
-1
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+4
-0
QGCSettingsWidget.ui
src/ui/QGCSettingsWidget.ui
+13
-3
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+3
-0
dockwidgettitlebareventfilter.cpp
src/ui/dockwidgettitlebareventfilter.cpp
+15
-0
dockwidgettitlebareventfilter.h
src/ui/dockwidgettitlebareventfilter.h
+19
-0
No files found.
qgroundcontrol.pro
View file @
dc46e15d
...
...
@@ -372,7 +372,8 @@ HEADERS += src/MG.h \
src
/
ui
/
QGCHilXPlaneConfiguration
.
h
\
src
/
ui
/
designer
/
QGCComboBox
.
h
\
src
/
ui
/
designer
/
QGCTextLabel
.
h
\
src
/
ui
/
submainwindow
.
h
src
/
ui
/
submainwindow
.
h
\
src
/
ui
/
dockwidgettitlebareventfilter
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
HEADERS
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
...
...
@@ -537,7 +538,8 @@ SOURCES += src/main.cc \
src
/
ui
/
QGCHilXPlaneConfiguration
.
cc
\
src
/
ui
/
designer
/
QGCComboBox
.
cc
\
src
/
ui
/
designer
/
QGCTextLabel
.
cc
\
src
/
ui
/
submainwindow
.
cpp
src
/
ui
/
submainwindow
.
cpp
\
src
/
ui
/
dockwidgettitlebareventfilter
.
cpp
#
Enable
Google
Earth
only
on
Mac
OS
and
Windows
with
Visual
Studio
compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/ui/MainWindow.cc
View file @
dc46e15d
...
...
@@ -38,7 +38,7 @@ This file is part of the QGROUNDCONTROL project
#include <QGCHilLink.h>
#include <QGCHilConfiguration.h>
#include <QGCHilFlightGearConfiguration.h>
#include "dockwidgettitlebareventfilter.h"
#include "QGC.h"
#include "MAVLinkSimulationLink.h"
#include "SerialLink.h"
...
...
@@ -104,6 +104,7 @@ MainWindow::MainWindow(QWidget *parent):
lowPowerMode
(
false
)
{
hide
();
dockWidgetTitleBarEnabled
=
true
;
isAdvancedMode
=
false
;
emit
initStatusChanged
(
"Loading UI Settings.."
);
loadSettings
();
...
...
@@ -358,7 +359,10 @@ void MainWindow::buildCustomWidget()
QDockWidget
*
dock
=
dynamic_cast
<
QDockWidget
*>
(
tool
->
parentWidget
());
if
(
!
dock
)
{
QDockWidget
*
dock
=
new
QDockWidget
(
tool
->
windowTitle
(),
this
);
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAINWINDOW"
);
/*QDockWidget* dock = new QDockWidget(tool->windowTitle(), this);
dock->setObjectName(tool->objectName()+"_DOCK");
dock->setWidget(tool);
connect(tool, SIGNAL(destroyed()), dock, SLOT(deleteLater()));
...
...
@@ -367,13 +371,36 @@ void MainWindow::buildCustomWidget()
connect(showAction, SIGNAL(triggered(bool)), dock, SLOT(setVisible(bool)));
connect(dock, SIGNAL(visibilityChanged(bool)), showAction, SLOT(setChecked(bool)));
widgets.at(i)->setMainMenuAction(showAction);
ui
.
menuTools
->
addAction
(
showAction
);
ui.menuTools->addAction(showAction);
*/
// Load dock widget location (default is bottom)
Qt
::
DockWidgetArea
location
=
static_cast
<
Qt
::
DockWidgetArea
>
(
tool
->
getDockWidgetArea
(
currentView
));
addDockWidget
(
location
,
dock
);
dock
->
hide
();
//addDockWidget(location, dock);
//dock->hide();
int
view
=
settings
.
value
(
QString
(
"TOOL_PARENT_"
)
+
tool
->
objectName
(),
-
1
).
toInt
();
//settings.setValue(QString("TOOL_PARENT_") + "UNNAMED_TOOL_" + QString::number(ui.menuTools->actions().size()),currentView);
settings
.
endGroup
();
switch
(
view
)
{
case
VIEW_ENGINEER
:
createDockWidget
(
dataView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
break
;
case
VIEW_FLIGHT
:
createDockWidget
(
pilotView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
break
;
case
VIEW_SIMULATION
:
createDockWidget
(
simView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
break
;
case
VIEW_MISSION
:
createDockWidget
(
plannerView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
break
;
default:
createDockWidget
(
centerStack
->
currentWidget
(),
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
break
;
}
//createDockWidget(0,tool,tool->getTitle(),tool->objectName(),view,location);
}
}
}
...
...
@@ -603,17 +630,36 @@ void MainWindow::addTool(SubMainWindow *parent,VIEW_SECTIONS view,QDockWidget* w
void
MainWindow
::
createDockWidget
(
QWidget
*
parent
,
QWidget
*
child
,
QString
title
,
QString
objectname
,
VIEW_SECTIONS
view
,
Qt
::
DockWidgetArea
area
,
int
minwidth
,
int
minheight
)
{
if
(
child
->
objectName
()
==
""
)
{
child
->
setObjectName
(
objectname
);
}
QDockWidget
*
widget
=
new
QDockWidget
(
title
,
this
);
if
(
!
isAdvancedMode
)
{
dockToTitleBarMap
[
widget
]
=
widget
->
titleBarWidget
();
widget
->
setTitleBarWidget
(
new
QWidget
(
this
));
if
(
dockWidgetTitleBarEnabled
)
{
dockToTitleBarMap
[
widget
]
=
widget
->
titleBarWidget
();
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
title
);
widget
->
setTitleBarWidget
(
label
);
label
->
installEventFilter
(
new
DockWidgetTitleBarEventFilter
());
}
else
{
dockToTitleBarMap
[
widget
]
=
widget
->
titleBarWidget
();
widget
->
setTitleBarWidget
(
new
QWidget
(
this
));
}
}
else
{
dockToTitleBarMap
[
widget
]
=
new
QWidget
(
this
);
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
title
);
dockToTitleBarMap
[
widget
]
=
label
;
label
->
installEventFilter
(
new
DockWidgetTitleBarEventFilter
());
label
->
hide
();
}
widget
->
setObjectName
(
objectname
);
widget
->
setObjectName
(
child
->
objectName
()
+
"DOCK"
);
widget
->
setWidget
(
child
);
if
(
minheight
!=
0
||
minwidth
!=
0
)
{
...
...
@@ -810,26 +856,35 @@ void MainWindow::connectCommonWidgets()
void
MainWindow
::
createCustomWidget
()
{
QDockWidget
*
dock
=
new
QDockWidget
(
"Unnamed Tool"
,
this
);
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
"Unnamed Tool"
,
dock
);
//void MainWindow::createDockWidget(QWidget *parent,QWidget *child,QString title,QString objectname,VIEW_SECTIONS view,Qt::DockWidgetArea area,int minwidth,int minheight)
//QDockWidget* dock = new QDockWidget("Unnamed Tool", this
);
if
(
QGCToolWidget
::
instances
()
->
size
()
<
2
)
{
// This is the first widget
ui
.
menuTools
->
addSeparator
();
}
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
"Unnamed Tool "
+
QString
::
number
(
ui
.
menuTools
->
actions
().
size
()));
createDockWidget
(
centerStack
->
currentWidget
(),
tool
,
"Unnamed Tool "
+
QString
::
number
(
ui
.
menuTools
->
actions
().
size
()),
"UNNAMED_TOOL_"
+
QString
::
number
(
ui
.
menuTools
->
actions
().
size
()),
currentView
,
Qt
::
BottomDockWidgetArea
);
//tool->setObjectName("UNNAMED_TOOL_" + QString::number(ui.menuTools->actions().size()));
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAINWINDOW"
);
settings
.
setValue
(
QString
(
"TOOL_PARENT_"
)
+
tool
->
objectName
(),
currentView
);
settings
.
endGroup
();
connect
(
tool
,
SIGNAL
(
destroyed
()),
dock
,
SLOT
(
deleteLater
()));
dock
->
setWidget
(
tool
);
QAction
*
showAction
=
new
QAction
(
tool
->
getTitle
(),
this
);
showAction
->
setCheckable
(
true
);
connect
(
dock
,
SIGNAL
(
visibilityChanged
(
bool
)),
showAction
,
SLOT
(
setChecked
(
bool
)));
connect
(
showAction
,
SIGNAL
(
triggered
(
bool
)),
dock
,
SLOT
(
setVisible
(
bool
)));
tool
->
setMainMenuAction
(
showAction
);
ui
.
menuTools
->
addAction
(
showAction
);
this
->
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
dock
);
dock
->
setVisible
(
true
);
//connect(tool, SIGNAL(destroyed()), dock, SLOT(deleteLater()));
//dock->setWidget(tool);
//QAction* showAction = new QAction(tool->getTitle(), this);
//showAction->setCheckable(true);
//connect(dock, SIGNAL(visibilityChanged(bool)), showAction, SLOT(setChecked(bool)));
//connect(showAction, SIGNAL(triggered(bool)), dock, SLOT(setVisible(bool)));
//tool->setMainMenuAction(showAction);
//ui.menuTools->addAction(showAction);
//this->addDockWidget(Qt::BottomDockWidgetArea, dock);
//dock->setVisible(true);
}
void
MainWindow
::
loadCustomWidget
()
...
...
@@ -844,8 +899,35 @@ void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance)
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
""
,
this
);
if
(
tool
->
loadSettings
(
fileName
,
true
)
||
!
singleinstance
)
{
qDebug
()
<<
"Loading custom tool:"
<<
tool
->
getTitle
()
<<
tool
->
objectName
();
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAINWINDOW"
);
//settings.setValue(QString("TOOL_PARENT_") + "UNNAMED_TOOL_" + QString::number(ui.menuTools->actions().size()),currentView);
int
view
=
settings
.
value
(
QString
(
"TOOL_PARENT_"
)
+
tool
->
objectName
(),
-
1
).
toInt
();
switch
(
view
)
{
case
VIEW_ENGINEER
:
createDockWidget
(
dataView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
Qt
::
LeftDockWidgetArea
);
break
;
case
VIEW_FLIGHT
:
createDockWidget
(
pilotView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
Qt
::
LeftDockWidgetArea
);
break
;
case
VIEW_SIMULATION
:
createDockWidget
(
simView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
Qt
::
LeftDockWidgetArea
);
break
;
case
VIEW_MISSION
:
createDockWidget
(
plannerView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
Qt
::
LeftDockWidgetArea
);
break
;
default:
createDockWidget
(
centerStack
->
currentWidget
(),
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
Qt
::
LeftDockWidgetArea
);
break
;
}
settings
.
endGroup
();
// Add widget to UI
QDockWidget
*
dock
=
new
QDockWidget
(
tool
->
getTitle
(),
this
);
/*
QDockWidget* dock = new QDockWidget(tool->getTitle(), this);
connect(tool, SIGNAL(destroyed()), dock, SLOT(deleteLater()));
dock->setWidget(tool);
tool->setParent(dock);
...
...
@@ -857,7 +939,7 @@ void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance)
tool->setMainMenuAction(showAction);
ui.menuTools->addAction(showAction);
this->addDockWidget(Qt::BottomDockWidgetArea, dock);
dock
->
hide
();
dock->hide();
*/
}
else
{
...
...
@@ -903,7 +985,9 @@ void MainWindow::loadSettings()
autoReconnect
=
settings
.
value
(
"AUTO_RECONNECT"
,
autoReconnect
).
toBool
();
currentStyle
=
(
QGC_MAINWINDOW_STYLE
)
settings
.
value
(
"CURRENT_STYLE"
,
currentStyle
).
toInt
();
lowPowerMode
=
settings
.
value
(
"LOW_POWER_MODE"
,
lowPowerMode
).
toBool
();
dockWidgetTitleBarEnabled
=
settings
.
value
(
"DOCK_WIDGET_TITLEBARS"
,
dockWidgetTitleBarEnabled
).
toBool
();
settings
.
endGroup
();
enableDockWidgetTitleBars
(
dockWidgetTitleBarEnabled
);
}
void
MainWindow
::
storeSettings
()
...
...
@@ -990,6 +1074,36 @@ void MainWindow::saveScreen()
window
.
save
(
screenFileName
,
format
.
toAscii
());
}
}
void
MainWindow
::
enableDockWidgetTitleBars
(
bool
enabled
)
{
dockWidgetTitleBarEnabled
=
enabled
;
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAINWINDOW"
);
settings
.
setValue
(
"DOCK_WIDGET_TITLEBARS"
,
dockWidgetTitleBarEnabled
);
settings
.
endGroup
();
settings
.
sync
();
if
(
!
isAdvancedMode
)
{
if
(
enabled
)
{
for
(
QMap
<
QDockWidget
*
,
QWidget
*>::
const_iterator
i
=
dockToTitleBarMap
.
constBegin
();
i
!=
dockToTitleBarMap
.
constEnd
();
i
++
)
{
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
i
.
key
()
->
windowTitle
());
i
.
key
()
->
setTitleBarWidget
(
label
);
//label->setEnabled(false);
label
->
installEventFilter
(
new
DockWidgetTitleBarEventFilter
());
}
}
else
{
for
(
QMap
<
QDockWidget
*
,
QWidget
*>::
const_iterator
i
=
dockToTitleBarMap
.
constBegin
();
i
!=
dockToTitleBarMap
.
constEnd
();
i
++
)
{
i
.
key
()
->
setTitleBarWidget
(
new
QWidget
(
this
));
}
}
}
}
void
MainWindow
::
enableAutoReconnect
(
bool
enabled
)
{
...
...
@@ -1504,14 +1618,32 @@ void MainWindow::UASCreated(UASInterface* uas)
// HIL
showHILConfigurationWidget
(
uas
);
// Line chart
/*if (!linechartWidget)
if
(
!
linechartWidget
)
{
// Center widgets
linechartWidget
=
new
Linecharts
(
this
);
//linechartWidget->hide();
}
// Line chart
//if (!linechartWidget)
//{
// Center widgets
//linechartWidget->addSystem(uas);
linechartWidget
->
addSource
(
mavlinkDecoder
);
addCentralWidget(linechartWidget, tr("Realtime Plot"));
}*/
//addCentralWidget(linechartWidget, tr("Realtime Plot"));
if
(
dataView
->
centralWidget
()
!=
linechartWidget
)
{
dataView
->
setCentralWidget
(
linechartWidget
);
linechartWidget
->
show
();
}
//dataView->setCentralWidget(linechartWidget);
//linechartWidget->show();
//}
// Load default custom widgets for this autopilot type
loadCustomWidgetsFromDefaults
(
uas
->
getSystemTypeName
(),
uas
->
getAutopilotTypeName
());
...
...
@@ -1707,6 +1839,7 @@ void MainWindow::loadViewState()
{
if
(
widgetname
!=
""
)
{
qDebug
()
<<
"Loading widget:"
<<
widgetname
;
loadDockWidget
(
widgetname
);
}
}
...
...
@@ -1745,7 +1878,6 @@ void MainWindow::setAdvancedMode()
QWidget
*
widget
=
i
.
key
()
->
titleBarWidget
();
i
.
key
()
->
setTitleBarWidget
(
i
.
value
());
dockToTitleBarMap
[
i
.
key
()]
=
widget
;
}
}
}
...
...
src/ui/MainWindow.h
View file @
dc46e15d
...
...
@@ -119,6 +119,12 @@ public:
return
autoReconnect
;
}
/** @brief Get title bar mode setting */
bool
dockWidgetTitleBarsEnabled
()
{
return
dockWidgetTitleBarEnabled
;
}
/** @brief Get low power mode setting */
bool
lowPowerModeEnabled
()
{
...
...
@@ -186,6 +192,8 @@ public slots:
void
reloadStylesheet
();
/** @brief Let the user select the CSS style sheet */
void
selectStylesheet
();
/** @breif Enable title bars on dock widgets when no in advanced mode */
void
enableDockWidgetTitleBars
(
bool
enabled
);
/** @brief Automatically reconnect last link */
void
enableAutoReconnect
(
bool
enabled
);
/** @brief Save power by reducing update rates */
...
...
@@ -343,7 +351,7 @@ void createDockWidget(QWidget *parent,QWidget *child,QString title,QString objec
QPointer
<
SubMainWindow
>
simView
;
// Center widgets
//
QPointer<Linecharts> linechartWidget;
QPointer
<
Linecharts
>
linechartWidget
;
//QPointer<HUD> hudWidget;
//QPointer<QGCVehicleConfig> configWidget;
//QPointer<QGCMapTool> mapWidget;
...
...
@@ -436,6 +444,7 @@ private:
QMap
<
QDockWidget
*
,
QWidget
*>
dockToTitleBarMap
;
QMap
<
VIEW_SECTIONS
,
QMap
<
QString
,
QWidget
*>
>
centralWidgetToDockWidgetsMap
;
bool
isAdvancedMode
;
bool
dockWidgetTitleBarEnabled
;
Ui
::
MainWindow
ui
;
QString
getWindowStateKey
();
...
...
src/ui/QGCSettingsWidget.cc
View file @
dc46e15d
...
...
@@ -42,6 +42,10 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
ui
->
lowPowerCheckBox
->
setChecked
(
MainWindow
::
instance
()
->
lowPowerModeEnabled
());
connect
(
ui
->
lowPowerCheckBox
,
SIGNAL
(
clicked
(
bool
)),
MainWindow
::
instance
(),
SLOT
(
enableLowPowerMode
(
bool
)));
//Dock widget title bars
ui
->
titleBarCheckBox
->
setChecked
(
MainWindow
::
instance
()
->
dockWidgetTitleBarsEnabled
());
connect
(
ui
->
titleBarCheckBox
,
SIGNAL
(
clicked
(
bool
)),
MainWindow
::
instance
(),
SLOT
(
enableDockWidgetTitleBars
(
bool
)));
// Style
MainWindow
::
QGC_MAINWINDOW_STYLE
style
=
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)
MainWindow
::
instance
()
->
getStyle
();
switch
(
style
)
{
...
...
src/ui/QGCSettingsWidget.ui
View file @
dc46e15d
...
...
@@ -46,7 +46,7 @@
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"0"
>
<item
row=
"
4
"
column=
"0"
>
<widget
class=
"QRadioButton"
name=
"nativeStyle"
>
<property
name=
"text"
>
<string>
Use native platform look and feel (Windows/Linux/Mac OS)
</string>
...
...
@@ -56,14 +56,14 @@
</property>
</widget>
</item>
<item
row=
"
4
"
column=
"0"
>
<item
row=
"
5
"
column=
"0"
>
<widget
class=
"QRadioButton"
name=
"indoorStyle"
>
<property
name=
"text"
>
<string>
Use indoor mission style (black background)
</string>
</property>
</widget>
</item>
<item
row=
"
5
"
column=
"0"
>
<item
row=
"
6
"
column=
"0"
>
<widget
class=
"QRadioButton"
name=
"outdoorStyle"
>
<property
name=
"text"
>
<string>
Use outdoor mission style (light background)
</string>
...
...
@@ -80,6 +80,16 @@
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"titleBarCheckBox"
>
<property
name=
"text"
>
<string>
Show Docked Widget title bars when NOT in advanced Mode.
</string>
</property>
<property
name=
"checked"
>
<bool>
false
</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
...
...
src/ui/designer/QGCToolWidget.cc
View file @
dc46e15d
...
...
@@ -117,11 +117,13 @@ QList<QGCToolWidget*> QGCToolWidget::createWidgetsFromSettings(QWidget* parent,
{
settings
->
setArrayIndex
(
i
);
QString
name
=
settings
->
value
(
"TITLE"
,
""
).
toString
();
QString
objname
=
settings
->
value
(
"OBJECT_NAME"
,
""
).
toString
();
if
(
!
instances
()
->
contains
(
name
)
&&
name
.
length
()
!=
0
)
{
//qDebug() << "CREATED WIDGET:" << name;
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
name
,
parent
,
settings
);
tool
->
setObjectName
(
objname
);
newWidgets
.
append
(
tool
);
}
else
if
(
name
.
length
()
==
0
)
...
...
@@ -403,6 +405,7 @@ void QGCToolWidget::storeWidgetsToSettings(QString settingsFile)
{
settings
->
setArrayIndex
(
num
++
);
settings
->
setValue
(
"TITLE"
,
instances
()
->
values
().
at
(
i
)
->
getTitle
());
settings
->
setValue
(
"OBJECT_NAME"
,
instances
()
->
values
().
at
(
i
)
->
objectName
());
//qDebug() << "WRITING TITLE" << instances()->values().at(i)->getTitle();
}
}
...
...
src/ui/dockwidgettitlebareventfilter.cpp
0 → 100644
View file @
dc46e15d
#include "dockwidgettitlebareventfilter.h"
#include <QDebug>
#include <QEvent>
DockWidgetTitleBarEventFilter
::
DockWidgetTitleBarEventFilter
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
bool
DockWidgetTitleBarEventFilter
::
eventFilter
(
QObject
*
object
,
QEvent
*
event
)
{
qDebug
()
<<
event
->
type
();
if
(
event
->
type
()
==
QEvent
::
MouseButtonPress
||
event
->
type
()
==
QEvent
::
MouseButtonRelease
)
{
return
true
;
}
return
QObject
::
eventFilter
(
object
,
event
);
}
src/ui/dockwidgettitlebareventfilter.h
0 → 100644
View file @
dc46e15d
#ifndef DOCKWIDGETTITLEBAREVENTFILTER_H
#define DOCKWIDGETTITLEBAREVENTFILTER_H
#include <QObject>
class
DockWidgetTitleBarEventFilter
:
public
QObject
{
Q_OBJECT
public:
explicit
DockWidgetTitleBarEventFilter
(
QObject
*
parent
=
0
);
protected:
bool
eventFilter
(
QObject
*
object
,
QEvent
*
event
);
signals:
public
slots
:
};
#endif // DOCKWIDGETTITLEBAREVENTFILTER_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment