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
62cdaab2
Commit
62cdaab2
authored
Apr 14, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dock widget no longer supports floating mode
Action passed in in order to make X in title bar close work
parent
be818a66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
QGCDockWidget.cc
src/QGCDockWidget.cc
+12
-4
QGCDockWidget.h
src/QGCDockWidget.h
+5
-1
No files found.
src/QGCDockWidget.cc
View file @
62cdaab2
...
@@ -25,15 +25,23 @@
...
@@ -25,15 +25,23 @@
#include <QCloseEvent>
#include <QCloseEvent>
QGCDockWidget
::
QGCDockWidget
(
const
QString
&
title
,
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QGCDockWidget
::
QGCDockWidget
(
const
QString
&
title
,
QAction
*
action
,
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QDockWidget
(
title
,
parent
,
flags
)
QDockWidget
(
title
,
parent
,
flags
),
_action
(
action
)
{
{
QDockWidget
::
DockWidgetFeatures
features
=
QDockWidget
::
DockWidgetMovable
;
if
(
action
)
{
features
|=
QDockWidget
::
DockWidgetClosable
;
}
setFeatures
(
features
);
}
}
// Instead of destroying the widget just hide it
// Instead of destroying the widget just hide it
void
QGCDockWidget
::
closeEvent
(
QCloseEvent
*
event
)
void
QGCDockWidget
::
closeEvent
(
QCloseEvent
*
event
)
{
{
Q_ASSERT
(
_action
);
event
->
ignore
();
event
->
ignore
();
setVisible
(
false
);
_action
->
trigger
(
);
}
}
src/QGCDockWidget.h
View file @
62cdaab2
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#define QGCDockWidget_h
#define QGCDockWidget_h
#include <QDockWidget>
#include <QDockWidget>
#include <QAction>
/// @file
/// @file
/// @brief Subclass of QDockWidget so we can intercept the closeEvent.
/// @brief Subclass of QDockWidget so we can intercept the closeEvent.
...
@@ -35,9 +36,12 @@ class QGCDockWidget : public QDockWidget {
...
@@ -35,9 +36,12 @@ class QGCDockWidget : public QDockWidget {
Q_OBJECT
Q_OBJECT
public:
public:
QGCDockWidget
(
const
QString
&
title
,
QWidget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
0
);
QGCDockWidget
(
const
QString
&
title
,
Q
Action
*
action
,
Q
Widget
*
parent
=
0
,
Qt
::
WindowFlags
flags
=
0
);
void
closeEvent
(
QCloseEvent
*
event
);
void
closeEvent
(
QCloseEvent
*
event
);
private:
QAction
*
_action
;
};
};
...
...
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