Use the new BaseAspect::addOnChanged in a few places

... and in some cases move it closer to the aspect setup. I kept
the original location in cases where the order possibly matters.

Change-Id: I4774ea355d0d1e3cf890676a84121195fca6d406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2024-07-03 12:16:38 +02:00
parent bbb6053374
commit cba64c460b
20 changed files with 41 additions and 53 deletions

View File

@@ -60,6 +60,10 @@ GeneralSettings::GeneralSettings()
showShortcutsInContextMenus.setLabelText(
Tr::tr("Show keyboard shortcuts in context menus (default: %1)")
.arg(defaultShowShortcutsInContextMenu() ? Tr::tr("on") : Tr::tr("off")));
showShortcutsInContextMenus.addOnChanged(this, [this] {
QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus,
!showShortcutsInContextMenus());
});
provideSplitterCursors.setSettingsKey("General/OverrideSplitterCursors");
provideSplitterCursors.setDefaultValue(false);
@@ -69,11 +73,6 @@ GeneralSettings::GeneralSettings()
"not displayed properly, you can use the cursors provided by %1.")
.arg(QGuiApplication::applicationDisplayName()));
connect(&showShortcutsInContextMenus, &BaseAspect::changed, this, [this] {
QCoreApplication::setAttribute(Qt::AA_DontShowShortcutsInContextMenus,
!showShortcutsInContextMenus());
});
readSettings();
}