summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qcalendarwidget.cpp
diff options
context:
space:
mode:
authorLu YaNing <luyaning@uniontech.com>2022-12-12 14:45:09 +0800
committerLu YaNing <luyaning@uniontech.com>2022-12-13 12:17:06 +0800
commit223cf01cc6700c08c1a0e44a1aaa82f04b1f615b (patch)
tree94f57325931db71be8cbd0d920aca4e27c784666 /src/widgets/widgets/qcalendarwidget.cpp
parent04695824f0702f27fe69ad4c89f06bfd7309badc (diff)
Add static_cast for QKeyEvent
Use static_cast to convert a QEvent to a QKeyEvent, replacing (QKeyEvent*)e Change-Id: I52ac3f46aec42600251cf737db2e71c04f2b45c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/widgets/qcalendarwidget.cpp')
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 4d3360226f..987d25c721 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -727,7 +727,7 @@ bool QCalendarTextNavigator::eventFilter(QObject *o, QEvent *e)
{
if (m_widget) {
if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) {
- QKeyEvent* ke = (QKeyEvent*)e;
+ QKeyEvent *ke = static_cast<QKeyEvent *>(e);
if ((ke->text().size() > 0 && ke->text().at(0).isPrint()) || m_dateFrame) {
if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Select) {
applyDate();