Fix compile with -DQT_NO_DRAGANDDROP
Change-Id: Ic7b42ae164f913f270c8350c2de6ce35f0be8c2a Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
4d178743e4
commit
422b8dd24e
@ -52,12 +52,14 @@ class TorrentView : public QTreeWidget
|
|||||||
public:
|
public:
|
||||||
TorrentView(QWidget *parent = 0);
|
TorrentView(QWidget *parent = 0);
|
||||||
|
|
||||||
|
#ifndef QT_NO_DRAGANDDROP
|
||||||
signals:
|
signals:
|
||||||
void fileDropped(const QString &fileName);
|
void fileDropped(const QString &fileName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void dragMoveEvent(QDragMoveEvent *event);
|
void dragMoveEvent(QDragMoveEvent *event);
|
||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent *event);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// TorrentViewDelegate is used to draw the progress bars.
|
// TorrentViewDelegate is used to draw the progress bars.
|
||||||
@ -688,9 +690,12 @@ void MainWindow::closeEvent(QCloseEvent *)
|
|||||||
TorrentView::TorrentView(QWidget *parent)
|
TorrentView::TorrentView(QWidget *parent)
|
||||||
: QTreeWidget(parent)
|
: QTreeWidget(parent)
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_DRAGANDDROP
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_DRAGANDDROP
|
||||||
void TorrentView::dragMoveEvent(QDragMoveEvent *event)
|
void TorrentView::dragMoveEvent(QDragMoveEvent *event)
|
||||||
{
|
{
|
||||||
// Accept file actions with a '.torrent' extension.
|
// Accept file actions with a '.torrent' extension.
|
||||||
@ -708,5 +713,6 @@ void TorrentView::dropEvent(QDropEvent *event)
|
|||||||
if (QFile::exists(fileName) && fileName.toLower().endsWith(".torrent"))
|
if (QFile::exists(fileName) && fileName.toLower().endsWith(".torrent"))
|
||||||
emit fileDropped(fileName);
|
emit fileDropped(fileName);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mainwindow.moc"
|
#include "mainwindow.moc"
|
||||||
|
@ -20,3 +20,4 @@ SUBDIRS = addressbook \
|
|||||||
stardelegate
|
stardelegate
|
||||||
|
|
||||||
QT += widgets
|
QT += widgets
|
||||||
|
contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= puzzle
|
||||||
|
@ -20,3 +20,4 @@ SUBDIRS = \
|
|||||||
widgets
|
widgets
|
||||||
|
|
||||||
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
|
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
|
||||||
|
contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user