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
ca68c1e9
Commit
ca68c1e9
authored
Oct 13, 2013
by
John Tapsell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow user to add a label to a custom widget
parent
9143c8c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+12
-0
QGCToolWidget.h
src/ui/designer/QGCToolWidget.h
+2
-0
No files found.
src/ui/designer/QGCToolWidget.cc
View file @
ca68c1e9
...
...
@@ -518,6 +518,10 @@ void QGCToolWidget::createActions()
addCommandAction
->
setStatusTip
(
tr
(
"Add a new action button to the tool"
));
connect
(
addCommandAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addCommand
()));
addLabelAction
=
new
QAction
(
tr
(
"New &Text Label"
),
this
);
addLabelAction
->
setStatusTip
(
tr
(
"Add a new label to the tool"
));
connect
(
addLabelAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addLabel
()));
setTitleAction
=
new
QAction
(
tr
(
"Set Widget Title"
),
this
);
setTitleAction
->
setStatusTip
(
tr
(
"Set the title caption of this tool widget"
));
connect
(
setTitleAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
setTitle
()));
...
...
@@ -591,6 +595,14 @@ void QGCToolWidget::addCommand()
button
->
startEditMode
();
}
void
QGCToolWidget
::
addLabel
()
{
QGCTextLabel
*
label
=
new
QGCTextLabel
(
this
);
connect
(
label
,
SIGNAL
(
destroyed
()),
this
,
SLOT
(
storeSettings
()));
toolLayout
->
addWidget
(
label
);
label
->
startEditMode
();
}
void
QGCToolWidget
::
addToolWidget
(
QGCToolWidgetItem
*
widget
)
{
if
(
ui
->
hintLabel
)
...
...
src/ui/designer/QGCToolWidget.h
View file @
ca68c1e9
...
...
@@ -74,6 +74,7 @@ protected:
QVariantMap
settingsMap
;
QAction
*
addParamAction
;
QAction
*
addCommandAction
;
QAction
*
addLabelAction
;
QAction
*
setTitleAction
;
QAction
*
deleteAction
;
QAction
*
exportAction
;
...
...
@@ -99,6 +100,7 @@ public slots:
protected
slots
:
void
addParam
();
void
addCommand
();
void
addLabel
();
void
setTitle
();
void
setWindowTitle
(
const
QString
&
title
);
...
...
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