7#include "variableitem.h"
8#include "variableeditor.h"
11VariableItem::VariableItem(
const QString &variable)
12 : m_variable(variable)
17QString VariableItem::variable()
const
22QString VariableItem::helpText()
const
27void VariableItem::setHelpText(
const QString &text)
32bool VariableItem::isActive()
const
37void VariableItem::setActive(
bool active)
44VariableIntItem::VariableIntItem(
const QString &variable,
int value)
45 : VariableItem(variable)
52int VariableIntItem::value()
const
57void VariableIntItem::setValue(
int newValue)
62void VariableIntItem::setValueByString(
const QString &value)
64 setValue(value.
toInt());
67QString VariableIntItem::valueAsString()
const
72VariableEditor *VariableIntItem::createEditor(
QWidget *parent)
74 return new VariableIntEditor(
this, parent);
77void VariableIntItem::setRange(
int minValue,
int maxValue)
79 m_minValue = minValue;
80 m_maxValue = maxValue;
83int VariableIntItem::minValue()
const
88int VariableIntItem::maxValue()
const
96 : VariableItem(variable)
102QStringList VariableStringListItem::stringList()
const
107QString VariableStringListItem::value()
const
112void VariableStringListItem::setValue(
const QString &newValue)
117void VariableStringListItem::setValueByString(
const QString &value)
122QString VariableStringListItem::valueAsString()
const
127VariableEditor *VariableStringListItem::createEditor(
QWidget *parent)
129 return new VariableStringListEditor(
this, parent);
134VariableBoolItem::VariableBoolItem(
const QString &variable,
bool value)
135 : VariableItem(variable)
140bool VariableBoolItem::value()
const
145void VariableBoolItem::setValue(
bool enabled)
150void VariableBoolItem::setValueByString(
const QString &value)
157QString VariableBoolItem::valueAsString()
const
159 return value() ? QStringLiteral(
"true") : QStringLiteral(
"false");
162VariableEditor *VariableBoolItem::createEditor(
QWidget *parent)
164 return new VariableBoolEditor(
this, parent);
169VariableColorItem::VariableColorItem(
const QString &variable,
const QColor &value)
170 : VariableItem(variable)
175QColor VariableColorItem::value()
const
180void VariableColorItem::setValue(
const QColor &value)
185void VariableColorItem::setValueByString(
const QString &value)
190QString VariableColorItem::valueAsString()
const
192 return value().name();
195VariableEditor *VariableColorItem::createEditor(
QWidget *parent)
197 return new VariableColorEditor(
this, parent);
202VariableFontItem::VariableFontItem(
const QString &variable,
const QFont &value)
203 : VariableItem(variable)
208QFont VariableFontItem::value()
const
213void VariableFontItem::setValue(
const QFont &value)
218void VariableFontItem::setValueByString(
const QString &value)
220 setValue(
QFont(value));
223QString VariableFontItem::valueAsString()
const
225 return value().family();
228VariableEditor *VariableFontItem::createEditor(
QWidget *parent)
230 return new VariableFontEditor(
this, parent);
235VariableStringItem::VariableStringItem(
const QString &variable,
const QString &value)
236 : VariableItem(variable)
241void VariableStringItem::setValue(
const QString &value)
246void VariableStringItem::setValueByString(
const QString &value)
251QString VariableStringItem::value()
const
256QString VariableStringItem::valueAsString()
const
261VariableEditor *VariableStringItem::createEditor(
QWidget *parent)
263 return new VariableStringEditor(
this, parent);
268VariableSpellCheckItem::VariableSpellCheckItem(
const QString &variable,
const QString &value)
269 : VariableItem(variable)
274QString VariableSpellCheckItem::value()
const
279void VariableSpellCheckItem::setValue(
const QString &value)
284QString VariableSpellCheckItem::valueAsString()
const
289void VariableSpellCheckItem::setValueByString(
const QString &value)
294VariableEditor *VariableSpellCheckItem::createEditor(
QWidget *parent)
296 return new VariableSpellCheckEditor(
this, parent);
301VariableRemoveSpacesItem::VariableRemoveSpacesItem(
const QString &variable,
int value)
302 : VariableItem(variable)
307int VariableRemoveSpacesItem::value()
const
312void VariableRemoveSpacesItem::setValue(
int value)
317QString VariableRemoveSpacesItem::valueAsString()
const
320 return QStringLiteral(
"all");
321 }
else if (m_value == 1) {
322 return QStringLiteral(
"modified");
324 return QStringLiteral(
"none");
328void VariableRemoveSpacesItem::setValueByString(
const QString &value)
341VariableEditor *VariableRemoveSpacesItem::createEditor(
QWidget *parent)
343 return new VariableRemoveSpacesEditor(
this, parent);
QString number(double n, char format, int precision)
int toInt(bool *ok, int base) const const
QString toLower() const const
QString trimmed() const const