diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-23 18:56:59 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-23 18:56:59 (GMT) |
commit | 0be215ea57fa7bd0787d995381b24faaf23d1b7b (patch) | |
tree | 4a2977fd232abaa9d9b7058ad1389ec08090c6e5 /src/gui/itemviews | |
parent | e3999a4f91194b7508dbd1d3e6f595f729022ed7 (diff) | |
parent | 237b528f518f541d2f6c2ffcbaccca1a776a6f8b (diff) | |
download | Qt-0be215ea57fa7bd0787d995381b24faaf23d1b7b.zip Qt-0be215ea57fa7bd0787d995381b24faaf23d1b7b.tar.gz Qt-0be215ea57fa7bd0787d995381b24faaf23d1b7b.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (114 commits)
Fix the test of QDirIterator with NoDot and NoDotDot
Split QDir::NoDotAndDotDot into QDir::NoDot and QDir::NoDotDot
QFSFileEngine: don't look through NTFS junctions
After showing modal windows, WM_LBUTTONUP for double click is ignored.
Possible fix for missing QML properties in the qt.qhp file.
Use standard theme icons in Linguist where possible
Use more standard icons from the theme in Assistant
Use more standard icons for standard actions in Designer
Drag & drop operations wont end while using Remote Desktop sessions
_close(fd) closes the associated handle and not the other way around
Fixed locale mapping on Symbian.
Revert change 7bf4512659 on Cocoa.
Extended the high_attributes array, since we have more than 127 widget attributes now.
Added instructions for MinGW users wanting to build the MySQL driver.
Designer: Fix broken resource view.
Add missing ,.
get rid of build warning messages
Quiet unnecessary configure/qmake warnings when EPOCROOT is not set.
Add configure test for Maemo Internet Connection Daemon.
fix warning
...
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 10 | ||||
-rw-r--r-- | src/gui/itemviews/qabstractitemview_p.h | 5 | ||||
-rw-r--r-- | src/gui/itemviews/qitemdelegate.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 15 |
4 files changed, 24 insertions, 8 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index a4722f7..32d7bca 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -104,7 +104,8 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() horizontalScrollMode(QAbstractItemView::ScrollPerItem), currentIndexSet(false), wrapItemText(false), - delayedPendingLayout(true) + delayedPendingLayout(true), + moveCursorUpdatedView(false) { } @@ -2208,6 +2209,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) #endif QPersistentModelIndex newCurrent; + d->moveCursorUpdatedView = false; switch (event->key()) { case Qt::Key_Down: newCurrent = moveCursor(MoveDown, event->modifiers()); @@ -2264,6 +2266,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) QRect rect(d->pressedPosition - d->offset(), QSize(1, 1)); setSelection(rect, command); } + event->accept(); return; } } @@ -2361,6 +2364,8 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) } break; } } + if (d->moveCursorUpdatedView) + event->accept(); } /*! @@ -2837,7 +2842,8 @@ void QAbstractItemView::keyboardSearch(const QString &search) QModelIndex start = currentIndex().isValid() ? currentIndex() : d->model->index(0, 0, d->root); - QTime now(QTime::currentTime()); + QElapsedTimer now; + now.start(); bool skipRow = false; if (search.isEmpty() || (d->keyboardInputTime.msecsTo(now) > QApplication::keyboardInputInterval())) { diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h index 82fd1a6..fce74f3 100644 --- a/src/gui/itemviews/qabstractitemview_p.h +++ b/src/gui/itemviews/qabstractitemview_p.h @@ -56,7 +56,6 @@ #include "private/qabstractscrollarea_p.h" #include "private/qabstractitemmodel_p.h" #include "QtGui/qapplication.h" -#include "QtCore/qdatetime.h" #include "QtGui/qevent.h" #include "QtGui/qmime.h" #include "QtGui/qpainter.h" @@ -65,6 +64,7 @@ #include "QtCore/qdebug.h" #include "QtGui/qpainter.h" #include "QtCore/qbasictimer.h" +#include "QtCore/qelapsedtimer.h" #ifndef QT_NO_ITEMVIEWS @@ -390,7 +390,7 @@ public: #endif QString keyboardInput; - QTime keyboardInputTime; + QElapsedTimer keyboardInputTime; bool autoScroll; QBasicTimer autoScrollTimer; @@ -419,6 +419,7 @@ public: bool wrapItemText; mutable bool delayedPendingLayout; + bool moveCursorUpdatedView; private: mutable QBasicTimer delayedLayout; diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index 7d8e103..cba213b 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -1023,7 +1023,7 @@ QPixmap QItemDelegate::decoration(const QStyleOptionViewItem &option, const QVar // hacky but faster version of "QString::sprintf("%d-%d", i, enabled)" static QString qPixmapSerial(quint64 i, bool enabled) { - ushort arr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', '0' + enabled }; + ushort arr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', ushort('0' + enabled) }; ushort *ptr = &arr[16]; while (i > 0) { diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 4636c50..063f3f4 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -962,7 +962,8 @@ void QTreeView::keyboardSearch(const QString &search) else start = d->model->index(0, 0, d->root); - QTime now(QTime::currentTime()); + QElapsedTimer now; + now.start(); bool skipRow = false; if (search.isEmpty() || (d->keyboardInputTime.msecsTo(now) > QApplication::keyboardInputInterval())) { @@ -2160,9 +2161,10 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie return d->modelIndex(d->above(vi), current.column()); case MoveLeft: { QScrollBar *sb = horizontalScrollBar(); - if (vi < d->viewItems.count() && d->viewItems.at(vi).expanded && d->itemsExpandable && sb->value() == sb->minimum()) + if (vi < d->viewItems.count() && d->viewItems.at(vi).expanded && d->itemsExpandable && sb->value() == sb->minimum()) { d->collapse(vi, true); - else { + d->moveCursorUpdatedView = true; + } else { bool descend = style()->styleHint(QStyle::SH_ItemView_ArrowKeysNavigateIntoChildren, 0, this); if (descend) { QModelIndex par = current.parent(); @@ -2182,7 +2184,10 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie return next; } + int oldValue = sb->value(); sb->setValue(sb->value() - sb->singleStep()); + if (oldValue != sb->value()) + d->moveCursorUpdatedView = true; } } @@ -2194,6 +2199,7 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie if (vi < d->viewItems.count() && !d->viewItems.at(vi).expanded && d->itemsExpandable && d->hasVisibleChildren(d->viewItems.at(vi).index)) { d->expand(vi, true); + d->moveCursorUpdatedView = true; } else { bool descend = style()->styleHint(QStyle::SH_ItemView_ArrowKeysNavigateIntoChildren, 0, this); if (descend) { @@ -2216,7 +2222,10 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie //last restort: we change the scrollbar value QScrollBar *sb = horizontalScrollBar(); + int oldValue = sb->value(); sb->setValue(sb->value() + sb->singleStep()); + if (oldValue != sb->value()) + d->moveCursorUpdatedView = true; } } updateGeometries(); |