1 | /****************************************************************************
|
---|
2 | ** $Id: main.h 160 2006-12-11 20:15:57Z dmik $
|
---|
3 | **
|
---|
4 | ** Copyright (C) 1992-2001 Trolltech AS. All rights reserved.
|
---|
5 | **
|
---|
6 | ** This file is part of an example program for Qt. This example
|
---|
7 | ** program may be used, distributed and modified without limitation.
|
---|
8 | **
|
---|
9 | *****************************************************************************/
|
---|
10 |
|
---|
11 | #include <qapplication.h>
|
---|
12 | #include <qcursor.h>
|
---|
13 | #include <qsplitter.h>
|
---|
14 | #include <qlistbox.h>
|
---|
15 | #include <qiconview.h>
|
---|
16 | #include <qpixmap.h>
|
---|
17 |
|
---|
18 | class QDragEnterEvent;
|
---|
19 | class QDragDropEvent;
|
---|
20 |
|
---|
21 |
|
---|
22 | class DDListBox : public QListBox
|
---|
23 | {
|
---|
24 | Q_OBJECT
|
---|
25 | public:
|
---|
26 | DDListBox( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
|
---|
27 | // Low-level drag and drop
|
---|
28 | void dragEnterEvent( QDragEnterEvent *evt );
|
---|
29 | void dropEvent( QDropEvent *evt );
|
---|
30 | void mousePressEvent( QMouseEvent *evt );
|
---|
31 | void mouseMoveEvent( QMouseEvent * );
|
---|
32 | private:
|
---|
33 | int dragging;
|
---|
34 | };
|
---|
35 |
|
---|
36 |
|
---|
37 | class DDIconViewItem : public QIconViewItem
|
---|
38 | {
|
---|
39 | public:
|
---|
40 | DDIconViewItem( QIconView *parent, const QString& text, const QPixmap& icon ) :
|
---|
41 | QIconViewItem( parent, text, icon ) {}
|
---|
42 | DDIconViewItem( QIconView *parent, const QString &text ) :
|
---|
43 | QIconViewItem( parent, text ) {}
|
---|
44 | // High-level drag and drop
|
---|
45 | bool acceptDrop( const QMimeSource *mime ) const;
|
---|
46 | void dropped( QDropEvent *evt, const QValueList<QIconDragItem>& );
|
---|
47 | };
|
---|
48 |
|
---|
49 |
|
---|
50 | class DDIconView : public QIconView
|
---|
51 | {
|
---|
52 | Q_OBJECT
|
---|
53 | public:
|
---|
54 | DDIconView( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ) :
|
---|
55 | QIconView( parent, name, f ) {}
|
---|
56 | // High-level drag and drop
|
---|
57 | QDragObject *dragObject();
|
---|
58 | public slots:
|
---|
59 | void slotNewItem( QDropEvent *evt, const QValueList<QIconDragItem>& list );
|
---|
60 | };
|
---|
61 |
|
---|