RvizFileProperty.hpp
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Robot Operating System code by the University of Osnabrück
5  * Copyright (c) 2021, University of Osnabrück
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above
13  * copyright notice, this list of conditions and the following
14  * disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  *
21  * 3. Neither the name of the copyright holder nor the names of its
22  * contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
30  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
33  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
35  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  *
38  *
39  *
40  * RvizFileProperty.hpp
41  *
42  *
43  * authors:
44  *
45  * Malte kleine Piening <malte@klpiening.de>
46  */
47 
48 #ifndef RVIZ_FILE_PROPERTY_HPP
49 #define RVIZ_FILE_PROPERTY_HPP
50 
51 #include <string>
53 
54 namespace rviz
55 {
56 class FileProperty : public Property
57 {
58  Q_OBJECT
59 public:
60  FileProperty(const QString& name = QString(), const QString& default_value = QString(),
61  const QString& description = QString(), Property* parent = nullptr, const char* changed_slot = nullptr,
62  QObject* receiver = nullptr);
63 
64  std::string getFilename()
65  {
66  return getValue().toString().toStdString();
67  }
68 
69  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem&);
70 
71 public Q_SLOTS:
72  bool setFilename(const QString& str)
73  {
74  return setValue(str);
75  }
76  bool setStdFilename(const std::string& std_str)
77  {
78  return setValue(QString::fromStdString(std_str));
79  }
80 };
81 
82 } // end namespace rviz
83 
84 #endif
rviz::FileProperty::FileProperty
FileProperty(const QString &name=QString(), const QString &default_value=QString(), const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
Definition: RvizFileProperty.cpp:54
description
description
rviz::Property::getValue
virtual QVariant getValue() const
rviz::Property
rviz::FileProperty::getFilename
std::string getFilename()
Definition: RvizFileProperty.hpp:64
rviz::Property::setValue
virtual bool setValue(const QVariant &new_value)
rviz
rviz::FileProperty::setStdFilename
bool setStdFilename(const std::string &std_str)
Definition: RvizFileProperty.hpp:76
rviz::FileProperty
Definition: RvizFileProperty.hpp:56
property.h
rviz::FileProperty::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &)
Definition: RvizFileProperty.cpp:60
default_value
def default_value(type_)
rviz::FileProperty::setFilename
bool setFilename(const QString &str)
Definition: RvizFileProperty.hpp:72


rviz_map_plugin
Author(s): Sebastian Pütz , Kristin Schmidt , Jan Philipp Vogtherr , Malte kleine Piening
autogenerated on Sun Jan 21 2024 04:06:25