Commit 966b5db5 authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Avoid use of private Qt API by dropping workaround in accessibleWidgetFactory

This condition is not mentioned in documentation or any examples for
QAccessibleInterface, it was apparently copied from qtbase's
qAccessibleFactory. That means it's most likely not necessary in plain
applications, otherwise it would be done by Qt itself.
parent 7a2e9b67
Pipeline #79028 canceled with stage
......@@ -110,8 +110,7 @@ endif()
find_package(KF5Libkleo ${LIBKLEO_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_WANT_VERSION} CONFIG REQUIRED)
find_package(Qt5Widgets ${QT_REQUIRED_VERSION} CONFIG REQUIRED Private)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test Network PrintSupport)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network PrintSupport)
find_package(Assuan2 REQUIRED)
......
......@@ -2,7 +2,6 @@ add_subdirectory(icons)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(SYSTEM ${Qt5Widgets_PRIVATE_INCLUDE_DIRS})
if (NOT DISABLE_KWATCHGNUPG)
add_subdirectory(kwatchgnupg)
......
......@@ -13,8 +13,6 @@
#include "accessiblerichtextlabel_p.h"
#include "view/urllabel.h"
#include "private/qwidget_p.h"
QAccessibleInterface *Kleo::accessibleWidgetFactory(const QString &classname, QObject *object)
{
QAccessibleInterface *iface = nullptr;
......@@ -22,14 +20,6 @@ QAccessibleInterface *Kleo::accessibleWidgetFactory(const QString &classname, QO
return iface;
QWidget *widget = static_cast<QWidget*>(object);
// QWidget emits destroyed() from its destructor instead of letting the QObject
// destructor do it, which means the QWidget is unregistered from the accessibility
// cache. But QWidget destruction also emits enter and leave events, which may end
// up here, so we have to ensure that we don't fill the cache with an entry of
// a widget that is going away.
if (QWidgetPrivate::get(widget)->data.in_destructor)
return iface;
if (classname == QString::fromLatin1(Kleo::UrlLabel::staticMetaObject.className())) {
iface = new AccessibleRichTextLabel{widget};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment