new_object_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef RVIZ_NEW_OBJECT_DIALOG_H
31 #define RVIZ_NEW_OBJECT_DIALOG_H
32 
33 #include <QDialog>
34 
35 #include "rviz/factory.h"
36 
37 class QTreeWidget;
38 class QTreeWidgetItem;
39 class QTextBrowser;
40 class QLineEdit;
41 class QDialogButtonBox;
42 class QLabel;
43 
44 namespace rviz
45 {
46 class NewObjectDialog : public QDialog
47 {
48  Q_OBJECT
49 public:
65  NewObjectDialog(Factory* factory,
66  const QString& object_type,
67  const QStringList& disallowed_display_names,
68  const QStringList& disallowed_class_lookup_names,
69  QString* lookup_name_output,
70  QString* display_name_output = nullptr,
71  QWidget* parent = nullptr);
72 
73  QSize sizeHint() const override;
74 
75 public Q_SLOTS:
76  void accept() override;
77 
78 private Q_SLOTS:
79  void onDisplaySelected(QTreeWidgetItem* selected_item);
80  void onNameChanged();
81 
82 private:
84  void fillTree(QTreeWidget* tree);
85 
88  bool isValid();
89 
92  void setError(const QString& error_text);
93 
95  const QStringList& disallowed_display_names_;
96  const QStringList& disallowed_class_lookup_names_;
97 
100 
102  QTextBrowser* description_;
103 
104  QLineEdit* name_editor_;
105 
107  QDialogButtonBox* button_box_;
108 
111  QString lookup_name_;
112 };
113 
114 } // namespace rviz
115 
116 #endif // RVIZ_NEW_OBJECT_DIALOG_H
QSize sizeHint() const override
NewObjectDialog(Factory *factory, const QString &object_type, const QStringList &disallowed_display_names, const QStringList &disallowed_class_lookup_names, QString *lookup_name_output, QString *display_name_output=nullptr, QWidget *parent=nullptr)
void onDisplaySelected(QTreeWidgetItem *selected_item)
const QStringList & disallowed_display_names_
QTextBrowser * description_
void setError(const QString &error_text)
const QStringList & disallowed_class_lookup_names_
tree
Abstract superclass representing the ability to get a list of class IDs and the ability to get name...
Definition: factory.h:42
QDialogButtonBox * button_box_
void fillTree(QTreeWidget *tree)


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sun Jul 3 2022 02:05:32