diff options
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 7 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 0de4ba7f4a..c73eeadbfb 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1674,10 +1674,10 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e) { - if (e->fileName.isEmpty()) + if (e->url.isEmpty()) return; - QFileOpenEvent event(e->fileName); + QFileOpenEvent event(e->url); QGuiApplication::sendSpontaneousEvent(qApp, &event); } diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 27bb4bae00..92434d1181 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -575,6 +575,12 @@ void QWindowSystemInterface::handleFileOpenEvent(const QString& fileName) QGuiApplicationPrivate::processWindowSystemEvent(&e); } +void QWindowSystemInterface::handleFileOpenEvent(const QUrl &url) +{ + QWindowSystemInterfacePrivate::FileOpenEvent e(url); + QGuiApplicationPrivate::processWindowSystemEvent(&e); +} + void QWindowSystemInterface::handleTabletEvent(QWindow *w, ulong timestamp, bool down, const QPointF &local, const QPointF &global, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, qint64 uid, diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index 7582f092a3..72bebe19fe 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -158,6 +158,7 @@ public: static void handleThemeChange(QWindow *tlw); static void handleFileOpenEvent(const QString& fileName); + static void handleFileOpenEvent(const QUrl &url); static void handleTabletEvent(QWindow *w, ulong timestamp, bool down, const QPointF &local, const QPointF &global, int device, int pointerType, qreal pressure, int xTilt, int yTilt, diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index 6c12877035..d0b728ec4d 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -285,9 +285,12 @@ public: class FileOpenEvent : public WindowSystemEvent { public: FileOpenEvent(const QString& fileName) - : WindowSystemEvent(FileOpen), fileName(fileName) + : WindowSystemEvent(FileOpen), url(QUrl::fromLocalFile(fileName)) { } - QString fileName; + FileOpenEvent(const QUrl &url) + : WindowSystemEvent(FileOpen), url(url) + { } + QUrl url; }; class TabletEvent : public InputEvent { |