summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-21 09:52:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-21 09:52:00 (GMT)
commit55fb13a62a531a7400f8dc602fde5f2529aaaad4 (patch)
treeb942a39f3cdb37ecf5556a2e065853d6c77a81b8 /src
parent78b2e9421c47371b68f4c65a181a077ba3a226ac (diff)
parentb7a0a8dced26daf895fa9932e5a8c81e59fd7b84 (diff)
downloadQt-55fb13a62a531a7400f8dc602fde5f2529aaaad4.zip
Qt-55fb13a62a531a7400f8dc602fde5f2529aaaad4.tar.gz
Qt-55fb13a62a531a7400f8dc602fde5f2529aaaad4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Let QImageReader open the device if it is not open already Make an attemt to upload QPixmap in the most optimal format on 16-bit clicking on a non focused ItemView would change the cirrent item twice
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qimagereader.cpp2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/opengl/qgl.cpp11
3 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 9320cfc..27f9627 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -503,7 +503,7 @@ QImageReaderPrivate::~QImageReaderPrivate()
bool QImageReaderPrivate::initHandler()
{
// check some preconditions
- if (!device || (!deleteDevice && !device->isOpen())) {
+ if (!device || (!deleteDevice && !device->isOpen() && !device->open(QIODevice::ReadOnly))) {
imageReaderError = QImageReader::DeviceError;
errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageReader, "Invalid device"));
return false;
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index dd9a7e6..0f99949 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2090,7 +2090,7 @@ void QAbstractItemView::focusInEvent(QFocusEvent *event)
bool autoScroll = d->autoScroll;
d->autoScroll = false;
QModelIndex index = moveCursor(MoveNext, Qt::NoModifier); // first visible index
- if (index.isValid() && d->isIndexEnabled(index))
+ if (index.isValid() && d->isIndexEnabled(index) && event->reason() != Qt::MouseFocusReason)
selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
d->autoScroll = autoScroll;
}
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 5908f14..7aba25a 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2453,8 +2453,15 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
}
#endif
- if (!texture)
- texture = bindTexture(pixmap.toImage(), target, format, key, options);
+ if (!texture) {
+ QImage image = pixmap.toImage();
+ // If the system depth is 16 and the pixmap doesn't have an alpha channel
+ // then we convert it to RGB16 in the hope that it gets uploaded as a 16
+ // bit texture which is much faster to access than a 32-bit one.
+ if (pixmap.depth() == 16 && !image.hasAlphaChannel() )
+ image = image.convertToFormat(QImage::Format_RGB16);
+ texture = bindTexture(image, target, format, key, options);
+ }
// NOTE: bindTexture(const QImage&, GLenum, GLint, const qint64, bool) should never return null
Q_ASSERT(texture);