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
f6ae5ed8
Commit
f6ae5ed8
authored
Oct 17, 2013
by
John Tapsell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that our custom widget doesn't reuse an object name
parent
a6a5a65b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
17 deletions
+10
-17
MainWindow.cc
src/ui/MainWindow.cc
+10
-2
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+0
-6
menuactionhelper.cpp
src/ui/menuactionhelper.cpp
+0
-9
No files found.
src/ui/MainWindow.cc
View file @
f6ae5ed8
...
...
@@ -860,8 +860,16 @@ void MainWindow::createCustomWidget()
// This is the first widget
ui
.
menuTools
->
addSeparator
();
}
QString
title
=
"Unnamed Tool "
+
QString
::
number
(
ui
.
menuTools
->
actions
().
size
());
QString
objectName
=
"UNNAMED_TOOL_"
+
QString
::
number
(
ui
.
menuTools
->
actions
().
size
())
+
"DOCK"
;
QString
objectName
;
int
customToolIndex
=
0
;
//Find the next unique object name that we can use
do
{
++
customToolIndex
;
objectName
=
QString
(
"CUSTOM_TOOL_%1"
).
arg
(
customToolIndex
)
+
"DOCK"
;
}
while
(
QGCToolWidget
::
instances
()
->
contains
(
objectName
));
QString
title
=
tr
(
"Custom Tool %1"
).
arg
(
customToolIndex
);
QGCToolWidget
*
tool
=
new
QGCToolWidget
(
objectName
,
title
);
createDockWidget
(
centerStack
->
currentWidget
(),
tool
,
title
,
objectName
,
currentView
,
Qt
::
BottomDockWidgetArea
);
...
...
src/ui/designer/QGCToolWidget.cc
View file @
f6ae5ed8
...
...
@@ -27,12 +27,6 @@ QGCToolWidget::QGCToolWidget(const QString& objectName, const QString& title, QW
ui
->
setupUi
(
this
);
if
(
settings
)
loadSettings
(
*
settings
);
if
(
title
==
"Unnamed Tool"
)
{
widgetTitle
=
QString
(
"%1 %2"
).
arg
(
title
).
arg
(
QGCToolWidget
::
instances
()
->
count
());
}
//qDebug() << "WidgetTitle" << widgetTitle;
createActions
();
toolLayout
=
ui
->
toolLayout
;
toolLayout
->
setAlignment
(
Qt
::
AlignTop
);
...
...
src/ui/menuactionhelper.cpp
View file @
f6ae5ed8
...
...
@@ -165,15 +165,6 @@ bool MenuActionHelper::eventFilter(QObject *object,QEvent *event)
if
(
action
)
action
->
setText
(
dock
->
windowTitle
());
//Now modify the object name - it is a strange naming scheme..
/* QString newObjectName = widgetTitle+"DOCK";
dock->setObjectName(newObjectName);
m_menuToDockNameMap[action] = newObjectName;
QMap<MainWindow::VIEW_SECTIONS,QMap<QString,QDockWidget*> >::iterator it;
for (it = m_centralWidgetToDockWidgetsMap.begin(); it != m_centralWidgetToDockWidgetsMap.end(); ++it) {
QMap<QString,QDockWidget*> &map = it.value();
map[newObjectName] = map[oldObjectName];
map.remove(oldObjectName);
}*/
}
}
else
if
(
event
->
type
()
==
QEvent
::
MouseButtonPress
||
event
->
type
()
==
QEvent
::
MouseButtonRelease
)
{
...
...
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