summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qlistview.cpp10
-rw-r--r--src/gui/itemviews/qtreeview.cpp6
-rw-r--r--src/gui/itemviews/qtreeview_p.h2
3 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index d680af8a7e..15db9a603f 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -357,7 +357,7 @@ QListView::LayoutMode QListView::layoutMode() const
/*!
\property QListView::spacing
- \brief the space between items in the layout
+ \brief the space around the items in the layout
This property is the size of the empty space that is padded around
an item in the layout.
@@ -972,9 +972,9 @@ void QListView::paintEvent(QPaintEvent *e)
option.rect = visualRect(*it);
if (flow() == TopToBottom)
- option.rect.setWidth(qMin(viewport()->size().width(), option.rect.width()));
+ option.rect.setWidth(qMin(viewport()->size().width() - 2 * d->spacing(), option.rect.width()));
else
- option.rect.setHeight(qMin(viewport()->size().height(), option.rect.height()));
+ option.rect.setHeight(qMin(viewport()->size().height() - 2 * d->spacing(), option.rect.height()));
option.state = state;
if (selections && selections->isSelected(*it))
@@ -1837,14 +1837,14 @@ void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step)
{
horizontalScrollBar()->setSingleStep(step.width() + spacing());
horizontalScrollBar()->setPageStep(viewport()->width());
- horizontalScrollBar()->setRange(0, contentsSize.width() - viewport()->width());
+ horizontalScrollBar()->setRange(0, contentsSize.width() - viewport()->width() - 2 * spacing());
}
void QCommonListViewBase::updateVerticalScrollBar(const QSize &step)
{
verticalScrollBar()->setSingleStep(step.height() + spacing());
verticalScrollBar()->setPageStep(viewport()->height());
- verticalScrollBar()->setRange(0, contentsSize.height() - viewport()->height());
+ verticalScrollBar()->setRange(0, contentsSize.height() - viewport()->height() - 2 * spacing());
}
void QCommonListViewBase::scrollContentsBy(int dx, int dy, bool /*scrollElasticBand*/)
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 3856293afd..a3cbc0d337 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2113,6 +2113,12 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
if (vi < 0)
vi = qMax(0, d->viewIndex(current));
+ if (isRightToLeft()) {
+ if (cursorAction == MoveRight)
+ cursorAction = MoveLeft;
+ else if (cursorAction == MoveLeft)
+ cursorAction = MoveRight;
+ }
switch (cursorAction) {
case MoveNext:
case MoveDown:
diff --git a/src/gui/itemviews/qtreeview_p.h b/src/gui/itemviews/qtreeview_p.h
index aad5837599..d58dea34c2 100644
--- a/src/gui/itemviews/qtreeview_p.h
+++ b/src/gui/itemviews/qtreeview_p.h
@@ -105,7 +105,7 @@ public:
int top() const { return startValue().toInt(); }
QRect rect() const { QRect rect = viewport->rect(); rect.moveTop(top()); return rect; }
void updateCurrentValue(const QVariant &) { viewport->update(rect()); }
- void updateState(State, State state) { if (state == Stopped) before = after = QPixmap(); }
+ void updateState(State state, State) { if (state == Stopped) before = after = QPixmap(); }
} animatedOperation;
void prepareAnimatedOperation(int item, QVariantAnimation::Direction d);
void beginAnimatedOperation();