Add QWindowSystemInterface::handleFileOpen(const QUrl&)
In some cases, the call to handleFileOpen may receive a non local URL. With previous API, there was no way to pass it to other layers. With this change, any platform plugin creating this event can directly pass a URL. Change-Id: Ibd7299ad6c09527e1db979840bd67726882efb9b Reviewed-by: Jose Dapena Paz <jdapena@igalia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>bb10
parent
bfa1584162
commit
9b90ab9914
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue