summaryrefslogtreecommitdiffstats
path: root/examples/demo/dnd/dnd.h
blob: 79d4526eb7b4a95e71cc6bee2c0bad9a83a36a6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <qpixmap.h>
#include <qmap.h>
#include "dndbase.h"

#ifndef DNDDEMO_H
#define DNDDEMO_H

class IconItem
{
public:
    IconItem( const QString& name = QString::null, const QString& icon = QString::null );

    QString name() { return _name; }
    QPixmap *pixmap() { return &_pixmap; }

    Q_DUMMY_COMPARISON_OPERATOR( IconItem )

protected:
    QPixmap loadPixmap( const QString& name );

private:
    QString _name;
    QPixmap _pixmap;
};

class DnDDemo : public DnDDemoBase
{
    Q_OBJECT

public:
    DnDDemo( QWidget* parent = 0, const char* name = 0 );
    ~DnDDemo();

    IconItem findItem( const QString& tag );

private:
    QMap<QString,IconItem> items;
};

#endif