lib/widgets/propeditor/pspinbox.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#include "pspinbox.h"
00020
#include "propertyeditor.h"
00021
00022 PSpinBox::PSpinBox (
const PropertyEditor *editor,
const QString pname,
const QVariant value,
QWidget * parent,
const char * name ):
00023
QSpinBox(parent, name)
00024 {
00025
setValue(value,
false);
00026 setPName(pname);
00027 connect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(
updateProperty(
int)));
00028 connect(
this, SIGNAL(
propertyChanged(
QString,
QVariant)), editor, SLOT(emitPropertyChange(
QString,
QVariant)));
00029 }
00030
00031 PSpinBox::PSpinBox (
const PropertyEditor *editor,
const QString pname,
const QVariant value,
int minValue,
int maxValue,
int step,
QWidget * parent,
const char * name ):
00032
QSpinBox(minValue, maxValue, step, parent, name)
00033 {
00034 setPName(pname);
00035
setValue(value,
false);
00036 connect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(
updateProperty(
int)));
00037 connect(
this, SIGNAL(
propertyChanged(
QString,
QVariant)), editor, SLOT(emitPropertyChange(
QString,
QVariant)));
00038 }
00039
00040 QVariant PSpinBox::value()
const
00041
{
00042
return QVariant(cleanText().toInt());
00043 }
00044
00045 void PSpinBox::setValue(
const QVariant value,
bool emitChange)
00046 {
00047 QSpinBox::setValue(value.toInt());
00048
if (emitChange)
00049 emit
propertyChanged(
pname(), value);
00050 }
00051
00052 void PSpinBox::updateProperty(
int val)
00053 {
00054 emit
propertyChanged(
pname(),
QVariant(val));
00055 }
00056
00057
#ifndef PURE_QT
00058
#include "pspinbox.moc"
00059
#endif
This file is part of the documentation for KDevelop Version 3.0.4.