Guard the usages of QPlatformIntegration::services()
Task-number: QTBUG-130884 Pick-to: 6.5 Change-Id: I6c8060ce8b7a4e525c46e2e1fec227f46fe8c4d6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7f06824408b5ff3f53d97298d960b7f5758286c9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>bb10
parent
7e4b10677f
commit
ecbc02f03a
|
|
@ -191,7 +191,8 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
|
|||
// Accessing to process name might be not allowed if the application
|
||||
// is confined, thus we can just rely on the current desktop in use
|
||||
const QPlatformServices *services = QGuiApplicationPrivate::platformIntegration()->services();
|
||||
necessary = services->desktopEnvironment().split(':').contains("UNITY");
|
||||
if (services)
|
||||
necessary = services->desktopEnvironment().split(':').contains("UNITY");
|
||||
}
|
||||
necessity_checked = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1610,7 +1610,7 @@ void QColorDialogPrivate::pickScreenColor()
|
|||
Q_Q(QColorDialog);
|
||||
|
||||
auto *platformServices = QGuiApplicationPrivate::platformIntegration()->services();
|
||||
if (platformServices->hasCapability(QPlatformServices::Capability::ColorPicking)) {
|
||||
if (platformServices && platformServices->hasCapability(QPlatformServices::Capability::ColorPicking)) {
|
||||
if (auto *colorPicker = platformServices->colorPicker(q->windowHandle())) {
|
||||
q->connect(colorPicker, &QPlatformServiceColorPicker::colorPicked, q,
|
||||
[q, colorPicker](const QColor &color) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue