summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-11 15:54:06 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-11 15:54:06 (GMT)
commit581b699cfbd729cffb1dbf4b43d6337cafa68d9b (patch)
treea7461de46eb5a4a526f6f9b6b193dd233a691a16 /src/gui
parent6900cf8d7cb8d1e98f3af2ac7ce909dc3b5fc2ef (diff)
parentf9a6458f4abf8327354d227b3dd87bbab50d44e9 (diff)
downloadQt-581b699cfbd729cffb1dbf4b43d6337cafa68d9b.zip
Qt-581b699cfbd729cffb1dbf4b43d6337cafa68d9b.tar.gz
Qt-581b699cfbd729cffb1dbf4b43d6337cafa68d9b.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixed justify aligned text drawing with the GL1 engine. Add odf-writer benchmark. Fixed subpixel antialiased text drawing with the GL2 engine. Fixes warning in the QMacStyle Fix incorrect drawing of the hovered row on QTreeView with some styles. Track the glVertexAttribPointer and only update it if it's changed QTreeView::selectAll() wouldn't work when first column hidden
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp11
-rw-r--r--src/gui/itemviews/qtreeview.cpp16
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp2
-rw-r--r--src/gui/styles/qmacstyle_mac.mm2
4 files changed, 16 insertions, 15 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index f447989..f852e67 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -146,9 +146,16 @@ void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index)
if (hover == index)
return;
- q->update(hover); //update the old one
+ if (selectionBehavior != QAbstractItemView::SelectRows) {
+ q->update(hover); //update the old one
+ q->update(index); //update the new one
+ } else {
+ QRect oldHoverRect = q->visualRect(hover);
+ QRect newHoverRect = q->visualRect(index);
+ viewport->update(QRect(0, newHoverRect.y(), viewport->width(), newHoverRect.height()));
+ viewport->update(QRect(0, oldHoverRect.y(), viewport->width(), oldHoverRect.height()));
+ }
hover = index;
- q->update(hover); //update the new one
}
void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index)
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index bf88a75..24b448c 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -1241,15 +1241,6 @@ bool QTreeView::viewportEvent(QEvent *event)
viewport()->update(newRect);
}
}
- if (selectionBehavior() == QAbstractItemView::SelectRows) {
- QModelIndex newHoverIndex = indexAt(he->pos());
- if (d->hover != newHoverIndex) {
- QRect oldHoverRect = visualRect(d->hover);
- QRect newHoverRect = visualRect(newHoverIndex);
- viewport()->update(QRect(0, newHoverRect.y(), viewport()->width(), newHoverRect.height()));
- viewport()->update(QRect(0, oldHoverRect.y(), viewport()->width(), oldHoverRect.height()));
- }
- }
break; }
default:
break;
@@ -2644,10 +2635,13 @@ void QTreeView::selectAll()
return;
SelectionMode mode = d->selectionMode;
d->executePostedLayout(); //make sure we lay out the items
- if (mode != SingleSelection && !d->viewItems.isEmpty())
- d->select(d->viewItems.first().index, d->viewItems.last().index,
+ if (mode != SingleSelection && !d->viewItems.isEmpty()) {
+ const QModelIndex &idx = d->viewItems.last().index;
+ QModelIndex lastItemIndex = idx.sibling(idx.row(), d->model->columnCount(idx.parent()) - 1);
+ d->select(d->viewItems.first().index, lastItemIndex,
QItemSelectionModel::ClearAndSelect
|QItemSelectionModel::Rows);
+ }
}
/*!
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index b08847d..78beb5b 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -2069,7 +2069,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
// This is mainly to handle cases where someone sets the font on the window
// and then the combo inherits it and passes it onward. At that point the resolve mask
// is very, very weak. This makes it stonger.
- font.setPointSizeF(menuItem->font.pointSizeF());
+ font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF());
if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
font.setBold(true);
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 4075cf7..25e3028 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3996,7 +3996,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// This is mainly to handle cases where someone sets the font on the window
// and then the combo inherits it and passes it onward. At that point the resolve mask
// is very, very weak. This makes it stonger.
- myFont.setPointSizeF(mi->font.pointSizeF());
+ myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF());
p->setFont(myFont);
p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1,
contentRect.height(), text_flags ^ Qt::AlignRight, s);