OGS
VtkAlgorithmPropertyLineEdit.cpp
Go to the documentation of this file.
1
15// ** INCLUDES **
17
18#include <QDoubleValidator>
19#include <QIntValidator>
20#include <utility>
21
23
25 const QString& contents,
26 QString name,
27 QVariant::Type type,
28 VtkAlgorithmProperties* algProps,
29 QWidget* parent /*= 0*/)
30 : QLineEdit(contents, parent),
31 _name(std::move(name)),
32 _algProps(algProps),
33 _type(type)
34{
35 switch (_type)
36 {
37 case QVariant::Double:
38 this->setValidator(new QDoubleValidator(this));
39 break;
40
41 case QVariant::Int:
42 this->setValidator(new QIntValidator(this));
43 break;
44
45 default:
46 break;
47 }
48
49 connect(this, SIGNAL(editingFinished()), this, SLOT(setNewValue()));
50}
51
53
55{
56 QVariant value(this->text());
57 if (value.convert(_type))
58 {
60 }
61}
Definition of the VtkAlgorithmProperties class.
Definition of the VtkAlgorithmPropertyLineEdit class.
Contains properties for the visualization of objects as VtkVisPipelineItems.
virtual void SetUserProperty(QString name, QVariant value)
Sets a user property. This should be implemented by subclasses.
void setNewValue()
This slots is automatically called when the text changed.
~VtkAlgorithmPropertyLineEdit() override
VtkAlgorithmPropertyLineEdit(const QString &contents, QString name, QVariant::Type type, VtkAlgorithmProperties *algProps, QWidget *parent=nullptr)
Constructor.