Gazebo Gui
API Reference
7.2.2
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-gui
include
gz
gui
gz/gui/Helpers.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017 Open Source Robotics Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
#ifndef GZ_GUI_HELPERS_HH_
18
#define GZ_GUI_HELPERS_HH_
19
20
#include <string>
21
22
#include "
gz/gui/Enums.hh
"
23
#include "gz/gui/Export.hh"
24
25
namespace
gz::gui
26
{
31
GZ_GUI_VISIBLE
32
std::string
humanReadable
(
const
std::string
&_key);
33
41
GZ_GUI_VISIBLE
42
std::string
unitFromKey
(
const
std::string
&_key,
43
const
std::string
&_type =
""
);
44
50
GZ_GUI_VISIBLE
51
void
rangeFromKey
(
const
std::string
&_key,
double
&_min,
double
&_max);
52
57
GZ_GUI_VISIBLE
58
StringType
stringTypeFromKey
(
const
std::string
&_key);
59
67
GZ_GUI_VISIBLE
68
std::string
uniqueFilePath
(
const
std::string
&_pathAndName,
69
const
std::string
&_extension);
70
77
GZ_GUI_VISIBLE
78
QStringList
worldNames
();
79
87
GZ_GUI_VISIBLE
88
std::string
renderEngineName
();
89
96
GZ_GUI_VISIBLE
97
const
QString
qmlQrcImportPath
();
98
105
template
<
class
T>
106
T
findFirstByProperty
(
const
QList<T>
_list,
const
char
*_key,
107
QVariant
_value)
108
{
109
if
(
nullptr
== _key)
110
return
nullptr
;
111
112
for
(
const
auto
&w : _list)
113
{
114
if
(
nullptr
== w)
115
continue
;
116
117
if
(w->property(_key) == _value)
118
return
w;
119
}
120
return
nullptr
;
121
}
122
}
// namespace gz::gui
123
#endif // GZ_GUI_HELPERS_HH_