source: trunk/examples/iconview/simple_dd/main.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: 1.7 KB
Line 
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
18class QDragEnterEvent;
19class QDragDropEvent;
20
21
22class DDListBox : public QListBox
23{
24 Q_OBJECT
25public:
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 * );
32private:
33 int dragging;
34};
35
36
37class DDIconViewItem : public QIconViewItem
38{
39public:
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
50class DDIconView : public QIconView
51{
52 Q_OBJECT
53public:
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();
58public slots:
59 void slotNewItem( QDropEvent *evt, const QValueList<QIconDragItem>& list );
60};
61
Note: See TracBrowser for help on using the repository browser.