qdesigner_internal::AlignmentProperty Class Reference

#include <qpropertyeditor_items_p.h>

Inheritance diagram for qdesigner_internal::AlignmentProperty:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 477 of file qpropertyeditor_items_p.h.

Public Member Functions

 AlignmentProperty (const QMap< QString, QVariant > &items, Qt::Alignment value, const QString &name)
QVariant value () const
void setValue (const QVariant &value)


Constructor & Destructor Documentation

AlignmentProperty::AlignmentProperty ( const QMap< QString, QVariant > &  items,
Qt::Alignment  value,
const QString name 
)

Definition at line 1362 of file qpropertyeditor_items.cpp.

References Qt::AlignHorizontal_Mask, Qt::AlignVertical_Mask, QString::fromUtf8(), h, QMap< Key, T >::insert(), qdesigner_internal::AbstractPropertyGroup::m_properties, qdesigner_internal::IProperty::setFake(), qdesigner_internal::IProperty::setParent(), and QMap< Key, T >::value().

01363     : AbstractPropertyGroup(name)
01364 {
01365     QStringList horz_keys = QStringList()
01366         << QString::fromUtf8("Qt::AlignLeft") << QString::fromUtf8("Qt::AlignRight")
01367         << QString::fromUtf8("Qt::AlignHCenter") << QString::fromUtf8("Qt::AlignJustify"); // << "Qt::AlignAbsolute"
01368 
01369     QMap<QString, QVariant> horz_map;
01370     foreach (QString h, horz_keys) {
01371         horz_map.insert(h, items.value(h));
01372     }
01373 
01374     MapProperty *ph = new MapProperty(horz_map, uint(value & Qt::AlignHorizontal_Mask), QLatin1String("horizontal"));
01375     ph->setFake(true);
01376     ph->setParent(this);
01377     m_properties << ph;
01378 
01379 
01380     QStringList vert_keys = QStringList()
01381         << QString::fromUtf8("Qt::AlignTop") << QString::fromUtf8("Qt::AlignBottom") << QString::fromUtf8("Qt::AlignVCenter");
01382 
01383     QMap<QString, QVariant> vert_map;
01384     foreach (QString h, vert_keys) {
01385         vert_map.insert(h, items.value(h));
01386     }
01387 
01388     MapProperty *pv = new MapProperty(vert_map, int(value & Qt::AlignVertical_Mask), QLatin1String("vertical"));
01389     pv->setFake(true);
01390     pv->setParent(this);
01391     m_properties << pv;
01392 }

Here is the call graph for this function:


Member Function Documentation

QVariant AlignmentProperty::value (  )  const [virtual]

Implements qdesigner_internal::IProperty.

Definition at line 1394 of file qpropertyeditor_items.cpp.

References qdesigner_internal::AbstractPropertyGroup::propertyAt().

Referenced by setValue().

01395 {
01396     return uint(propertyAt(0)->value().toUInt() | propertyAt(1)->value().toUInt());
01397 }

Here is the call graph for this function:

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

Implements qdesigner_internal::IProperty.

Definition at line 1399 of file qpropertyeditor_items.cpp.

References Qt::AlignHorizontal_Mask, Qt::AlignVertical_Mask, qdesigner_internal::AbstractPropertyGroup::propertyAt(), qdesigner_internal::IProperty::setValue(), QVariant::toUInt(), and value().

01400 {
01401     QVariant v = value;
01402     if (qVariantCanConvert<FlagType>(value))
01403         v = qvariant_cast<FlagType>(value).value;
01404     else if (qVariantCanConvert<EnumType>(value))
01405         v = qvariant_cast<EnumType>(value).value;
01406     propertyAt(0)->setValue(v.toUInt() & Qt::AlignHorizontal_Mask);
01407     propertyAt(1)->setValue(v.toUInt() & Qt::AlignVertical_Mask);
01408 }

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:10 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1