mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
opt: revise QKeySequenceEdit usages
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
* set Maximum length of global shortcuts to 2 * set Default to something that can be set by user
This commit is contained in:
parent
8ad7291147
commit
70d21d7eca
|
@ -215,8 +215,8 @@ Preferences::Preferences():
|
|||
enableMainWindowHotkey( true ),
|
||||
enableClipboardHotkey( true ),
|
||||
#endif
|
||||
mainWindowHotkey( QKeySequence( "Ctrl+F11,F11" ) ),
|
||||
clipboardHotkey( QKeySequence( "Ctrl+C,C" ) ),
|
||||
mainWindowHotkey( QKeySequence( "Ctrl+F11, Ctrl+F11" ) ),
|
||||
clipboardHotkey( QKeySequence( "Ctrl+C, Ctrl+C" ) ),
|
||||
startWithScanPopupOn( false ),
|
||||
enableScanPopupModifiers( false ),
|
||||
scanPopupModifiers( 0 ),
|
||||
|
|
|
@ -205,11 +205,18 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
|
|||
ui.darkMode->hide();
|
||||
#endif
|
||||
|
||||
/// Hotkey Tab
|
||||
ui.enableMainWindowHotkey->setChecked( p.enableMainWindowHotkey );
|
||||
ui.mainWindowHotkey->setKeySequence( p.mainWindowHotkey );
|
||||
ui.enableClipboardHotkey->setChecked( p.enableClipboardHotkey );
|
||||
ui.clipboardHotkey->setKeySequence( p.clipboardHotkey );
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 6, 5, 0 )
|
||||
// Bound by current global hotkey implementations
|
||||
ui.mainWindowHotkey->setMaximumSequenceLength( 2 );
|
||||
ui.clipboardHotkey->setMaximumSequenceLength( 2 );
|
||||
#endif
|
||||
|
||||
ui.startWithScanPopupOn->setChecked( p.startWithScanPopupOn );
|
||||
ui.enableScanPopupModifiers->setChecked( p.enableScanPopupModifiers );
|
||||
|
||||
|
|
Loading…
Reference in a new issue