From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- examples/iconview/simple_dd/main.h | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 examples/iconview/simple_dd/main.h (limited to 'examples/iconview/simple_dd/main.h') diff --git a/examples/iconview/simple_dd/main.h b/examples/iconview/simple_dd/main.h new file mode 100644 index 0000000..38a4685 --- /dev/null +++ b/examples/iconview/simple_dd/main.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +class QDragEnterEvent; +class QDragDropEvent; + + +class DDListBox : public QListBox +{ + Q_OBJECT +public: + DDListBox( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + // Low-level drag and drop + void dragEnterEvent( QDragEnterEvent *evt ); + void dropEvent( QDropEvent *evt ); + void mousePressEvent( QMouseEvent *evt ); + void mouseMoveEvent( QMouseEvent * ); +private: + int dragging; +}; + + +class DDIconViewItem : public QIconViewItem +{ +public: + DDIconViewItem( QIconView *parent, const QString& text, const QPixmap& icon ) : + QIconViewItem( parent, text, icon ) {} + DDIconViewItem( QIconView *parent, const QString &text ) : + QIconViewItem( parent, text ) {} + // High-level drag and drop + bool acceptDrop( const QMimeSource *mime ) const; + void dropped( QDropEvent *evt, const QValueList& ); +}; + + +class DDIconView : public QIconView +{ + Q_OBJECT +public: + DDIconView( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ) : + QIconView( parent, name, f ) {} + // High-level drag and drop + QDragObject *dragObject(); +public slots: + void slotNewItem( QDropEvent *evt, const QValueList& list ); +}; + -- cgit v1.2.3