Replace some uses of static_cast with qobject_cast

This commit is contained in:
Jonas Kvinge
2020-07-17 01:32:07 +02:00
parent 9e32f0d778
commit 71a1ea481b
12 changed files with 21 additions and 21 deletions

View File

@@ -178,7 +178,7 @@ void GlobalShortcuts::Unregister() {
bool GlobalShortcuts::IsMacAccessibilityEnabled() const {
#ifdef Q_OS_MACOS
if (system_backend_) return static_cast<GlobalShortcutBackendMacOS*>(system_backend_)->IsAccessibilityEnabled();
if (system_backend_) return qobject_cast<GlobalShortcutBackendMacOS*>(system_backend_)->IsAccessibilityEnabled();
else return false;
#else
return true;
@@ -187,6 +187,6 @@ bool GlobalShortcuts::IsMacAccessibilityEnabled() const {
void GlobalShortcuts::ShowMacAccessibilityDialog() {
#ifdef Q_OS_MACOS
if (system_backend_) static_cast<GlobalShortcutBackendMacOS*>(system_backend_)->ShowAccessibilityDialog();
if (system_backend_) qobject_cast<GlobalShortcutBackendMacOS*>(system_backend_)->ShowAccessibilityDialog();
#endif
}