Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

messagedelegate.h Example File
messageviewer/messagedelegate.h

    /****************************************************************************
    **
    ** This file is part of the Qt Extended Opensource Package.
    **
    ** Copyright (C) 2009 Trolltech ASA.
    **
    ** $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


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3