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.
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.
if (QFile::exists(fileName) && fileName.toLower().endsWith(".torrent"))
emit fileDropped(fileName);
}
+#endif
#include "mainwindow.moc"