summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-09 11:58:41 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-06-10 08:21:36 +0000
commitbe4c684be7c2fa91f7df3d7cccfb6999aecfc967 (patch)
treed847a3d11e3c4769772b1d4bbb3ed9979866a293 /src/webenginewidgets/api
parent5d1ef38f9f6815807596d0606cf7ed06b7930aac (diff)
Switch from QT_NO macros to feature checks
This is safer by ensuring we are checking for a feature that is defined. For some reason, the openssl feature is a private feature, so we need to include the private header to access it. Pick-to: 6.4 Change-Id: Idf7f3baba33e5188f206f5be1b8a0bfd75e79d03 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r--src/webenginewidgets/api/qwebenginenotificationpresenter.cpp6
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp12
-rw-r--r--src/webenginewidgets/api/qwebengineview.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp b/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
index 9a2ba7dee..6a4a74ea8 100644
--- a/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
+++ b/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
DefaultNotificationPresenter::DefaultNotificationPresenter(QObject *parent) : QObject(parent)
{
-#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(systemtrayicon)
m_systemTrayIcon = new QSystemTrayIcon(this);
connect(m_systemTrayIcon, &QSystemTrayIcon::messageClicked, this, &DefaultNotificationPresenter::messageClicked);
#endif
@@ -66,7 +66,7 @@ void DefaultNotificationPresenter::show(std::unique_ptr<QWebEngineNotification>
m_activeNotification = std::move(notification);
-#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(systemtrayicon)
if (m_activeNotification && m_systemTrayIcon) {
m_systemTrayIcon->setIcon(qApp->windowIcon());
m_systemTrayIcon->show();
@@ -90,7 +90,7 @@ void DefaultNotificationPresenter::messageClicked()
void DefaultNotificationPresenter::closeNotification()
{
-#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(systemtrayicon)
const QWebEngineNotification *canceled = static_cast<const QWebEngineNotification *>(QObject::sender());
if (m_systemTrayIcon && canceled->matches(m_activeNotification.get()))
m_systemTrayIcon->hide();
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index b3bba7d9e..cf8af53e3 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -305,7 +305,7 @@ bool WebEngineQuickWidget::event(QEvent *event)
case QEvent::ContextMenu:
case QEvent::KeyPress:
case QEvent::KeyRelease:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
return false;
@@ -629,14 +629,14 @@ bool QWebEngineViewPrivate::passOnFocus(bool reverse)
return q->focusNextPrevChild(!reverse);
}
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *object)
{
if (QWebEngineView *v = qobject_cast<QWebEngineView*>(object))
return new QWebEngineViewAccessible(v);
return nullptr;
}
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QWebEngineViewPrivate::QWebEngineViewPrivate()
: page(0)
@@ -644,9 +644,9 @@ QWebEngineViewPrivate::QWebEngineViewPrivate()
, m_ownsPage(false)
, m_contextRequest(nullptr)
{
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessible::installFactory(&webAccessibleFactory);
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
}
QWebEngineViewPrivate::~QWebEngineViewPrivate() = default;
@@ -1085,7 +1085,7 @@ QString QWebEngineView::selectedText() const
return page()->selectedText();
}
-#ifndef QT_NO_ACTION
+#if QT_CONFIG(action)
QAction* QWebEngineView::pageAction(QWebEnginePage::WebAction action) const
{
return page()->action(action);
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index 658b73da1..cc1495d24 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -98,7 +98,7 @@ public:
bool hasSelection() const;
QString selectedText() const;
-#ifndef QT_NO_ACTION
+#if QT_CONFIG(action)
QAction *pageAction(QWebEnginePage::WebAction action) const;
#endif
void triggerPageAction(QWebEnginePage::WebAction action, bool checked = false);