Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions reader/browser/SheetBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
#include "ddlog.h"

#include <DMenu>
#include <DGuiApplicationHelper>

Check warning on line 27 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DGuiApplicationHelper> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 27 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <DGuiApplicationHelper> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QGraphicsItem>

Check warning on line 29 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QGraphicsItem> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 29 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QGraphicsItem> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QKeyEvent>

Check warning on line 30 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QKeyEvent> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 30 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QKeyEvent> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QScrollBar>

Check warning on line 31 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QScrollBar> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 31 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QScrollBar> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QTimer>

Check warning on line 32 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QTimer> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 32 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QTimer> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QApplication>

Check warning on line 33 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 33 in reader/browser/SheetBrowser.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QBitmap>
#include <QFileInfo>
#include <QTemporaryFile>
Expand Down Expand Up @@ -752,6 +753,21 @@
qCDebug(appLog) << "SheetBrowser::jumpToHighLight() - Jump to high light completed";
}

void SheetBrowser::keyPressEvent(QKeyEvent *event)
{
if (m_sheet) {
if (event->key() == Qt::Key_PageDown && !event->isAutoRepeat()) {
m_sheet->jumpToNextPage();
return;
}
if (event->key() == Qt::Key_PageUp && !event->isAutoRepeat()) {
m_sheet->jumpToPrevPage();
return;
}
}
DGraphicsView::keyPressEvent(event);
}

void SheetBrowser::wheelEvent(QWheelEvent *event)
{
// qCDebug(appLog) << "SheetBrowser::wheelEvent() - Starting wheel event";
Expand Down
7 changes: 7 additions & 0 deletions reader/browser/SheetBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ class SheetBrowser : public Dtk::Widget::DGraphicsView
*/
void mouseReleaseEvent(QMouseEvent *event) override;

/**
* @brief keyPressEvent
* 键盘按键事件,适合高度模式下拦截PageDown/PageUp实现精确翻页
* @param event
*/
void keyPressEvent(QKeyEvent *event) override;

/**
* @brief focusOutEvent
* 失去焦点处理
Expand Down
Loading