Hello community, here is the log from the commit of package kdeclarative for openSUSE:Factory checked in at 2019-08-19 21:04:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdeclarative (Old) and /work/SRC/openSUSE:Factory/.kdeclarative.new.22127 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdeclarative" Mon Aug 19 21:04:04 2019 rev:71 rq:722455 version:5.61.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kdeclarative/kdeclarative.changes 2019-07-26 12:11:51.682837790 +0200 +++ /work/SRC/openSUSE:Factory/.kdeclarative.new.22127/kdeclarative.changes 2019-08-19 21:04:26.556900984 +0200 @@ -1,0 +2,21 @@ +Wed Aug 7 17:51:16 UTC 2019 - Christophe Giboudeaux <[email protected]> + +- Update to 5.61.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.61.0.php +- Changes since 5.60.0: + * Scrollview - Don't fill the parent with the view (kde#407643) + * introduce FallbackTapHandler + * Fix typo - GridView -> ScrollView + * KRun QML proxy: port away from deprecated KRun API + * Docs: fix bad example code + * KRun QML proxy: fix path/URL confusion + * Calendar events: allow plugins to show event details + +------------------------------------------------------------------- +Fri Jul 19 11:39:46 UTC 2019 - Wolfgang Bauer <[email protected]> + +- Don't lower minimum Qt version anymore, it requires 5.11 now + +------------------------------------------------------------------- Old: ---- kdeclarative-5.60.0.tar.xz New: ---- frameworks.keyring kdeclarative-5.61.0.tar.xz kdeclarative-5.61.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdeclarative.spec ++++++ --- /var/tmp/diff_new_pack.oyQJIM/_old 2019-08-19 21:04:27.008900912 +0200 +++ /var/tmp/diff_new_pack.oyQJIM/_new 2019-08-19 21:04:27.012900910 +0200 @@ -17,21 +17,25 @@ %define lname libKF5Declarative5 -%define _tar_path 5.60 +%define _tar_path 5.61 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: kdeclarative -Version: 5.60.0 +Version: 5.61.0 Release: 0 Summary: Integration of QML and KDE workspaces License: LGPL-2.1-or-later Group: System/GUI/KDE URL: https://www.kde.org -Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz -Source1: baselibs.conf +Source: https://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz +%if %{with lang} +Source1: https://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz.sig +Source2: frameworks.keyring +%endif +Source99: baselibs.conf BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes @@ -119,9 +123,6 @@ %prep %setup -q -%if 0%{?suse_version} == 1500 -sed -i -e "s/^set *(REQUIRED_QT_VERSION 5.10.0)$/set(REQUIRED_QT_VERSION 5.9.0)/" CMakeLists.txt -%endif %build %cmake_kf5 -d build ++++++ kdeclarative-5.60.0.tar.xz -> kdeclarative-5.61.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/CMakeLists.txt new/kdeclarative-5.61.0/CMakeLists.txt --- old/kdeclarative-5.60.0/CMakeLists.txt 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/CMakeLists.txt 2019-08-03 21:52:36.000000000 +0200 @@ -1,16 +1,16 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.60.0") # handled by release scripts -set(KF5_DEP_VERSION "5.60.0") # handled by release scripts +set(KF5_VERSION "5.61.0") # handled by release scripts +set(KF5_DEP_VERSION "5.61.0") # handled by release scripts project(KDeclarative VERSION ${KF5_VERSION}) # Dependencies include(FeatureSummary) -find_package(ECM 5.60.0 NO_MODULE) +find_package(ECM 5.61.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH}) set(REQUIRED_QT_VERSION 5.11.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/README.md new/kdeclarative-5.61.0/README.md --- old/kdeclarative-5.60.0/README.md 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/README.md 2019-08-03 21:52:36.000000000 +0200 @@ -15,18 +15,26 @@ ### KDeclarative::KDeclarative -The KDeclarative class is used to manipulate the QQmlEngine instance used by the application and to get some informations about the platform, that influences the behavior of the QML components. - -In order to use it, create an instance of KDeclarative, and as soon as you have a pointer to your QQmlEngine, call setupBindings: +The KDeclarative class is used to manipulate the QQmlEngine instance used by +the application and to get some informations about the platform, +that influences the behavior of the QML components. + +In order to use it, create an instance of KDeclarative. You will need a +pointer to a QQmlEngine, and call **both** `setDeclarativeEngine(engine)` and +`setupContext()` on your instance. You need to call `setupEngine(engine)` +at least once on the engine as well. + KDeclarative::setupEngine(engine); // if not done elsewhere KDeclarative::KDeclarative decl; - decl.setupBindings(engine); - + decl.setDeclarativeEngine(engine); + decl.setupContext(); + This will add the following things to the engine: -* use a KIOAccessManagerFactory instead of the stock QQmlNetworkAccessManagerFactory -* set a new rootContextObject() that exposes all the i18n() functions from the KI18n framework. - they will be available in the global QML context: just call i18n() from anywhere in your QML code. -* Add a QML icon provider, that makes possible for the Image {} element to load stuff from the scheme "image:/" +* Use a KIOAccessManagerFactory instead of the stock QQmlNetworkAccessManagerFactory +* Add a QML icon provider, that makes possible for the Image {} element to load images using the scheme "image:/" +* Use the given engine for this context. +* Set a new rootContextObject() that exposes all the i18n() functions from the KI18n framework. + They will be available in the global QML context: just call i18n() from anywhere in your QML code. ### KDeclarative::QmlObject diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/po/gl/kdeclarative5.po new/kdeclarative-5.61.0/po/gl/kdeclarative5.po --- old/kdeclarative-5.60.0/po/gl/kdeclarative5.po 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/po/gl/kdeclarative5.po 2019-08-03 21:52:36.000000000 +0200 @@ -24,10 +24,6 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Lokalize 18.12.1\n" -"X-Environment: kde, development\n" -"X-Accelerator-Marker: &\n" -"X-Text-Markup: kde4\n" #, kde-format msgctxt "NAME OF TRANSLATORS" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/po/zh_CN/kdeclarative5.po new/kdeclarative-5.61.0/po/zh_CN/kdeclarative5.po --- old/kdeclarative-5.60.0/po/zh_CN/kdeclarative5.po 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/po/zh_CN/kdeclarative5.po 2019-08-03 21:52:36.000000000 +0200 @@ -15,7 +15,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2019-06-15 02:52+0200\n" -"PO-Revision-Date: 2019-06-02 11:52\n" +"PO-Revision-Date: 2019-07-18 14:57\n" "Last-Translator: Guo Yunhe (guoyunhe)\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/calendarevents/calendareventsplugin.cpp new/kdeclarative-5.61.0/src/calendarevents/calendareventsplugin.cpp --- old/kdeclarative-5.60.0/src/calendarevents/calendareventsplugin.cpp 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/calendarevents/calendareventsplugin.cpp 2019-08-03 21:52:36.000000000 +0200 @@ -32,4 +32,6 @@ } +ShowEventInterface::~ShowEventInterface() = default; + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/calendarevents/calendareventsplugin.h new/kdeclarative-5.61.0/src/calendarevents/calendareventsplugin.h --- old/kdeclarative-5.60.0/src/calendarevents/calendareventsplugin.h 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/calendarevents/calendareventsplugin.h 2019-08-03 21:52:36.000000000 +0200 @@ -226,8 +226,33 @@ void eventRemoved(const QString &uid); }; +/** + * Interface for displaying event details + * + * ShowEventInterface is an additional interface the CalendarEventsPlugin + * implementations can implement if they support displaying details about + * events (e.g. opening the event in KOrganizer). + * + * @since 5.61 + */ +class CALENDAREVENTS_EXPORT ShowEventInterface +{ +public: + virtual ~ShowEventInterface(); + + /** + * When this is called, the plugin should show a window displaying the + * full preview of the event. + * + * The plugin should return true if the event details can be displayed, false + * otherwise. + */ + virtual bool showEvent(const QString &uid) = 0; +}; + } Q_DECLARE_INTERFACE(CalendarEvents::CalendarEventsPlugin, "org.kde.CalendarEventsPlugin") +Q_DECLARE_INTERFACE(CalendarEvents::ShowEventInterface, "org.kde.CalendarEventsPlugin.ShowEventInterface") #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kcmcontrols/qml/ScrollView.qml new/kdeclarative-5.61.0/src/qmlcontrols/kcmcontrols/qml/ScrollView.qml --- old/kdeclarative-5.60.0/src/qmlcontrols/kcmcontrols/qml/ScrollView.qml 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kcmcontrols/qml/ScrollView.qml 2019-08-03 21:52:36.000000000 +0200 @@ -47,7 +47,6 @@ contentItem: view onViewChanged: { view.parent = scroll; - view.anchors.fill = view.parent; } activeFocusOnTab: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml new/kdeclarative-5.61.0/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml --- old/kdeclarative-5.60.0/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kcmcontrols/qml/ScrollViewKCM.qml 2019-08-03 21:52:36.000000000 +0200 @@ -26,7 +26,7 @@ /** * This component is intended to be used as the root item for most of the * KControl modules which are based upon a list view or another vertical flickable - * It has a big GridView as its main item, the implementation is free to add extra + * It has a big ScrollView as its main item, the implementation is free to add extra * content in the header or footer properties. * @code * import org.kde.kcm 1.2 as KCM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kioplugin/krunproxy.cpp new/kdeclarative-5.61.0/src/qmlcontrols/kioplugin/krunproxy.cpp --- old/kdeclarative-5.60.0/src/qmlcontrols/kioplugin/krunproxy.cpp 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kioplugin/krunproxy.cpp 2019-08-03 21:52:36.000000000 +0200 @@ -28,26 +28,26 @@ { } -bool KRunProxy::openUrl(const QString &filePath) +bool KRunProxy::openUrl(const QString &file) { + QUrl fileUrl(file); QMimeDatabase db; - QMimeType mime = db.mimeTypeForFile(filePath); - const QString fileMymeType = mime.name(); + QMimeType mime = db.mimeTypeForFile(fileUrl.isLocalFile() ? fileUrl.toLocalFile() : fileUrl.path()); + const QString fileMimeType = mime.name(); - if (fileMymeType == QStringLiteral("application/x-executable") || !mime.isValid()) { + if (fileMimeType == QStringLiteral("application/x-executable") || !mime.isValid()) { //for security reasons we should not be able to execute applications. //We should use its desktop file to access it. return false; } - if (fileMymeType == QStringLiteral("application/x-desktop")) { + if (fileMimeType == QStringLiteral("application/x-desktop") && fileUrl.isLocalFile()) { // If our mimetype is a desktop file, then we don't want to open // the desktop file itself but the application in which it is associated // with. - KService::Ptr service = KService::serviceByDesktopPath(filePath); - return KRun::runService(*service, QList<QUrl>(), nullptr) != 0; + return openService(fileUrl.toLocalFile()); } else { - return KRun::runUrl(QUrl(filePath), fileMymeType, nullptr); + return KRun::runUrl(fileUrl, fileMimeType, nullptr, KRun::RunFlags{}); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kioplugin/krunproxy.h new/kdeclarative-5.61.0/src/qmlcontrols/kioplugin/krunproxy.h --- old/kdeclarative-5.60.0/src/qmlcontrols/kioplugin/krunproxy.h 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kioplugin/krunproxy.h 2019-08-03 21:52:36.000000000 +0200 @@ -32,7 +32,7 @@ /** * opens the url from the existing file */ - Q_INVOKABLE bool openUrl(const QString &filePath); + Q_INVOKABLE bool openUrl(const QString &fileUrl); /** * Runs the service (application) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/CMakeLists.txt new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/CMakeLists.txt --- old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/CMakeLists.txt 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/CMakeLists.txt 2019-08-03 21:52:36.000000000 +0200 @@ -7,6 +7,7 @@ qpixmapitem.cpp qimageitem.cpp qiconitem.cpp + fallbacktaphandler.cpp mouseeventlistener.cpp columnproxymodel.cpp clipboard.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.cpp new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.cpp --- old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.cpp 2019-08-03 21:52:36.000000000 +0200 @@ -0,0 +1,125 @@ +/*************************************************************************** + * Copyright (C) 2019 by Marco Martin <[email protected]> * + * Copyright (C) 2014-2015 by Eike Hein <[email protected]> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +#include "fallbacktaphandler.h" + +#include <QGuiApplication> +#include <QStyleHints> + +FallbackTapHandlerMouseEvent::FallbackTapHandlerMouseEvent(Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, qreal x, qreal y) + : QObject(nullptr), + m_button(button), + m_buttons(buttons), + m_modifiers(modifiers), + m_x(x), + m_y(y) +{} + + + +FallbackTapHandler::FallbackTapHandler(QQuickItem *parent) + : QQuickItem(parent) +{ + setFiltersChildMouseEvents(true); + setAcceptedMouseButtons(Qt::LeftButton); +} + +FallbackTapHandler::~FallbackTapHandler() +{ +} + +void FallbackTapHandler::setAcceptedButtons(Qt::MouseButtons buttons) +{ + setAcceptedMouseButtons(buttons); + emit acceptedButtonsChanged(); +} + +bool FallbackTapHandler::childMouseEventFilter(QQuickItem *item, QEvent *event) +{ + if (event->type() == QEvent::MouseButtonPress && item->inherits("QQuickFlickable")) { + QMouseEvent *me = static_cast<QMouseEvent *>(event); + if (!(me->button() & acceptedMouseButtons()) && !(me->buttons() & acceptedMouseButtons())) { + return QQuickItem::childMouseEventFilter(item, event); + } + m_mouseDownItem = item; + m_mouseDownPos = me->windowPos(); + + QPointF mappedPoint = mapFromItem(item, me->pos()); + FallbackTapHandlerMouseEvent eventProxy(me->button(), me->buttons(), me->modifiers(), mappedPoint.x(), mappedPoint.y()); + emit pressed(&eventProxy); + + } else if (event->type() == QEvent::MouseButtonRelease && item->inherits("QQuickFlickable")) { + QMouseEvent *me = static_cast<QMouseEvent *>(event); + + if ((!(me->button() & acceptedMouseButtons()) && !(me->buttons() & acceptedMouseButtons())) || + m_mouseDownItem != item) { + return QQuickItem::childMouseEventFilter(item, event); + } + + QPointF mappedPoint = mapFromItem(item, me->pos()); + FallbackTapHandlerMouseEvent eventProxy(me->button(), me->buttons(), me->modifiers(), mappedPoint.x(), mappedPoint.y()); + emit released(&eventProxy); + + if (QPointF(m_mouseDownPos - me->windowPos()).manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) { + emit tapped(&eventProxy); + } + + m_mouseDownItem.clear(); + m_mouseDownPos = QPointF(); + } + + return QQuickItem::childMouseEventFilter(item, event); +} + +void FallbackTapHandler::mousePressEvent(QMouseEvent *event) +{ + if ((!(event->button() & acceptedMouseButtons()) && !(event->buttons() & acceptedMouseButtons()))) { + event->ignore(); + return; + } + + event->accept(); + m_mouseDownItem = this; + m_mouseDownPos = event->windowPos(); + + FallbackTapHandlerMouseEvent eventProxy(event->button(), event->buttons(), event->modifiers(), event->x(), event->y()); + emit pressed(&eventProxy); +} + +void FallbackTapHandler::mouseReleaseEvent(QMouseEvent *event) +{ + if ((!(event->button() & acceptedMouseButtons()) && !(event->buttons() & acceptedMouseButtons()))) { + event->ignore(); + return; + } + + FallbackTapHandlerMouseEvent eventProxy(event->button(), event->buttons(), event->modifiers(), event->x(), event->y()); + + if (QPointF(m_mouseDownPos - event->windowPos()).manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) { + emit tapped(&eventProxy); + } + + m_mouseDownItem.clear(); + m_mouseDownPos = QPointF(); + + emit released(&eventProxy); +} + +#include "moc_fallbacktaphandler.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.h new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.h --- old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/fallbacktaphandler.h 2019-08-03 21:52:36.000000000 +0200 @@ -0,0 +1,72 @@ +/************************************************************************** + * Copyright (C) 2019 by Marco Martin <[email protected]> * + * Copyright (C) 2014-2015 by Eike Hein <[email protected]> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +#pragma once + +#include <QPointer> +#include <QQuickItem> + +class FallbackTapHandlerMouseEvent : public QObject { + Q_OBJECT + Q_PROPERTY(Qt::MouseButton button MEMBER m_button) + Q_PROPERTY(Qt::MouseButtons buttons MEMBER m_buttons) + Q_PROPERTY(Qt::KeyboardModifiers modifiers MEMBER m_modifiers) + Q_PROPERTY(qreal x MEMBER m_x) + Q_PROPERTY(qreal y MEMBER m_y) + +public: + FallbackTapHandlerMouseEvent(Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, qreal x, qreal y); + ~FallbackTapHandlerMouseEvent() = default; + +private: + Qt::MouseButton m_button = Qt::NoButton; + Qt::MouseButtons m_buttons = Qt::NoButton; + Qt::KeyboardModifiers m_modifiers = Qt::NoModifier; + qreal m_x = 0; + qreal m_y = 0; +}; + +class FallbackTapHandler : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedMouseButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged) + +public: + explicit FallbackTapHandler(QQuickItem *parent = nullptr); + ~FallbackTapHandler() override; + + void setAcceptedButtons(Qt::MouseButtons buttons); + +Q_SIGNALS: + void pressed(FallbackTapHandlerMouseEvent *event); + void tapped(FallbackTapHandlerMouseEvent *event); + void released(FallbackTapHandlerMouseEvent *event); + void acceptedButtonsChanged(); + +protected: + bool childMouseEventFilter(QQuickItem *item, QEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + +private: + QPointer<QQuickItem> m_mouseDownItem; + QPointF m_mouseDownPos; +}; + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddonsplugin.cpp new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddonsplugin.cpp --- old/kdeclarative-5.60.0/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddonsplugin.cpp 2019-07-07 20:32:06.000000000 +0200 +++ new/kdeclarative-5.61.0/src/qmlcontrols/kquickcontrolsaddons/kquickcontrolsaddonsplugin.cpp 2019-08-03 21:52:36.000000000 +0200 @@ -31,6 +31,7 @@ #include "mouseeventlistener.h" #include "columnproxymodel.h" #include "clipboard.h" +#include "fallbacktaphandler.h" #include "mimedatabase.h" #include "kcmshell.h" #include "icondialog.h" @@ -62,6 +63,8 @@ qmlRegisterSingletonType<KCMShell>(uri, 2, 0, "KCMShell", kcmshell_singleton_provider); qmlRegisterType<IconDialog>(uri, 2, 0, "IconDialog"); qmlRegisterType<EventGenerator>(uri, 2, 0, "EventGenerator"); + qmlRegisterUncreatableType<FallbackTapHandlerMouseEvent>(uri, 2, 1, "FallbackTapHandlerMouseEvent", QStringLiteral("Cannot create items of type FallbackTapHandlerMouseEvent")); + qmlRegisterType<FallbackTapHandler>(uri, 2, 1, "FallbackTapHandler"); #if HAVE_EPOXY qmlRegisterType<PlotData>(uri, 2, 0, "PlotData");
