home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / demo / dnd / listview.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-12  |  879 b   |  36 lines

  1. #include <qlistview.h>
  2.  
  3. class ListViewItem : public QListViewItem
  4. {
  5. public:
  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.  
  14. private:
  15.     QString _tag;
  16. };
  17.  
  18. class ListView : public QListView
  19. {
  20.     Q_OBJECT
  21.  
  22. public:
  23.     ListView( QWidget* parent = 0, const char* name = 0 );
  24.     ~ListView();
  25.  
  26.     void dragEnterEvent( QDragEnterEvent * );
  27.     void dropEvent( QDropEvent * );
  28.     void mousePressEvent( QMouseEvent * );
  29.     void mouseMoveEvent( QMouseEvent * );
  30.     void mouseReleaseEvent( QMouseEvent * );
  31.  
  32. private:
  33.     QPoint pressPos;
  34.     bool dragging;
  35. };
  36.