1
/***************************************************************************
2
* Copyright (C) 2002-2004 by Alexander Dymo <cloudtemple@mskat.net> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU Library General Public License as *
6
* published by the Free Software Foundation; either version 2 of the *
7
* License, or (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU Library General Public *
15
* License along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18
***************************************************************************/
23
namespace PropertyLib{
25
Property::Property(int type, const QString &name, const QString &description,
26
const QVariant &value, bool save, bool readOnly):
27
m_type(type), m_name(name), m_description(description), m_value(value), m_save(save),
28
m_readOnly(readOnly), m_visible(true)
32
Property::Property(const QString &name, const QMap<QString, QVariant> &v_valueList,
33
const QString &description, const QVariant &value, bool save, bool readOnly):
34
valueList(v_valueList), m_type(ValueFromList), m_name(name),
35
m_description(description), m_value(value), m_save(save), m_readOnly(readOnly),
44
bool Property::allowSaving() const
49
bool Property::operator<(const Property &prop) const
51
if ((type() < prop.type()) && (name() < prop.name()))
57
QString Property::name() const
62
void Property::setName(const QString &name)
67
int Property::type() const
72
void Property::setType(int type)
77
QVariant Property::value() const
82
void Property::setValue(const QVariant &value, bool rememberOldValue)
91
QString Property::description() const
96
void Property::setDescription(const QString &description)
98
m_description = description;
101
void Property::setValueList(const QMap<QString, QVariant> &v_valueList)
103
valueList = v_valueList;
106
bool Property::readOnly() const
111
bool Property::visible() const
116
void Property::setVisible( const bool visible )
121
QVariant Property::oldValue() const
123
if (m_oldValue.isNull())