lib/widgets/propeditor/pcheckbox.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 "pcheckbox.h"
00020
#include "propertyeditor.h"
00021
00022 PCheckBox::PCheckBox(
const PropertyEditor * editor,
const QString pname,
const QVariant value,
QWidget * parent,
const char * name )
00023 :
QCheckBox(parent, name)
00024 {
00025
setValue(value,
false);
00026 setPName(pname);
00027 connect(
this, SIGNAL(toggled(
bool)),
this, SLOT(
updateProperty(
bool)));
00028 connect(
this, SIGNAL(
propertyChanged(
QString,
QVariant)), editor, SLOT(emitPropertyChange(
QString,
QVariant)));
00029 }
00030
00031 QVariant PCheckBox::value()
const
00032
{
00033
return QVariant(isChecked());
00034 }
00035
00036 void PCheckBox::setValue(
const QVariant value,
bool emitChange)
00037 {
00038 setChecked(value.toBool());
00039
if (emitChange)
00040 emit
propertyChanged(
pname(), value);
00041 }
00042
00043 void PCheckBox::updateProperty(
bool val )
00044 {
00045 emit
propertyChanged(
pname(),
QVariant(val));
00046 }
00047
00048
#include "pcheckbox.moc"
This file is part of the documentation for KDevelop Version 3.0.4.