Home · All Classes · Grouped Classes · Annotated · Functions

messagedelegate.h Example File
messageviewer/messagedelegate.h

    /****************************************************************************
    **
    ** This file is part of the Qtopia Phone Edition Package.
    **
    ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
    **
    ** $QT_EXTENDED_DUAL_LICENSE$
    **
    ****************************************************************************/

    #ifndef MESSAGEDELEGATE_H
    #define MESSAGEDELEGATE_H

    #include <QAbstractItemDelegate>
    #include <QSize>

    class QModelIndex;
    class QPainter;
    class QStyleOptionViewItem;

    class MessageDelegate : public QAbstractItemDelegate
    {
        Q_OBJECT

    public:
        explicit MessageDelegate(QObject* parent = 0);
        virtual ~MessageDelegate();

        enum Role
        {
            SubLabelRole = Qt::UserRole,
            SecondaryDecorationRole
        };

        QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
        void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
    };

    #endif // MESSAGEDELEGATE_H


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3