Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
e880df06
Commit
e880df06
authored
3 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Add action to copy selected instance ID
parent
f5fee209
No related branches found
Branches containing commit
No related tags found
2 merge requests
!171
Periodic merge of armem/dev into master
,
!170
ArMem Viewer: Resolve Memory IDs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/armem_gui/instance/InstanceView.cpp
+16
-5
16 additions, 5 deletions
...ce/RobotAPI/libraries/armem_gui/instance/InstanceView.cpp
source/RobotAPI/libraries/armem_gui/instance/InstanceView.h
+1
-1
1 addition, 1 deletion
source/RobotAPI/libraries/armem_gui/instance/InstanceView.h
with
17 additions
and
6 deletions
source/RobotAPI/libraries/armem_gui/instance/InstanceView.cpp
+
16
−
5
View file @
e880df06
...
...
@@ -222,7 +222,7 @@ namespace armarx::armem::gui::instance
}
aron
::
Path
InstanceView
::
getElementPath
(
QTreeWidgetItem
*
item
)
const
aron
::
Path
InstanceView
::
getElementPath
(
const
QTreeWidgetItem
*
item
)
const
{
QStringList
qpath
=
item
->
data
(
int
(
Columns
::
KEY
),
Qt
::
UserRole
).
toStringList
();
aron
::
Path
path
=
deserializePath
(
qpath
);
...
...
@@ -232,15 +232,26 @@ namespace armarx::armem::gui::instance
void
InstanceView
::
prepareTreeContextMenu
(
const
QPoint
&
pos
)
{
QTreeWidgetItem
*
item
=
tree
->
itemAt
(
pos
);
if
(
item
==
nullptr
||
item
->
parent
()
==
nullptr
)
const
QTreeWidgetItem
*
item
=
tree
->
itemAt
(
pos
);
if
(
item
==
nullptr
)
{
// No item or top level item => no context menu.
return
;
return
;
// No item => no context menu.
}
QMenu
menu
(
this
);
if
(
item
==
this
->
treeItemInstanceID
&&
currentInstance
.
has_value
())
{
if
(
QAction
*
action
=
makeActionCopyMemoryID
(
currentInstance
->
id
()))
{
menu
.
addAction
(
action
);
}
}
else
if
(
item
->
parent
()
==
nullptr
)
{
return
;
// Other top level item => no context menu.
}
// Type descriptor based actions
aron
::
type
::
Descriptor
type
=
static_cast
<
aron
::
type
::
Descriptor
>
(
item
->
data
(
int
(
Columns
::
TYPE
),
Qt
::
UserRole
).
toInt
());
switch
(
type
)
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/armem_gui/instance/InstanceView.h
+
1
−
1
View file @
e880df06
...
...
@@ -68,7 +68,7 @@ namespace armarx::armem::gui::instance
void
showErrorMessage
(
const
std
::
string
&
message
);
aron
::
Path
getElementPath
(
QTreeWidgetItem
*
item
)
const
;
aron
::
Path
getElementPath
(
const
QTreeWidgetItem
*
item
)
const
;
std
::
optional
<
MemoryID
>
getElementMemoryID
(
const
aron
::
Path
&
elementPath
);
QAction
*
makeActionResolveMemoryID
(
const
MemoryID
&
id
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment