Gazebo Gui

API Reference

3.12.0
gz/gui/Dialog.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 
18 #ifndef GZ_GUI_DIALOG_HH_
19 #define GZ_GUI_DIALOG_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "gz/gui/qt.h"
25 #include "gz/gui/Export.hh"
26 
27 #ifdef _WIN32
28 // Disable warning C4251 which is triggered by
29 // std::unique_ptr
30 #pragma warning(push)
31 #pragma warning(disable: 4251)
32 #endif
33 
34 namespace ignition
35 {
36  namespace gui
37  {
38  class DialogPrivate;
39 
41  class IGNITION_GUI_VISIBLE Dialog : public QObject
42  {
43  Q_OBJECT
44 
46  public: Dialog();
47 
49  public: virtual ~Dialog();
50 
53  public: QQuickWindow *QuickWindow() const;
54 
57  public: QQuickItem *RootItem() const;
58 
62  public: void SetDefaultConfig(const std::string &_config);
63 
78  public: bool UpdateConfigAttribute(
79  const std::string &_path, const std::string &_attribute,
80  const bool _value) const;
81 
90  public: std::string ReadConfigAttribute(const std::string &_path,
91  const std::string &_attribute) const;
92 
95  private: std::unique_ptr<DialogPrivate> dataPtr;
96  };
97  }
98 }
99 
100 #ifdef _MSC_VER
101 #pragma warning(pop)
102 #endif
103 
104 #endif
STL class.
void SetDefaultConfig(const std::string &_config)
Store dialog default config.
std::string ReadConfigAttribute(const std::string &_path, const std::string &_attribute) const
Gets an attribute value from an XML file. The attribute belongs to a <dialog> element that has a name...
bool UpdateConfigAttribute(const std::string &_path, const std::string &_attribute, const bool _value) const
Update an attribute on an XML file. The attribute belongs to a <dialog> element that has a name attrb...
QQuickItem * RootItem() const
Get the root quick item of this window.
Gui plugin.
Definition: gz/gui/Dialog.hh:41
virtual ~Dialog()
Destructor.
QQuickWindow * QuickWindow() const
Get the QtQuick window created by this object.
Dialog()
Constructor.