summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-10-12 10:27:10 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-10-12 10:27:10 (GMT)
commit266f13e567ada25441cd19461eaf02f37bc36d51 (patch)
tree5a232b4605bb624067ef51d48a3b949a80979cf6
parentc6ff4f5dad76f7bd23d17ba0b73325740a3724d4 (diff)
parent85bb10256b2745499f04c32a5ed738889606f6c3 (diff)
downloadQt-266f13e567ada25441cd19461eaf02f37bc36d51.zip
Qt-266f13e567ada25441cd19461eaf02f37bc36d51.tar.gz
Qt-266f13e567ada25441cd19461eaf02f37bc36d51.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
-rw-r--r--src/gui/itemviews/qheaderview.cpp12
-rw-r--r--src/gui/kernel/qkeymapper_win.cpp4
-rw-r--r--src/gui/styles/qplastiquestyle.cpp2
-rw-r--r--src/opengl/qglpixelbuffer_egl.cpp2
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp2
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp21
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h2
-rw-r--r--translations/translations.pri5
8 files changed, 29 insertions, 21 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index c5e6fed..b1306cc 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -526,20 +526,24 @@ QSize QHeaderView::sizeHint() const
return d->cachedSizeHint;
int width = 0;
int height = 0;
+ d->executePostedLayout();
+
// get size hint for the first n sections
- int c = qMin(count(), 100);
- for (int i = 0; i < c; ++i) {
+ int i = 0;
+ for (int checked = 0; checked < 100 && i < d->sectionCount; ++i) {
if (isSectionHidden(i))
continue;
+ checked++;
QSize hint = sectionSizeFromContents(i);
width = qMax(hint.width(), width);
height = qMax(hint.height(), height);
}
// get size hint for the last n sections
- c = qMax(count() - 100, c);
- for (int j = count() - 1; j >= c; --j) {
+ i = qMax(i, d->sectionCount - 100 );
+ for (int j = d->sectionCount - 1, checked = 0; j > i && checked < 100; --j) {
if (isSectionHidden(j))
continue;
+ checked++;
QSize hint = sectionSizeFromContents(j);
width = qMax(hint.width(), width);
height = qMax(hint.height(), height);
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp
index 25b6dce..8138839 100644
--- a/src/gui/kernel/qkeymapper_win.cpp
+++ b/src/gui/kernel/qkeymapper_win.cpp
@@ -949,8 +949,8 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool
if(msg.wParam == VK_PROCESSKEY)
return true;
- // Ignore invalid virtual keycode (see bug 127424)
- if (msg.wParam == 0xFF)
+ // Ignore invalid virtual keycodes (see bugs 127424, QTBUG-3630)
+ if (msg.wParam == 0 || msg.wParam == 0xFF)
return true;
// Translate VK_* (native) -> Key_* (Qt) keys
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index 349a60d..8e19022 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -3328,7 +3328,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op
// Draw the text centered
QFont font = painter->font();
- font.setPointSize(font.pointSize() - 1);
+ font.setPointSize(QFontInfo(font).pointSize() - 1);
painter->setFont(font);
painter->setPen(dockWidget->palette.windowText().color());
painter->drawText(titleRect,
diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp
index a501c47..b2f16c1 100644
--- a/src/opengl/qglpixelbuffer_egl.cpp
+++ b/src/opengl/qglpixelbuffer_egl.cpp
@@ -209,7 +209,7 @@ bool QGLPixelBuffer::hasOpenGLPbuffers()
QEglProperties configProps;
qt_egl_set_format(configProps, QInternal::Pbuffer, QGLFormat::defaultFormat());
configProps.setRenderableType(QEglContext::OpenGL);
- return ctx.chooseConfig(configProps);
+ return ctx.chooseConfig(configProps, QEglContext::BestPixelFormat);
}
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
index 25c5283..cb453d7 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
@@ -104,7 +104,7 @@ bool PvrEglScreen::connect(const QString &displaySpec)
break;
case PVR2D_ARGB8888:
d = 32;
- setPixelFormat(QImage::Format_ARGB32);
+ setPixelFormat(QImage::Format_ARGB32_Premultiplied);
break;
default:
pvrQwsDisplayClose();
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
index afee77e..09c0ace 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
@@ -149,6 +149,18 @@ void PvrEglWindowSurface::setPermanentState(const QByteArray &state)
Q_UNUSED(state);
}
+void PvrEglWindowSurface::flush
+ (QWidget *widget, const QRegion &region, const QPoint &offset)
+{
+ // The GL paint engine is responsible for the swapBuffers() call.
+ // If we were to call the base class's implementation of flush()
+ // then it would fetch the image() and manually blit it to the
+ // screeen instead of using the fast PVR2D blit.
+ Q_UNUSED(widget);
+ Q_UNUSED(region);
+ Q_UNUSED(offset);
+}
+
QImage PvrEglWindowSurface::image() const
{
if (drawable) {
@@ -165,14 +177,7 @@ QImage PvrEglWindowSurface::image() const
QPaintDevice *PvrEglWindowSurface::paintDevice()
{
- QGLWidget *glWidget = qobject_cast<QGLWidget *>(window());
- if (glWidget)
- return glWidget;
-
- // Should be a QGLWidget, but if not return a dummy paint device.
- if (!pdevice)
- pdevice = new QImage(50, 50, screen->pixelFormat());
- return pdevice;
+ return widget;
}
void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id)
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
index 80fc8f8..0da3653 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
@@ -65,6 +65,8 @@ public:
QByteArray permanentState() const;
void setPermanentState(const QByteArray &state);
+ void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
+
QImage image() const;
QPaintDevice *paintDevice();
diff --git a/translations/translations.pri b/translations/translations.pri
index 0c5c1ee..0fb91e8 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -9,12 +9,9 @@ defineReplace(prependAll) {
}
defineReplace(fixPath) {
-WIN {
- return ($$replace($$1, /, \))
-} ELSE {
+ win32:1 ~= s|/|\\|
return ($$1)
}
-}
LUPDATE = $$fixPath($$QT_BUILD_TREE/bin/lupdate) -locations relative -no-ui-lines
LRELEASE = $$fixPath($$QT_BUILD_TREE/bin/lrelease)