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
65980cfb
Commit
65980cfb
authored
May 02, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for dock widget titlebars moving around when in advanced mode
parent
ec18ee40
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
14 deletions
+54
-14
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
MainWindow.cc
src/ui/MainWindow.cc
+14
-10
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+1
-1
QGCSettingsWidget.ui
src/ui/QGCSettingsWidget.ui
+1
-1
dockwidgettitlebareventfilter.cpp
src/ui/dockwidgettitlebareventfilter.cpp
+15
-0
dockwidgettitlebareventfilter.h
src/ui/dockwidgettitlebareventfilter.h
+19
-0
No files found.
qgroundcontrol.pro
View file @
65980cfb
...
...
@@ -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 @
65980cfb
...
...
@@ -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"
...
...
@@ -613,6 +613,7 @@ void MainWindow::createDockWidget(QWidget *parent,QWidget *child,QString title,Q
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
title
);
widget
->
setTitleBarWidget
(
label
);
label
->
installEventFilter
(
new
DockWidgetTitleBarEventFilter
());
}
else
{
...
...
@@ -625,6 +626,8 @@ void MainWindow::createDockWidget(QWidget *parent,QWidget *child,QString title,Q
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
title
);
dockToTitleBarMap
[
widget
]
=
label
;
label
->
installEventFilter
(
new
DockWidgetTitleBarEventFilter
());
label
->
hide
();
}
widget
->
setObjectName
(
objectname
);
widget
->
setWidget
(
child
);
...
...
@@ -1007,29 +1010,30 @@ void MainWindow::saveScreen()
}
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
)
{
dockWidgetTitleBarEnabled
=
enabled
;
QSettings
settings
;
settings
.
beginGroup
(
"QGC_MAINWINDOW"
);
settings
.
setValue
(
"DOCK_WIDGET_TITLEBARS"
,
dockWidgetTitleBarEnabled
);
settings
.
endGroup
();
settings
.
sync
();
if
(
enabled
)
{
for
(
QMap
<
QDockWidget
*
,
QWidget
*>::
const_iterator
i
=
dockToTitleBarMap
.
constBegin
();
i
!=
dockToTitleBarMap
.
constEnd
();
i
++
)
{
QLabel
*
label
=
new
QLabel
(
this
);
label
->
setText
(
i
.
value
()
->
windowTitle
());
label
->
setText
(
i
.
key
()
->
windowTitle
());
i
.
key
()
->
setTitleBarWidget
(
label
);
label
->
setEnabled
(
false
);
//label->setEnabled(false);
label
->
installEventFilter
(
new
DockWidgetTitleBarEventFilter
());
}
}
else
{
for
(
QMap
<
QDockWidget
*
,
QWidget
*>::
const_iterator
i
=
dockToTitleBarMap
.
constBegin
();
i
!=
dockToTitleBarMap
.
constEnd
();
i
++
)
{
i
.
key
()
->
setTitleBarWidget
(
0
);
i
.
key
()
->
setTitleBarWidget
(
new
QWidget
(
this
)
);
}
}
}
...
...
src/ui/QGCSettingsWidget.cc
View file @
65980cfb
...
...
@@ -44,7 +44,7 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
//Dock widget title bars
ui
->
titleBarCheckBox
->
setChecked
(
MainWindow
::
instance
()
->
dockWidgetTitleBarsEnabled
());
ui
->
titleBarCheckBox
,
SIGNAL
(
clicked
(
bool
)),
MainWindow
::
instance
(),
SLOT
(
enableDockWidgetTitleBars
(
bool
));
connect
(
ui
->
titleBarCheckBox
,
SIGNAL
(
clicked
(
bool
)),
MainWindow
::
instance
(),
SLOT
(
enableDockWidgetTitleBars
(
bool
)
));
// Style
MainWindow
::
QGC_MAINWINDOW_STYLE
style
=
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)
MainWindow
::
instance
()
->
getStyle
();
...
...
src/ui/QGCSettingsWidget.ui
View file @
65980cfb
...
...
@@ -86,7 +86,7 @@
<string>
Show Docked Widget title bars when NOT in advanced Mode.
</string>
</property>
<property
name=
"checked"
>
<bool>
tru
e
</bool>
<bool>
fals
e
</bool>
</property>
</widget>
</item>
...
...
src/ui/dockwidgettitlebareventfilter.cpp
0 → 100644
View file @
65980cfb
#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 @
65980cfb
#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