~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to demos/books/bookdelegate.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef RATINGDELEGATE_H
 
2
#define RATINGDELEGATE_H
 
3
 
 
4
#include <QModelIndex>
 
5
#include <QPixmap>
 
6
#include <QSize>
 
7
#include <QSqlRelationalDelegate>
 
8
 
 
9
class QPainter;
 
10
 
 
11
class BookDelegate : public QSqlRelationalDelegate
 
12
{
 
13
public:
 
14
    BookDelegate(QObject *parent);
 
15
 
 
16
    void paint(QPainter *painter, const QStyleOptionViewItem &option,
 
17
               const QModelIndex &index) const;
 
18
 
 
19
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
 
20
 
 
21
    bool editorEvent(QEvent *event, QAbstractItemModel *model,
 
22
                     const QStyleOptionViewItem &option,
 
23
                     const QModelIndex &index);
 
24
 
 
25
private:
 
26
    QPixmap star;
 
27
};
 
28
 
 
29
#endif