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
b3694823
Commit
b3694823
authored
1 year ago
by
Peter Albrecht
Browse files
Options
Downloads
Patches
Plain Diff
Added icon finder utility
parent
fd972f3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!406
Refactor skill memory GUI
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/skills_gui/gui_utils.cpp
+26
-0
26 additions, 0 deletions
source/RobotAPI/libraries/skills_gui/gui_utils.cpp
source/RobotAPI/libraries/skills_gui/gui_utils.h
+11
-0
11 additions, 0 deletions
source/RobotAPI/libraries/skills_gui/gui_utils.h
with
37 additions
and
0 deletions
source/RobotAPI/libraries/skills_gui/gui_utils.cpp
+
26
−
0
View file @
b3694823
#include
"gui_utils.h"
#include
<mutex>
#include
<QLayout>
#include
<QLayoutItem>
#include
<QSplitter>
...
...
@@ -7,6 +9,7 @@
#include
<QWidget>
#include
<ArmarXCore/core/exceptions/local/ExpressionException.h>
#include
<ArmarXCore/core/system/ArmarXDataPath.h>
void
armarx
::
gui
::
clearLayout
(
QLayout
*
layout
)
...
...
@@ -107,3 +110,26 @@ armarx::gui::clearSplitter(QSplitter* splitter)
splitter
->
widget
(
i
)
->
deleteLater
();
}
}
QIcon
armarx
::
gui
::
getIcon
(
std
::
string
name
)
{
// is the path already found?
if
(
armarXGuiPath
.
empty
())
{
std
::
scoped_lock
l
(
m_armarXGuiPath
);
armarXGuiPath
=
"ArmarXGui"
;
ArmarXDataPath
::
getAbsolutePath
(
armarXGuiPath
,
armarXGuiPath
);
}
std
::
cout
<<
armarXGuiPath
;
// now we can use the path!
// what in god's good name is "armarx/ArmarXGui/data/ArmarXGui"? And why does the util
// say ArmarXGui is in there???????
// anyways. workaround until I figure out what the hell happens here.
QPixmap
pix
(
QString
::
fromStdString
(
armarXGuiPath
+
"/../../source/ArmarXGui/libraries/ArmarXGuiBase/icons/"
+
name
));
return
QIcon
(
pix
);
}
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/skills_gui/gui_utils.h
+
11
−
0
View file @
b3694823
...
...
@@ -13,6 +13,17 @@
namespace
armarx
::
gui
{
// we only need to fetch the path once => fetch once, use many times
static
std
::
string
armarXGuiPath
=
""
;
static
std
::
mutex
m_armarXGuiPath
;
/**
* @brief Get an icon in ArmarXGuiBase.
* @param name The name of the icon.
* @return The icon.
*/
QIcon
getIcon
(
std
::
string
name
);
/**
* @brief Clear a layout.
*
...
...
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