qdesigner_internal::ColorProperty Class Reference

#include <qpropertyeditor_items_p.h>

Inheritance diagram for qdesigner_internal::ColorProperty:

Inheritance graph
[legend]
Collaboration diagram for qdesigner_internal::ColorProperty:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 504 of file qpropertyeditor_items_p.h.

Public Member Functions

 ColorProperty (const QColor &value, const QString &name)
QVariant value () const
void setValue (const QVariant &value)
QVariant decoration () const
QString toString () const


Constructor & Destructor Documentation

ColorProperty::ColorProperty ( const QColor value,
const QString name 
)

Definition at line 672 of file qpropertyeditor_items.cpp.

References b, g, qdesigner_internal::AbstractPropertyGroup::m_properties, qdesigner_internal::IProperty::setFake(), qdesigner_internal::IProperty::setParent(), qdesigner_internal::IntProperty::setRange(), and value().

00673     : AbstractPropertyGroup(name)
00674 {
00675     IntProperty *r = new IntProperty(value.red(), QLatin1String("red"));
00676     r->setFake(true);
00677     r->setRange(0, 255);
00678     r->setParent(this);
00679 
00680     IntProperty *g = new IntProperty(value.green(), QLatin1String("green"));
00681     g->setFake(true);
00682     g->setRange(0, 255);
00683     g->setParent(this);
00684 
00685     IntProperty *b = new IntProperty(value.blue(), QLatin1String("blue"));
00686     b->setFake(true);
00687     b->setRange(0, 255);
00688     b->setParent(this);
00689 
00690     m_properties << r << g << b;
00691 }

Here is the call graph for this function:


Member Function Documentation

QVariant ColorProperty::value (  )  const [virtual]

Implements qdesigner_internal::IProperty.

Definition at line 693 of file qpropertyeditor_items.cpp.

References qdesigner_internal::AbstractPropertyGroup::propertyAt(), and qVariantFromValue().

Referenced by ColorProperty(), decoration(), and setValue().

00694 {
00695     return qVariantFromValue(QColor(propertyAt(0)->value().toInt(),
00696                   propertyAt(1)->value().toInt(),
00697                   propertyAt(2)->value().toInt()));
00698 }

Here is the call graph for this function:

void ColorProperty::setValue ( const QVariant value  )  [virtual]

Implements qdesigner_internal::IProperty.

Definition at line 700 of file qpropertyeditor_items.cpp.

References c, qdesigner_internal::AbstractPropertyGroup::propertyAt(), qdesigner_internal::IProperty::setValue(), and value().

00701 {
00702     QColor c = qvariant_cast<QColor>(value);
00703     propertyAt(0)->setValue(c.red());
00704     propertyAt(1)->setValue(c.green());
00705     propertyAt(2)->setValue(c.blue());
00706 }

Here is the call graph for this function:

QVariant ColorProperty::decoration (  )  const [virtual]

Reimplemented from qdesigner_internal::AbstractPropertyGroup.

Definition at line 708 of file qpropertyeditor_items.cpp.

References QPixmap::fill(), qVariantFromValue(), and value().

00709 {
00710     QPixmap pix(16, 16);
00711     pix.fill(qvariant_cast<QColor>(value()));
00712     return qVariantFromValue(pix);
00713 }

Here is the call graph for this function:

QString qdesigner_internal::ColorProperty::toString (  )  const [inline, virtual]

Reimplemented from qdesigner_internal::AbstractPropertyGroup.

Definition at line 513 of file qpropertyeditor_items_p.h.

References toString().

00513 { return QLatin1String("  ") + AbstractPropertyGroup::toString(); } // ### temp hack remove me!!

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 20:32:23 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1