diff options
Diffstat (limited to 'examples/demo/dnd/listview.h')
-rw-r--r-- | examples/demo/dnd/listview.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/demo/dnd/listview.h b/examples/demo/dnd/listview.h new file mode 100644 index 000000000..b6b17a0da --- /dev/null +++ b/examples/demo/dnd/listview.h @@ -0,0 +1,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; +}; |