source: trunk/examples/demo/dnd/listview.h

Last change on this file was 160, checked in by dmik, 19 years ago

Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.

  • Property svn:keywords set to Id
File size: 938 bytes
Line 
1#include <qlistview.h>
2
3class ListViewItem : public QListViewItem
4{
5public:
6 ListViewItem ( QListView * parent, const QString& name, const QString& tag )
7 : QListViewItem( parent, name ), _tag( tag ) {}
8 ListViewItem ( QListView * parent, QListViewItem * after, const QString& name, const QString& tag )
9 : QListViewItem( parent, after, name ), _tag( tag ) {}
10 virtual ~ListViewItem() {}
11
12 QString tag() { return _tag; }
13
14private:
15 QString _tag;
16};
17
18class ListView : public QListView
19{
20 Q_OBJECT
21
22public:
23 ListView( QWidget* parent = 0, const char* name = 0 );
24 ~ListView();
25
26 void dragEnterEvent( QDragEnterEvent * );
27 void dropEvent( QDropEvent * );
28 void contentsMousePressEvent( QMouseEvent * );
29 void contentsMouseMoveEvent( QMouseEvent * );
30 void contentsMouseReleaseEvent( QMouseEvent * );
31
32private:
33 QPoint pressPos;
34 bool dragging;
35};
Note: See TracBrowser for help on using the repository browser.