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
036c883d
Commit
036c883d
authored
May 13, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tool widget instantiation
parent
d67300d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
MainWindow.cc
src/ui/MainWindow.cc
+14
-6
MainWindow.h
src/ui/MainWindow.h
+1
-1
No files found.
src/ui/MainWindow.cc
View file @
036c883d
...
...
@@ -387,25 +387,31 @@ void MainWindow::buildCustomWidget()
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
();
QDockWidget
*
dock
;
switch
(
view
)
{
case
VIEW_ENGINEER
:
createDockWidget
(
dataView
,
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
dock
=
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
);
dock
=
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
);
dock
=
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
);
dock
=
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
);
dock
=
createDockWidget
(
centerStack
->
currentWidget
(),
tool
,
tool
->
getTitle
(),
tool
->
objectName
(),(
VIEW_SECTIONS
)
view
,
location
);
break
;
}
// XXX temporary "fix"
dock
->
hide
();
//createDockWidget(0,tool,tool->getTitle(),tool->objectName(),view,location);
}
}
...
...
@@ -663,7 +669,7 @@ void MainWindow::addTool(SubMainWindow *parent,VIEW_SECTIONS view,QDockWidget* w
parent
->
addDockWidget
(
area
,
widget
);
}
void
MainWindow
::
createDockWidget
(
QWidget
*
parent
,
QWidget
*
child
,
QString
title
,
QString
objectname
,
VIEW_SECTIONS
view
,
Qt
::
DockWidgetArea
area
,
int
minwidth
,
int
minheight
)
QDockWidget
*
MainWindow
::
createDockWidget
(
QWidget
*
parent
,
QWidget
*
child
,
QString
title
,
QString
objectname
,
VIEW_SECTIONS
view
,
Qt
::
DockWidgetArea
area
,
int
minwidth
,
int
minheight
)
{
//if (child->objectName() == "")
//{
...
...
@@ -702,6 +708,8 @@ void MainWindow::createDockWidget(QWidget *parent,QWidget *child,QString title,Q
widget
->
setMinimumWidth
(
minwidth
);
}
addTool
(
qobject_cast
<
SubMainWindow
*>
(
parent
),
view
,
widget
,
title
,
area
);
return
widget
;
}
void
MainWindow
::
loadDockWidget
(
QString
name
)
{
...
...
src/ui/MainWindow.h
View file @
036c883d
...
...
@@ -297,7 +297,7 @@ protected:
*/
void
addTool
(
SubMainWindow
*
parent
,
VIEW_SECTIONS
view
,
QDockWidget
*
widget
,
const
QString
&
title
,
Qt
::
DockWidgetArea
area
);
void
loadDockWidget
(
QString
name
);
void
createDockWidget
(
QWidget
*
parent
,
QWidget
*
child
,
QString
title
,
QString
objectname
,
VIEW_SECTIONS
view
,
Qt
::
DockWidgetArea
area
,
int
minwidth
=
0
,
int
minheight
=
0
);
QDockWidget
*
createDockWidget
(
QWidget
*
parent
,
QWidget
*
child
,
QString
title
,
QString
objectname
,
VIEW_SECTIONS
view
,
Qt
::
DockWidgetArea
area
,
int
minwidth
=
0
,
int
minheight
=
0
);
/**
* @brief Adds an already instantiated QWidget to the center stack
*
...
...
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