Gazebo Gazebo

API Reference

3.15.2
EntityContextMenu.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 
18 #ifndef GZ_GAZEBO_GUI_ENTITYCONTEXTMENU_HH_
19 #define GZ_GAZEBO_GUI_ENTITYCONTEXTMENU_HH_
20 
21 #include <gz/gui/qt.h>
22 #include <QtQml/QQmlExtensionPlugin>
23 #include <memory>
24 
25 namespace ignition
26 {
27 namespace gazebo
28 {
29  class EntityContextMenuPrivate;
30 
33  class IgnGazeboPlugin : public QQmlExtensionPlugin
34  {
35  Q_OBJECT
36 
37  // unique id
38  Q_PLUGIN_METADATA(IID "IgnGazebo/1.0")
39 
40 
41  public: void registerTypes(const char *_uri) override;
43  };
44 
46  class EntityContextMenu : public QQuickItem
47  {
48  Q_OBJECT
49 
51  public: EntityContextMenu();
52 
54  public: ~EntityContextMenu() override;
55 
59  public: Q_INVOKABLE void OnRemove(
60  const QString &_data, const QString &_type);
61 
65  public: Q_INVOKABLE void OnRequest(const QString &_request,
66  const QString &_data);
67 
71  };
72 }
73 }
74 
75 #endif
This library is part of the Ignition Robotics project.
~EntityContextMenu() override
Destructor.
A context menu providing actions that can be invoked on an entity.
Definition: EntityContextMenu.hh:46
IgnGazebo QML Plugin that registers C++ class so that they are accessible from QML.
Definition: EntityContextMenu.hh:33
Q_INVOKABLE void OnRemove(const QString &_data, const QString &_type)
Callback when a context menu item is invoked.
Q_INVOKABLE void OnRequest(const QString &_request, const QString &_data)
Callback when a context menu item is invoked.