PlotLegendConfig.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2015 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
20 
21 namespace rqt_multiplot {
22 
23 /*****************************************************************************/
24 /* Constructors and Destructor */
25 /*****************************************************************************/
26 
27 PlotLegendConfig::PlotLegendConfig(QObject* parent, bool visible) :
28  Config(parent),
29  visible_(visible) {
30 }
31 
33 }
34 
35 /*****************************************************************************/
36 /* Accessors */
37 /*****************************************************************************/
38 
39 void PlotLegendConfig::setVisible(bool visible) {
40  if (visible != visible_) {
41  visible_ = visible;
42 
43  emit visibleChanged(visible);
44  emit changed();
45  }
46 }
47 
49  return visible_;
50 }
51 
52 /*****************************************************************************/
53 /* Methods */
54 /*****************************************************************************/
55 
56 void PlotLegendConfig::save(QSettings& settings) const {
57  settings.setValue("visible", visible_);
58 }
59 
60 void PlotLegendConfig::load(QSettings& settings) {
61  setVisible(settings.value("visible", true).toBool());
62 }
63 
65  setVisible(true);
66 }
67 
68 void PlotLegendConfig::write(QDataStream& stream) const {
69  stream << visible_;
70 }
71 
72 void PlotLegendConfig::read(QDataStream& stream) {
73  bool visible;
74 
75  stream >> visible;
76  setVisible(visible);
77 }
78 
79 /*****************************************************************************/
80 /* Operators */
81 /*****************************************************************************/
82 
84  setVisible(src.visible_);
85 
86  return *this;
87 }
88 
89 }
void read(QDataStream &stream)
void write(QDataStream &stream) const
void load(QSettings &settings)
void save(QSettings &settings) const
void visibleChanged(bool visible)
PlotLegendConfig & operator=(const PlotLegendConfig &src)
PlotLegendConfig(QObject *parent=0, bool visible=true)


rqt_multiplot
Author(s): Ralf Kaestner
autogenerated on Wed Jul 10 2019 03:49:44