Fix compile with -DQT_NO_DRAGANDDROP
authorMontel Laurent <laurent.montel@kdab.com>
Wed, 5 Dec 2012 10:43:14 +0000 (11:43 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 5 Dec 2012 12:27:27 +0000 (13:27 +0100)
Change-Id: Ic7b42ae164f913f270c8350c2de6ce35f0be8c2a
Reviewed-by: David Faure <david.faure@kdab.com>
examples/network/torrent/mainwindow.cpp
examples/widgets/itemviews/itemviews.pro
examples/widgets/widgets.pro

index 1b10241..b574429 100644 (file)
@@ -52,12 +52,14 @@ class TorrentView : public QTreeWidget
 public:
     TorrentView(QWidget *parent = 0);
 
+#ifndef QT_NO_DRAGANDDROP
 signals:
     void fileDropped(const QString &fileName);
 
 protected:
     void dragMoveEvent(QDragMoveEvent *event);
     void dropEvent(QDropEvent *event);
+#endif
 };
 
 // TorrentViewDelegate is used to draw the progress bars.
@@ -688,9 +690,12 @@ void MainWindow::closeEvent(QCloseEvent *)
 TorrentView::TorrentView(QWidget *parent)
     : QTreeWidget(parent)
 {
+#ifndef QT_NO_DRAGANDDROP
     setAcceptDrops(true);
+#endif
 }
 
+#ifndef QT_NO_DRAGANDDROP
 void TorrentView::dragMoveEvent(QDragMoveEvent *event)
 {
     // Accept file actions with a '.torrent' extension.
@@ -708,5 +713,6 @@ void TorrentView::dropEvent(QDropEvent *event)
     if (QFile::exists(fileName) && fileName.toLower().endsWith(".torrent"))
         emit fileDropped(fileName);
 }
+#endif
 
 #include "mainwindow.moc"
index 60512e2..4109e00 100644 (file)
@@ -20,3 +20,4 @@ SUBDIRS       = addressbook \
                 stardelegate
 
 QT += widgets
+contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle
index bdac0bd..87054cf 100644 (file)
@@ -20,3 +20,4 @@ SUBDIRS       = \
                 widgets
 
 contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
+contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop