Skip to content

Commit

Permalink
[ci release] Adapt shortcuts to older Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed May 30, 2021
1 parent 154b899 commit 70799af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/ui/src/abstractlogview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ void AbstractLogView::doRegisterShortcuts()
registerShortcut( ShortcutAction::LogViewScrollUp, [ this ]() {
verticalScrollBar()->triggerAction( QScrollBar::SliderPageStepSub );
} );
registerShortcut( ShortcutAction::LogViewSelectionDown, [ this ]() {
registerShortcut( ShortcutAction::LogViewScrollDown, [ this ]() {
verticalScrollBar()->triggerAction( QScrollBar::SliderPageStepAdd );
} );
registerShortcut( ShortcutAction::LogViewScrollLeft, [ this ]() {
Expand All @@ -576,9 +576,7 @@ void AbstractLogView::doRegisterShortcuts()
registerShortcut( ShortcutAction::LogViewJumpToEndOfLine, [ this ]() { jumpToEndOfLine(); } );
registerShortcut( ShortcutAction::LogViewJumpToRightOfScreen,
[ this ]() { jumpToRightOfScreen(); } );
registerShortcut( ShortcutAction::LogViewJumpToRightOfScreen,
[ this ]() { jumpToRightOfScreen(); } );


registerShortcut( ShortcutAction::LogViewQfForward, [ this ]() { emit searchNext(); } );
registerShortcut( ShortcutAction::LogViewQfBackward, [ this ]() { emit searchPrevious(); } );
registerShortcut( ShortcutAction::LogViewQfSelectedForward,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/crawlerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ void CrawlerWidget::registerShortcuts()

ShortcutAction::registerShortcut( configuredShortcuts, shortcuts_, this, Qt::WidgetWithChildrenShortcut,
ShortcutAction::CrawlerDecreaseTopViewSize,
[ this ]() { changeTopViewSize( 1 ); } );
[ this ]() { changeTopViewSize( -1 ); } );

logMainView_->registerShortcuts();
filteredView_->registerShortcuts();
Expand Down
10 changes: 6 additions & 4 deletions src/utils/include/shortcuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ struct ShortcutAction {
shortcuts.emplace( CrawlerDecreaseTopViewSize,
QStringList() << QKeySequence( Qt::Key_Minus ).toString() );

shortcuts.emplace( QfFindNext, getKeyBindings( QKeySequence::FindNext ) );
shortcuts.emplace( QfFindPrev, getKeyBindings( QKeySequence::FindPrevious ) );
// shortcuts.emplace( QfFindNext, getKeyBindings( QKeySequence::FindNext ) );
// shortcuts.emplace( QfFindPrev, getKeyBindings( QKeySequence::FindPrevious ) );

shortcuts.emplace( LogViewMark, QStringList() << QKeySequence( Qt::Key_M ).toString() );

Expand Down Expand Up @@ -233,8 +233,10 @@ struct ShortcutAction {
shortcut->second->setKey( QKeySequence( key ) );
}
else {
shortcutsStorage.emplace(
key, new QShortcut( QKeySequence( key ), shortcutsParent, func, context ) );
auto newShortcut = new QShortcut( QKeySequence( key ), shortcutsParent );
newShortcut->setContext( context );
newShortcut->connect( newShortcut, &QShortcut::activated, [ func ]() { func(); } );
shortcutsStorage.emplace( key, newShortcut );
}
}
}
Expand Down

0 comments on commit 70799af

Please sign in to comment.