diff view/Pane.cpp @ 616:d632a1e87018 qt5

Build fixes for Qt5
author Chris Cannam
date Mon, 11 Mar 2013 14:23:52 +0000
parents 5b72899d692b
children 7cb6112c59ca 3437e0fad7ae
line wrap: on
line diff
--- a/view/Pane.cpp	Fri Nov 16 17:14:12 2012 +0000
+++ b/view/Pane.cpp	Mon Mar 11 14:23:52 2013 +0000
@@ -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()));
         }
     }
 }