From 422b8dd24ec99caed2a22735f53ffbef110a35ad Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 5 Dec 2012 11:43:14 +0100 Subject: [PATCH] Fix compile with -DQT_NO_DRAGANDDROP Change-Id: Ic7b42ae164f913f270c8350c2de6ce35f0be8c2a Reviewed-by: David Faure --- examples/network/torrent/mainwindow.cpp | 6 ++++++ examples/widgets/itemviews/itemviews.pro | 1 + examples/widgets/widgets.pro | 1 + 3 files changed, 8 insertions(+) diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp index 1b10241f6e..b574429808 100644 --- a/examples/network/torrent/mainwindow.cpp +++ b/examples/network/torrent/mainwindow.cpp @@ -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" diff --git a/examples/widgets/itemviews/itemviews.pro b/examples/widgets/itemviews/itemviews.pro index 60512e2b66..4109e002b6 100644 --- a/examples/widgets/itemviews/itemviews.pro +++ b/examples/widgets/itemviews/itemviews.pro @@ -20,3 +20,4 @@ SUBDIRS = addressbook \ stardelegate QT += widgets +contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index bdac0bde28..87054cff0d 100644 --- a/examples/widgets/widgets.pro +++ b/examples/widgets/widgets.pro @@ -20,3 +20,4 @@ SUBDIRS = \ widgets contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows +contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop