Mercurial > hg > svgui
diff view/Pane.cpp @ 640:c6d705bf1672
Merge from branch "qt5". This revision actually builds with Qt4 (late releases) or Qt5, though it will warn on configure with Qt4.
author | Chris Cannam |
---|---|
date | Tue, 14 May 2013 12:36:43 +0100 |
parents | d632a1e87018 |
children | 7cb6112c59ca 3437e0fad7ae |
line wrap: on
line diff
--- a/view/Pane.cpp Tue Apr 16 15:17:33 2013 +0100 +++ b/view/Pane.cpp Tue May 14 12:36:43 2013 +0100 @@ -35,6 +35,7 @@ #include <QDropEvent> #include <QCursor> #include <QTextStream> +#include <QMimeData> #include <iostream> #include <cmath> @@ -1507,7 +1508,8 @@ // std::cerr << "mouseMoveEvent" << std::endl; - updateContextHelp(&e->pos()); + QPoint pos = e->pos(); + updateContextHelp(&pos); if (m_navigating && m_clickedInRange && !m_releasing) { @@ -2260,7 +2262,8 @@ << ", possibleActions: " << e->possibleActions() << ", proposedAction: " << e->proposedAction() << std::endl; - if (e->provides("text/uri-list") || e->provides("text/plain")) { + if (e->mimeData()->hasFormat("text/uri-list") || + e->mimeData()->hasFormat("text/plain")) { if (e->proposedAction() & Qt::CopyAction) { e->acceptProposedAction(); @@ -2277,7 +2280,8 @@ std::cerr << "dropEvent: text: \"" << e->mimeData()->text().toStdString() << "\"" << std::endl; - if (e->provides("text/uri-list") || e->provides("text/plain")) { + if (e->mimeData()->hasFormat("text/uri-list") || + e->mimeData()->hasFormat("text/plain")) { if (e->proposedAction() & Qt::CopyAction) { e->acceptProposedAction(); @@ -2286,16 +2290,16 @@ e->accept(); } - if (e->provides("text/uri-list")) { - - SVDEBUG << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << endl; + if (e->mimeData()->hasFormat("text/uri-list")) { + + SVDEBUG << "accepting... data is \"" << e->mimeData()->data("text/uri-list").data() << "\"" << endl; emit dropAccepted(QString::fromLocal8Bit - (e->encodedData("text/uri-list").data()) + (e->mimeData()->data("text/uri-list").data()) .split(QRegExp("[\\r\\n]+"), QString::SkipEmptyParts)); } else { emit dropAccepted(QString::fromLocal8Bit - (e->encodedData("text/plain").data())); + (e->mimeData()->data("text/plain").data())); } } }