summaryrefslogtreecommitdiffstats
path: root/examples/demo/dnd/listview.h
blob: b6b17a0dafe6d64f00c5e802582eaa313ff57682 (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
#include <qlistview.h>

class ListViewItem : public TQListViewItem
{
public:
    ListViewItem ( TQListView * parent, const TQString& name, const TQString& tag )
        : TQListViewItem( parent, name ), _tag( tag ) {}
    ListViewItem ( TQListView * parent, TQListViewItem * after, const TQString& name, const TQString& tag )
        : TQListViewItem( parent, after, name ), _tag( tag ) {}
    virtual ~ListViewItem() {}

    TQString tag() { return _tag; }

private:
    TQString _tag;
};

class ListView : public TQListView
{
    Q_OBJECT

public:
    ListView( TQWidget* parent = 0, const char* name = 0 );
    ~ListView();

    void dragEnterEvent( TQDragEnterEvent * );
    void dropEvent( TQDropEvent * );
    void contentsMousePressEvent( TQMouseEvent * );
    void contentsMouseMoveEvent( TQMouseEvent * );
    void contentsMouseReleaseEvent( TQMouseEvent * );

private:
    TQPoint pressPos;
    bool dragging;
};