diff options
author | Thomas Sondergaard <ts@medical-insight.com> | 2010-02-05 12:24:13 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-02-05 12:24:13 (GMT) |
commit | a767da6f2d0fbee707f5c2fe896fa501b3da6b07 (patch) | |
tree | 67936792de0ca2d1fd28b81450319f5f877cab4d | |
parent | c6393ddce6fc9df8f52039089cc67699eb95aada (diff) | |
download | Qt-a767da6f2d0fbee707f5c2fe896fa501b3da6b07.zip Qt-a767da6f2d0fbee707f5c2fe896fa501b3da6b07.tar.gz Qt-a767da6f2d0fbee707f5c2fe896fa501b3da6b07.tar.bz2 |
Fix for number entry in QDateTimeEntry using Shift+KeyPad (QTBUG-7842)
Merge-request: 2300
Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
-rw-r--r-- | src/gui/widgets/qdatetimeedit.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index 762db86..50fa9c9 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -1175,7 +1175,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) return; } } QAbstractSpinBox::keyPressEvent(event); - if (select && !(event->modifiers() & Qt::ShiftModifier) && !d->edit->hasSelectedText()) { + if (select && !d->edit->hasSelectedText()) { if (inserted && d->sectionAt(d->edit->cursorPosition()) == QDateTimeParser::NoSectionIndex) { QString str = d->displayText(); int pos = d->edit->cursorPosition(); diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index b92b873..558d4de 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -3357,6 +3357,8 @@ void tst_QDateTimeEdit::keypadAutoAdvance_data() QTest::addColumn<Qt::KeyboardModifiers>("modifiers"); QTest::newRow("None") << (Qt::KeyboardModifiers)Qt::NoModifier; QTest::newRow("Keypad") << (Qt::KeyboardModifiers)Qt::KeypadModifier; + // QTBUG-7842: Using KeyPad with shift (numlock off) + QTest::newRow("Keypad+Shift") << (Qt::KeyboardModifiers)(Qt::KeypadModifier|Qt::ShiftModifier); } |