PlotAxisConfigWidget.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 
19 #include <ui_PlotAxisConfigWidget.h>
20 
22 
23 namespace rqt_multiplot {
24 
25 /*****************************************************************************/
26 /* Constructors and Destructor */
27 /*****************************************************************************/
28 
30  QWidget(parent),
31  ui_(new Ui::PlotAxisConfigWidget()),
32  config_(0) {
33  ui_->setupUi(this);
34 
35  connect(ui_->lineEditTitle, SIGNAL(editingFinished()),
36  this, SLOT(lineEditTitleEditingFinished()));
37  connect(ui_->checkBoxTitleAuto, SIGNAL(stateChanged(int)),
38  this, SLOT(checkBoxTitleAutoStateChanged(int)));
39  connect(ui_->checkBoxTitleVisible, SIGNAL(stateChanged(int)),
40  this, SLOT(checkBoxTitleVisibleStateChanged(int)));
41 }
42 
44  delete ui_;
45 }
46 
47 /*****************************************************************************/
48 /* Accessors */
49 /*****************************************************************************/
50 
52  if (config != config_) {
53  if (config_) {
54  disconnect(config_, SIGNAL(titleTypeChanged(int)),
55  this, SLOT(configTitleTypeChanged(int)));
56  disconnect(config_, SIGNAL(customTitleChanged(const QString&)),
57  this, SLOT(configCustomTitleChanged(const QString&)));
58  disconnect(config_, SIGNAL(titleVisibleChanged(bool)),
59  this, SLOT(configTitleVisibleChanged(bool)));
60  }
61 
62  config_ = config;
63 
64  if (config) {
65  connect(config, SIGNAL(titleTypeChanged(int)),
66  this, SLOT(configTitleTypeChanged(int)));
67  connect(config, SIGNAL(customTitleChanged(const QString&)),
68  this, SLOT(configCustomTitleChanged(const QString&)));
69  connect(config, SIGNAL(titleVisibleChanged(bool)),
70  this, SLOT(configTitleVisibleChanged(bool)));
71 
75  }
76  }
77 }
78 
80  return config_;
81 }
82 
83 /*****************************************************************************/
84 /* Slots */
85 /*****************************************************************************/
86 
88  ui_->checkBoxTitleAuto->setCheckState((type == PlotAxisConfig::AutoTitle) ?
89  Qt::Checked : Qt::Unchecked);
90 }
91 
93  ui_->lineEditTitle->setText(title);
94 }
95 
97  ui_->checkBoxTitleVisible->setCheckState(visible ? Qt::Checked :
98  Qt::Unchecked);
99 }
100 
102  ui_->lineEditTitle->setEnabled(state != Qt::Checked);
103 
104  if (config_)
105  config_->setTitleType((state == Qt::Checked) ? PlotAxisConfig::AutoTitle :
107 }
108 
110  if (config_)
111  config_->setCustomTitle(ui_->lineEditTitle->text());
112 }
113 
115  if (config_)
116  config_->setTitleVisible(state == Qt::Checked);
117 }
118 
119 }
const QString & getCustomTitle() const
void setCustomTitle(const QString &title)
void setConfig(PlotAxisConfig *range)
TitleType getTitleType() const
void setTitleType(TitleType type)
void setTitleVisible(bool visible)
void configCustomTitleChanged(const QString &title)


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