Home · All Classes · Main Classes · Deprecated
Signals | Public Member Functions | Protected Member Functions | Properties | Friends

MWidgetModel Class Reference

MWidgetModel implements a base class for MVC. More...

Inheritance diagram for MWidgetModel:
Inheritance graph
[legend]
Collaboration diagram for MWidgetModel:
Collaboration graph
[legend]

List of all members.

Signals

void modified (const QList< const char * > &members)

Public Member Functions

void beginTransaction ()
void commitTransaction ()
void increaseReferenceCount ()
void decreaseReferenceCount ()

Protected Member Functions

void memberModified (const char *const member)

Properties

QString objectName
QString styleName
MTheme::ViewType viewType
QPointF position
QSizeF size
qreal opacity
M::Position layoutPosition

Friends

M_CORE_EXPORT QDataStreamoperator<< (QDataStream &stream, const MWidgetModel &model)
M_CORE_EXPORT QDataStreamoperator>> (QDataStream &stream, MWidgetModel &model)

Detailed Description

MWidgetModel implements a base class for MVC.

Definition at line 110 of file corelib/widgets/mwidgetmodel.h.


Member Function Documentation

void MWidgetModel::beginTransaction (  ) 

Definition at line 54 of file mwidgetmodel.cpp.

{
    if (d_ptr->transactionInProgress) {
        mWarning("MWidgetModel") << "beginTransaction() - transaction already started!";
        return;
    }

    d_ptr->transactionInProgress = true;
}

void MWidgetModel::commitTransaction (  ) 

Definition at line 64 of file mwidgetmodel.cpp.

{
    if (d_ptr->transactionInProgress == false) {
        mWarning("MWidgetModel") << "commitTransaction() - no transaction ongoing!";
        return;
    }

    d_ptr->transactionInProgress = false;
    emit modified(d_ptr->modifiedMembers);
    d_ptr->modifiedMembers.clear();
}

Here is the call graph for this function:

void MWidgetModel::decreaseReferenceCount (  ) 

Definition at line 81 of file mwidgetmodel.cpp.

{
    --d_ptr->referenceCount;
    if (d_ptr->referenceCount == 0)
        delete this;
}

void MWidgetModel::increaseReferenceCount (  ) 

Definition at line 76 of file mwidgetmodel.cpp.

{
    ++d_ptr->referenceCount;
}

void MWidgetModel::memberModified ( const char *const   member  )  [protected]

Definition at line 43 of file mwidgetmodel.cpp.

{
    if (d_ptr->transactionInProgress) {
        d_ptr->modifiedMembers.enqueue(member);
    } else {
        QList<const char *> list;
        list.append(member);
        emit modified(list);
    }
}

Here is the call graph for this function:

void MWidgetModel::modified ( const QList< const char * > &  members  )  [signal]

Friends And Related Function Documentation

M_CORE_EXPORT QDataStream& operator<< ( QDataStream stream,
const MWidgetModel model 
) [friend]

Definition at line 88 of file mwidgetmodel.cpp.

{
    const QMetaObject *metaObject = model.metaObject();
    QString hashString = metaObject->className();

    int propertyCount = metaObject->propertyCount();
    for (int i = 0; i != propertyCount; ++i) {
        hashString += metaObject->property(i).name();
        hashString += metaObject->property(i).typeName();
    }

    uint hash = qHash(hashString);
    stream << hash;
    for (int i = 0; i != propertyCount; ++i) {
        stream << metaObject->property(i).read(&model);
    }

    return stream;
}

M_CORE_EXPORT QDataStream& operator>> ( QDataStream stream,
MWidgetModel model 
) [friend]

Definition at line 108 of file mwidgetmodel.cpp.

{
    const QMetaObject *metaObject = model.metaObject();
    QString hashString = metaObject->className();

    int propertyCount = metaObject->propertyCount();
    for (int i = 0; i != propertyCount; ++i) {
        hashString += metaObject->property(i).name();
        hashString += metaObject->property(i).typeName();
    }

    uint realHash = qHash(hashString);
    uint hash;
    stream >> hash;
    if (hash != realHash) {
        qFatal("Deserializing of %s failed from QDataStream, Q_PROPERTY table doesn't match!", metaObject->className());
    }

    for (int i = 0; i != propertyCount; ++i) {
        QVariant v;
        stream >> v;
        metaObject->property(i).write(&model, v);
    }

    return stream;
}


Property Documentation

M::Position MWidgetModel::layoutPosition [read, write]

Definition at line 120 of file corelib/widgets/mwidgetmodel.h.

QString MWidgetModel::objectName [read, write]

Definition at line 114 of file corelib/widgets/mwidgetmodel.h.

qreal MWidgetModel::opacity [read, write]

Definition at line 119 of file corelib/widgets/mwidgetmodel.h.

QPointF MWidgetModel::position [read, write]

Reimplemented in MVideoWidgetModel, and MPositionIndicatorModel.

Definition at line 117 of file corelib/widgets/mwidgetmodel.h.

QSizeF MWidgetModel::size [read, write]

Definition at line 118 of file corelib/widgets/mwidgetmodel.h.

QString MWidgetModel::styleName [read, write]

Definition at line 115 of file corelib/widgets/mwidgetmodel.h.

MTheme::ViewType MWidgetModel::viewType [read, write]

Definition at line 116 of file corelib/widgets/mwidgetmodel.h.


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:27 (PDT)
Doxygen 1.7.1
MeeGo Touch