summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-20 18:08:59 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-20 18:08:59 (GMT)
commit9a099b6408169b3e6f30ffd2e4866d7af31e49c9 (patch)
tree2944cc5376c12f9721bbaaa10866a43270166aae /src/gui
parentd05f83919949fd9604e6d96858a8404c9a580def (diff)
parent9221250e01c78e77ce92d69e012053c46c2e3679 (diff)
downloadQt-9a099b6408169b3e6f30ffd2e4866d7af31e49c9.zip
Qt-9a099b6408169b3e6f30ffd2e4866d7af31e49c9.tar.gz
Qt-9a099b6408169b3e6f30ffd2e4866d7af31e49c9.tar.bz2
Merge branch 'qt-master-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (324 commits) Assistant: Remove 'namespace qt' from new files in 4.7 Doc: these files are NOT part of the test suite of the Qt toolkit Autotest: make the licenseCheck test also check .qdoc files use egl properties when creating surfaces on symbian work around the current include file structure on Symbian^3 Get rid of the dependency on the Symbian app layer Fix incorrect license headers Fix incorrect license headers tst_qnetworkreply: Check if TCP/HTTP connection got re-used Fix bad conflict resolution from 4baa9dfb5273d7b501dcb3f456983262c53cc8d1 Fix building in a namespace on Windows Supressed Icon sizes on QPushButton in QS60Style Ensure that posted events are sent on Windows Fixed off-by-one blending errors in the NEON drawhelper code. Fixed libstdcpp.dll version autodetection for Symbian Fixed linkage failure when building qmake on Unix platforms Factored epocRoot implementation out of qmake Factored readRegistryKey implementation out of qmake Cetest extensions for Windows Mobile device power operations. Remote lib extensions for Windows Mobile device power operations. ...
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qcolordialog.cpp6
-rw-r--r--src/gui/effects/qgraphicseffect.cpp26
-rw-r--r--src/gui/egl/qegl.cpp87
-rw-r--r--src/gui/egl/qegl_p.h12
-rw-r--r--src/gui/egl/qegl_qws.cpp6
-rw-r--r--src/gui/egl/qegl_symbian.cpp12
-rw-r--r--src/gui/egl/qegl_wince.cpp13
-rw-r--r--src/gui/egl/qegl_x11.cpp7
-rw-r--r--src/gui/egl/qeglproperties.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp30
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp33
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp4
-rw-r--r--src/gui/gui.pro27
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp21
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks_p.h3
-rw-r--r--src/gui/image/qpixmap.cpp9
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp5
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp5
-rw-r--r--src/gui/itemviews/qtreeview.cpp9
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm8
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp29
-rw-r--r--src/gui/kernel/qsoftkeymanager_p.h2
-rw-r--r--src/gui/painting/qcups.cpp4
-rw-r--r--src/gui/painting/qdrawhelper.cpp49
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp130
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp211
-rw-r--r--src/gui/painting/qdrawhelper_x86_p.h8
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp18
-rw-r--r--src/gui/painting/qpainter.cpp7
-rw-r--r--src/gui/styles/qs60style.cpp37
-rw-r--r--src/gui/styles/qs60style_p.h3
-rw-r--r--src/gui/text/qfontdatabase_win.cpp14
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp4
-rw-r--r--src/gui/widgets/qcombobox.cpp6
-rw-r--r--src/gui/widgets/qdockarealayout.cpp2
-rw-r--r--src/gui/widgets/qmainwindow.cpp5
-rw-r--r--src/gui/widgets/qmainwindowlayout.cpp1
-rw-r--r--src/gui/widgets/qmenu.cpp20
38 files changed, 616 insertions, 263 deletions
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp
index 83ecc30..e6abf7f 100644
--- a/src/gui/dialogs/qcolordialog.cpp
+++ b/src/gui/dialogs/qcolordialog.cpp
@@ -1078,8 +1078,7 @@ QColorShower::QColorShower(QColorDialog *parent)
#ifdef QT_SMALL_COLORDIALOG
# ifdef Q_WS_S60
- QS60Data s60Data = QS60Data();
- const bool nonTouchUI = !s60Data.hasTouchscreen;
+ const bool nonTouchUI = !S60->hasTouchscreen;
# elif defined Q_WS_MAEMO_5
const bool nonTouchUI = false;
# endif
@@ -1506,8 +1505,7 @@ void QColorDialogPrivate::init(const QColor &initial)
#if defined(QT_SMALL_COLORDIALOG)
# if defined(Q_WS_S60)
- QS60Data s60Data = QS60Data();
- const bool nonTouchUI = !s60Data.hasTouchscreen;
+ const bool nonTouchUI = !S60->hasTouchscreen;
# elif defined(Q_WS_MAEMO_5)
const bool nonTouchUI = false;
# endif
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 10ef5ea..ce4ce6a 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -699,12 +699,17 @@ void QGraphicsColorizeEffect::draw(QPainter *painter)
if (sourceIsPixmap()) {
// No point in drawing in device coordinates (pixmap will be scaled anyways).
const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, NoPad);
- d->filter->draw(painter, offset, pixmap);
+ if (!pixmap.isNull())
+ d->filter->draw(painter, offset, pixmap);
+
return;
}
// Draw pixmap in deviceCoordinates to avoid pixmap scaling.
const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset);
+ if (pixmap.isNull())
+ return;
+
QTransform restoreTransform = painter->worldTransform();
painter->setWorldTransform(QTransform());
d->filter->draw(painter, offset, pixmap);
@@ -721,7 +726,8 @@ void QGraphicsColorizeEffect::draw(QPainter *painter)
elements. The level of detail can be modified using the setBlurRadius()
function. Use setBlurHints() to choose the blur hints.
- By default, the blur radius is 5 pixels.
+ By default, the blur radius is 5 pixels. The blur radius is specified in
+ device coordinates.
\img graphicseffect-blur.png
@@ -776,6 +782,9 @@ QGraphicsBlurEffect::~QGraphicsBlurEffect()
radius results in a more blurred appearance.
By default, the blur radius is 5 pixels.
+
+ The radius is given in device coordinates, meaning it is
+ unaffected by scale.
*/
qreal QGraphicsBlurEffect::blurRadius() const
{
@@ -858,9 +867,11 @@ void QGraphicsBlurEffect::draw(QPainter *painter)
if (painter->paintEngine()->type() == QPaintEngine::OpenGL2)
mode = NoPad;
- // Draw pixmap in device coordinates to avoid pixmap scaling.
QPoint offset;
QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, mode);
+ if (pixmap.isNull())
+ return;
+
d->filter->draw(painter, offset, pixmap);
}
@@ -877,7 +888,8 @@ void QGraphicsBlurEffect::draw(QPainter *painter)
By default, the drop shadow is a semi-transparent dark gray
(QColor(63, 63, 63, 180)) shadow, blurred with a radius of 1 at an offset
- of 8 pixels towards the lower right.
+ of 8 pixels towards the lower right. The drop shadow offset is specified
+ in device coordinates.
\img graphicseffect-drop-shadow.png
@@ -906,6 +918,9 @@ QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect()
By default, the offset is 8 pixels towards the lower right.
+ The offset is given in device coordinates, which means it is
+ unaffected by scale.
+
\sa xOffset(), yOffset(), blurRadius(), color()
*/
QPointF QGraphicsDropShadowEffect::offset() const
@@ -1047,6 +1062,9 @@ void QGraphicsDropShadowEffect::draw(QPainter *painter)
// Draw pixmap in device coordinates to avoid pixmap scaling.
QPoint offset;
const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset, mode);
+ if (pixmap.isNull())
+ return;
+
QTransform restoreTransform = painter->worldTransform();
painter->setWorldTransform(QTransform());
d->filter->draw(painter, offset, pixmap);
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index ae3d6c3..0ed95ea 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -54,9 +54,10 @@ QT_BEGIN_NAMESPACE
static QEglContext * volatile currentGLContext = 0;
static QEglContext * volatile currentVGContext = 0;
+EGLDisplay QEglContext::dpy = EGL_NO_DISPLAY;
+
QEglContext::QEglContext()
: apiType(QEgl::OpenGL)
- , dpy(EGL_NO_DISPLAY)
, ctx(EGL_NO_CONTEXT)
, cfg(0)
, currentSurface(EGL_NO_SURFACE)
@@ -68,7 +69,7 @@ QEglContext::QEglContext()
QEglContext::~QEglContext()
{
- destroy();
+ destroyContext();
if (currentGLContext == this)
currentGLContext = 0;
@@ -86,14 +87,6 @@ bool QEglContext::isCurrent() const
return current;
}
-// Open the EGL display associated with "device".
-bool QEglContext::openDisplay(QPaintDevice *device)
-{
- if (dpy == EGL_NO_DISPLAY)
- dpy = defaultDisplay(device);
- return (dpy != EGL_NO_DISPLAY);
-}
-
// Choose a configuration that matches "properties".
bool QEglContext::chooseConfig
(const QEglProperties& properties, QEgl::PixelFormatMatch match)
@@ -102,13 +95,13 @@ bool QEglContext::chooseConfig
do {
// Get the number of matching configurations for this set of properties.
EGLint matching = 0;
- if (!eglChooseConfig(dpy, props.properties(), 0, 0, &matching) || !matching)
+ if (!eglChooseConfig(display(), props.properties(), 0, 0, &matching) || !matching)
continue;
// If we want the best pixel format, then return the first
// matching configuration.
if (match == QEgl::BestPixelFormat) {
- eglChooseConfig(dpy, props.properties(), &cfg, 1, &matching);
+ eglChooseConfig(display(), props.properties(), &cfg, 1, &matching);
if (matching < 1)
continue;
return true;
@@ -118,13 +111,13 @@ bool QEglContext::chooseConfig
// first that matches the pixel format we wanted.
EGLint size = matching;
EGLConfig *configs = new EGLConfig [size];
- eglChooseConfig(dpy, props.properties(), configs, size, &matching);
+ eglChooseConfig(display(), props.properties(), configs, size, &matching);
for (EGLint index = 0; index < size; ++index) {
EGLint red, green, blue, alpha;
- eglGetConfigAttrib(dpy, configs[index], EGL_RED_SIZE, &red);
- eglGetConfigAttrib(dpy, configs[index], EGL_GREEN_SIZE, &green);
- eglGetConfigAttrib(dpy, configs[index], EGL_BLUE_SIZE, &blue);
- eglGetConfigAttrib(dpy, configs[index], EGL_ALPHA_SIZE, &alpha);
+ eglGetConfigAttrib(display(), configs[index], EGL_RED_SIZE, &red);
+ eglGetConfigAttrib(display(), configs[index], EGL_GREEN_SIZE, &green);
+ eglGetConfigAttrib(display(), configs[index], EGL_BLUE_SIZE, &blue);
+ eglGetConfigAttrib(display(), configs[index], EGL_ALPHA_SIZE, &alpha);
if (red == props.value(EGL_RED_SIZE) &&
green == props.value(EGL_GREEN_SIZE) &&
blue == props.value(EGL_BLUE_SIZE) &&
@@ -179,7 +172,7 @@ bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties
if (shareContext && shareContext->ctx == EGL_NO_CONTEXT)
shareContext = 0;
if (shareContext) {
- ctx = eglCreateContext(dpy, cfg, shareContext->ctx, contextProps.properties());
+ ctx = eglCreateContext(display(), cfg, shareContext->ctx, contextProps.properties());
if (ctx == EGL_NO_CONTEXT) {
qWarning() << "QEglContext::createContext(): Could not share context:" << errorString(eglGetError());
shareContext = 0;
@@ -188,7 +181,7 @@ bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties
}
}
if (ctx == EGL_NO_CONTEXT) {
- ctx = eglCreateContext(dpy, cfg, 0, contextProps.properties());
+ ctx = eglCreateContext(display(), cfg, 0, contextProps.properties());
if (ctx == EGL_NO_CONTEXT) {
qWarning() << "QEglContext::createContext(): Unable to create EGL context:" << errorString(eglGetError());
return false;
@@ -204,16 +197,15 @@ void QEglContext::destroySurface(EGLSurface surface)
if (surface != EGL_NO_SURFACE) {
if (surface == currentSurface)
doneCurrent();
- eglDestroySurface(dpy, surface);
+ eglDestroySurface(display(), surface);
}
}
// Destroy the context. Note: this does not destroy the surface.
-void QEglContext::destroy()
+void QEglContext::destroyContext()
{
if (ctx != EGL_NO_CONTEXT && ownsContext)
- eglDestroyContext(dpy, ctx);
- dpy = EGL_NO_DISPLAY;
+ eglDestroyContext(display(), ctx);
ctx = EGL_NO_CONTEXT;
cfg = 0;
}
@@ -248,7 +240,7 @@ bool QEglContext::makeCurrent(EGLSurface surface)
eglBindAPI(EGL_OPENVG_API);
#endif
- bool ok = eglMakeCurrent(dpy, surface, surface, ctx);
+ bool ok = eglMakeCurrent(display(), surface, surface, ctx);
if (!ok)
qWarning() << "QEglContext::makeCurrent():" << errorString(eglGetError());
return ok;
@@ -277,7 +269,7 @@ bool QEglContext::doneCurrent()
eglBindAPI(EGL_OPENVG_API);
#endif
- bool ok = eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ bool ok = eglMakeCurrent(display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!ok)
qWarning() << "QEglContext::doneCurrent():" << errorString(eglGetError());
return ok;
@@ -299,7 +291,7 @@ bool QEglContext::swapBuffers(EGLSurface surface)
if(ctx == EGL_NO_CONTEXT)
return false;
- bool ok = eglSwapBuffers(dpy, surface);
+ bool ok = eglSwapBuffers(display(), surface);
if (!ok)
qWarning() << "QEglContext::swapBuffers():" << errorString(eglGetError());
return ok;
@@ -338,7 +330,7 @@ void QEglContext::waitClient()
// Query the value of a configuration attribute.
bool QEglContext::configAttrib(int name, EGLint *value) const
{
- return eglGetConfigAttrib(dpy, cfg, name, value);
+ return eglGetConfigAttrib(display(), cfg, name, value);
}
// Retrieve all of the properties on "cfg". If zero, return
@@ -350,34 +342,45 @@ QEglProperties QEglContext::configProperties(EGLConfig cfg) const
QEglProperties props;
for (int name = 0x3020; name <= 0x304F; ++name) {
EGLint value;
- if (name != EGL_NONE && eglGetConfigAttrib(dpy, cfg, name, &value))
+ if (name != EGL_NONE && eglGetConfigAttrib(display(), cfg, name, &value))
props.setValue(name, value);
}
eglGetError(); // Clear the error state.
return props;
}
-// Initialize and return the default display.
-EGLDisplay QEglContext::defaultDisplay(QPaintDevice *device)
+EGLDisplay QEglContext::display()
{
- static EGLDisplay dpy = EGL_NO_DISPLAY;
- if (dpy == EGL_NO_DISPLAY) {
- dpy = getDisplay(device);
+ static bool openedDisplay = false;
+
+ if (!openedDisplay) {
+ dpy = eglGetDisplay(nativeDisplay());
+ openedDisplay = true;
+ if (dpy == EGL_NO_DISPLAY) {
+ qWarning("QEglContext::display(): Falling back to EGL_DEFAULT_DISPLAY");
+ dpy = eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
+ }
if (dpy == EGL_NO_DISPLAY) {
- qWarning() << "QEglContext::defaultDisplay(): Cannot open EGL display";
+ qWarning("QEglContext::display(): Can't even open the default display");
return EGL_NO_DISPLAY;
}
+
if (!eglInitialize(dpy, NULL, NULL)) {
- qWarning() << "QEglContext::defaultDisplay(): Cannot initialize EGL display:" << errorString(eglGetError());
+ qWarning() << "QEglContext::display(): Cannot initialize EGL display:" << errorString(eglGetError());
return EGL_NO_DISPLAY;
}
-#ifdef EGL_OPENGL_ES_API
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
}
+
return dpy;
}
+#if !defined(Q_WS_X11) && !defined(Q_WS_WINCE) // WinCE & X11 implement this properly
+EGLNativeDisplayType QEglContext::nativeDisplay()
+{
+ return EGL_DEFAULT_DISPLAY;
+}
+#endif
+
// Return the error string associated with a specific code.
QString QEglContext::errorString(EGLint code)
{
@@ -410,10 +413,10 @@ void QEglContext::dumpAllConfigs()
{
QEglProperties props;
EGLint count = 0;
- if (!eglGetConfigs(dpy, 0, 0, &count) || count < 1)
+ if (!eglGetConfigs(display(), 0, 0, &count) || count < 1)
return;
EGLConfig *configs = new EGLConfig [count];
- eglGetConfigs(dpy, configs, count, &count);
+ eglGetConfigs(display(), configs, count, &count);
for (EGLint index = 0; index < count; ++index) {
props = configProperties(configs[index]);
qWarning() << props.toString();
@@ -423,7 +426,7 @@ void QEglContext::dumpAllConfigs()
QString QEglContext::extensions()
{
- const char* exts = eglQueryString(QEglContext::defaultDisplay(0), EGL_EXTENSIONS);
+ const char* exts = eglQueryString(QEglContext::display(), EGL_EXTENSIONS);
return QString(QLatin1String(exts));
}
@@ -431,7 +434,7 @@ bool QEglContext::hasExtension(const char* extensionName)
{
QList<QByteArray> extensions =
QByteArray(reinterpret_cast<const char *>
- (eglQueryString(QEglContext::defaultDisplay(0), EGL_EXTENSIONS))).split(' ');
+ (eglQueryString(QEglContext::display(), EGL_EXTENSIONS))).split(' ');
return extensions.contains(extensionName);
}
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
index a7de9c8..87ed818 100644
--- a/src/gui/egl/qegl_p.h
+++ b/src/gui/egl/qegl_p.h
@@ -86,14 +86,12 @@ public:
QEgl::API api() const { return apiType; }
void setApi(QEgl::API api) { apiType = api; }
- bool openDisplay(QPaintDevice *device);
bool chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match = QEgl::ExactPixelFormat);
bool createContext(QEglContext *shareContext = 0, const QEglProperties *properties = 0);
+ void destroyContext();
EGLSurface createSurface(QPaintDevice *device, const QEglProperties *properties = 0);
void destroySurface(EGLSurface surface);
- void destroy();
-
bool makeCurrent(EGLSurface surface);
bool doneCurrent();
bool lazyDoneCurrent();
@@ -108,7 +106,7 @@ public:
static EGLint error() { return eglGetError(); }
static QString errorString(EGLint code);
- EGLDisplay display() const { return dpy; }
+ static EGLDisplay display();
EGLContext context() const { return ctx; }
void setContext(EGLContext context) { ctx = context; ownsContext = false;}
@@ -118,8 +116,6 @@ public:
QEglProperties configProperties(EGLConfig cfg = 0) const;
- static EGLDisplay defaultDisplay(QPaintDevice *device);
-
void dumpAllConfigs();
static QString extensions();
@@ -127,7 +123,6 @@ public:
private:
QEgl::API apiType;
- EGLDisplay dpy;
EGLContext ctx;
EGLConfig cfg;
EGLSurface currentSurface;
@@ -135,7 +130,8 @@ private:
bool ownsContext;
bool sharing;
- static EGLDisplay getDisplay(QPaintDevice *device);
+ static EGLDisplay dpy;
+ static EGLNativeDisplayType nativeDisplay();
static QEglContext *currentContext(QEgl::API api);
static void setCurrentContext(QEgl::API api, QEglContext *context);
diff --git a/src/gui/egl/qegl_qws.cpp b/src/gui/egl/qegl_qws.cpp
index e999e0b..2a61beb 100644
--- a/src/gui/egl/qegl_qws.cpp
+++ b/src/gui/egl/qegl_qws.cpp
@@ -64,12 +64,6 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties
return EGL_NO_SURFACE;
}
-EGLDisplay QEglContext::getDisplay(QPaintDevice *device)
-{
- Q_UNUSED(device);
- return eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
-}
-
static QScreen *screenForDevice(QPaintDevice *device)
{
QScreen *screen = qt_screen;
diff --git a/src/gui/egl/qegl_symbian.cpp b/src/gui/egl/qegl_symbian.cpp
index 44ecd19..5a010cd 100644
--- a/src/gui/egl/qegl_symbian.cpp
+++ b/src/gui/egl/qegl_symbian.cpp
@@ -78,22 +78,14 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties
props = 0;
EGLSurface surf;
if (devType == QInternal::Widget)
- surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, 0);
+ surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, props);
else
- surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, 0);
+ surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, props);
if (surf == EGL_NO_SURFACE)
qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
return surf;
}
-EGLDisplay QEglContext::getDisplay(QPaintDevice *device)
-{
- EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- if (dpy == EGL_NO_DISPLAY)
- qWarning("QEglContext::defaultDisplay(): Falling back to EGL_DEFAULT_DISPLAY");
- return dpy;
-}
-
// Set pixel format and other properties based on a paint device.
void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
{
diff --git a/src/gui/egl/qegl_wince.cpp b/src/gui/egl/qegl_wince.cpp
index 026a7b1..c9c9773 100644
--- a/src/gui/egl/qegl_wince.cpp
+++ b/src/gui/egl/qegl_wince.cpp
@@ -87,20 +87,15 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties
return surf;
}
-EGLDisplay QEglContext::getDisplay(QPaintDevice *device)
+EGLNativeDisplayType QEglContext::nativeDisplay()
{
- EGLDisplay dpy = 0;
HWND win = (static_cast<QWidget*>(device))->winId();
HDC myDc = GetDC(win);
if (!myDc) {
- qWarning("QEglContext::defaultDisplay(): WinCE display is not open");
+ qWarning("QEglContext::nativeDisplay(): WinCE display is not open");
+ return EGL_DEFAULT_DISPLAY;
}
- dpy = eglGetDisplay(EGLNativeDisplayType(myDc));
- if (dpy == EGL_NO_DISPLAY) {
- qWarning("QEglContext::defaultDisplay(): Falling back to EGL_DEFAULT_DISPLAY");
- dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- }
- return dpy;
+ return EGLNativeDisplayType(myDc);
}
// Set pixel format and other properties based on a paint device.
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 2cf4e33..634ff13 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -93,15 +93,14 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties
return surf;
}
-EGLDisplay QEglContext::getDisplay(QPaintDevice *device)
+EGLNativeDisplayType QEglContext::nativeDisplay()
{
- Q_UNUSED(device);
Display *xdpy = QX11Info::display();
if (!xdpy) {
qWarning("QEglContext::getDisplay(): X11 display is not open");
- return EGL_NO_DISPLAY;
+ return EGLNativeDisplayType(EGL_DEFAULT_DISPLAY);
}
- return eglGetDisplay(EGLNativeDisplayType(xdpy));
+ return EGLNativeDisplayType(xdpy);
}
static int countBits(unsigned long mask)
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
index 2915fb9..236ec37 100644
--- a/src/gui/egl/qeglproperties.cpp
+++ b/src/gui/egl/qeglproperties.cpp
@@ -60,7 +60,7 @@ QEglProperties::QEglProperties(EGLConfig cfg)
props.append(EGL_NONE);
for (int name = 0x3020; name <= 0x304F; ++name) {
EGLint value;
- if (name != EGL_NONE && eglGetConfigAttrib(QEglContext::defaultDisplay(0), cfg, name, &value))
+ if (name != EGL_NONE && eglGetConfigAttrib(QEglContext::display(), cfg, name, &value))
setValue(name, value);
}
eglGetError(); // Clear the error state.
@@ -273,12 +273,12 @@ static void addTag(QString& str, const QString& tag)
void QEglProperties::dumpAllConfigs()
{
EGLint count = 0;
- eglGetConfigs(QEglContext::defaultDisplay(0), 0, 0, &count);
+ eglGetConfigs(QEglContext::display(), 0, 0, &count);
if (count < 1)
return;
EGLConfig *configs = new EGLConfig [count];
- eglGetConfigs(QEglContext::defaultDisplay(0), configs, count, &count);
+ eglGetConfigs(QEglContext::display(), configs, count, &count);
for (EGLint index = 0; index < count; ++index)
qWarning() << QEglProperties(configs[index]).toString();
delete [] configs;
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 54914b3..ca20101 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -357,19 +357,22 @@
default, child items are stacked on top of the parent item. But setting
this flag, the child will be stacked behind it. This flag is useful for
drop shadow effects and for decoration objects that follow the parent
- item's geometry without drawing on top of it.
+ item's geometry without drawing on top of it. This flag was introduced
+ in Qt 4.5.
\value ItemUsesExtendedStyleOption The item makes use of either
- \l{QStyleOptionGraphicsItem::}{exposedRect} or
- \l{QStyleOptionGraphicsItem::}{matrix} in QStyleOptionGraphicsItem. By default,
- the \l{QStyleOptionGraphicsItem::}{exposedRect} is initialized to the item's
- boundingRect() and the \l{QStyleOptionGraphicsItem::}{matrix} is untransformed.
- You can enable this flag for the style options to be set up with more
- fine-grained values.
- Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
+ \l{QStyleOptionGraphicsItem::} {exposedRect} or
+ \l{QStyleOptionGraphicsItem::} {matrix} in
+ QStyleOptionGraphicsItem. By default, the
+ \l{QStyleOptionGraphicsItem::} {exposedRect} is initialized to the
+ item's boundingRect() and the
+ \l{QStyleOptionGraphicsItem::}{matrix} is untransformed. You can
+ enable this flag for the style options to be set up with more
+ fine-grained values. Note that
+ QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag
and always initialized to 1. Use
- QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need a higher
- value.
+ QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need
+ a higher value. This flag was introduced in Qt 4.6.
\value ItemHasNoContents The item does not paint anything (i.e., calling
paint() on the item has no effect). You should set this flag on items that
@@ -387,9 +390,10 @@
used for Asian languages.
This flag was introduced in Qt 4.6.
- \value ItemNegativeZStacksBehindParent The item automatically stacks behind
- it's parent if it's z-value is negative. This flag enables setZValue() to
- toggle ItemStacksBehindParent.
+ \value ItemNegativeZStacksBehindParent The item automatically
+ stacks behind it's parent if it's z-value is negative. This flag
+ enables setZValue() to toggle ItemStacksBehindParent. This flag
+ was introduced in Qt 4.6.
\value ItemIsPanel The item is a panel. A panel provides activation and
contained focus handling. Only one panel can be active at a time (see
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 3280e86..aaae88e 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5134,6 +5134,8 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
}
/*!
+ \obsolete
+
Paints the given \a items using the provided \a painter, after the
background has been drawn, and before the foreground has been
drawn. All painting is done in \e scene coordinates. Before
@@ -5156,7 +5158,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
\snippet doc/src/snippets/graphicssceneadditemsnippet.cpp 0
- \obsolete Since Qt 4.6, this function is not called anymore unless
+ Since Qt 4.6, this function is not called anymore unless
the QGraphicsView::IndirectPainting flag is given as an Optimization
flag.
@@ -5712,8 +5714,15 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent)
item->d_ptr->acceptedTouchBeginEvent = true;
bool res = sendTouchBeginEvent(item, &touchEvent)
&& touchEvent.isAccepted();
- if (!res)
+ if (!res) {
+ // forget about these touch points, we didn't handle them
+ for (int i = 0; i < touchEvent.touchPoints().count(); ++i) {
+ const QTouchEvent::TouchPoint &touchPoint = touchEvent.touchPoints().at(i);
+ itemForTouchPointId.remove(touchPoint.id());
+ sceneCurrentTouchPoints.remove(touchPoint.id());
+ }
ignoreSceneTouchEvent = false;
+ }
break;
}
default:
@@ -5904,13 +5913,21 @@ void QGraphicsScenePrivate::getGestureTargets(const QSet<QGesture *> &gestures,
QList<QGraphicsItem *> items = itemsAtPosition(screenPos, QPointF(), viewport);
QList<QGraphicsObject *> result;
for (int j = 0; j < items.size(); ++j) {
- QGraphicsObject *item = items.at(j)->toGraphicsObject();
- if (!item)
- continue;
- QGraphicsItemPrivate *d = item->QGraphicsItem::d_func();
- if (d->gestureContext.contains(gestureType)) {
- result.append(item);
+ QGraphicsItem *item = items.at(j);
+
+ // Check if the item is blocked by a modal panel and use it as
+ // a target instead of this item.
+ (void) item->isBlockedByModalPanel(&item);
+
+ if (QGraphicsObject *itemobj = item->toGraphicsObject()) {
+ QGraphicsItemPrivate *d = item->d_func();
+ if (d->gestureContext.contains(gestureType)) {
+ result.append(itemobj);
+ }
}
+ // Don't propagate through panels.
+ if (item->isPanel())
+ break;
}
DEBUG() << "QGraphicsScenePrivate::getGestureTargets:"
<< gesture << result;
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 96b9373..06b7438 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3609,6 +3609,8 @@ void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect)
}
/*!
+ \obsolete
+
Draws the items \a items in the scene using \a painter, after the
background and before the foreground are drawn. \a numItems is the number
of items in \a items and options in \a options. \a options is a list of
@@ -3617,7 +3619,7 @@ void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect)
The default implementation calls the scene's drawItems() function.
- \obsolete Since Qt 4.6, this function is not called anymore unless
+ Since Qt 4.6, this function is not called anymore unless
the QGraphicsView::IndirectPainting flag is given as an Optimization
flag.
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 8ad3bac..d46f3b4 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -51,8 +51,27 @@ contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri)
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
DEFINES += Q_INTERNAL_QAPP_SRC
-symbian:TARGET.UID3=0x2001B2DD
+symbian: {
+ TARGET.UID3=0x2001B2DD
+
+ # ro-section in gui can exceed default allocated space, so move rw-section a little further
+ QMAKE_LFLAGS.ARMCC += --rw-base 0x800000
+ QMAKE_LFLAGS.GCCE += -Tdata 0xC00000
+
+ # Partial upgrade SIS file
+ vendorinfo = \
+ "&EN" \
+ "; Localised Vendor name" \
+ "%{\"Nokia, Qt\"}" \
+ " " \
+ "; Unique Vendor name" \
+ ":\"Nokia, Qt\"" \
+ " "
+ pu_header = "; Partial upgrade package for testing QtGui changes without reinstalling everything" \
+ "$${LITERAL_HASH}{\"Qt gui\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU"
+ partial_upgrade.pkg_prerules = pu_header vendorinfo
+ partial_upgrade.sources = qtgui.dll
+ partial_upgrade.path = c:/sys/bin
+ DEPLOYMENT = partial_upgrade $$DEPLOYMENT
+}
-# ro-section in gui can exceed default allocated space, so more rw-section little further
-symbian-sbsv2: QMAKE_LFLAGS.ARMCC += --rw-base 0x800000
-symbian: QMAKE_LFLAGS.GCCE += -Tdata 0xC00000
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index ace4bb6..517fcb0 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -122,19 +122,32 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key)
qt_image_cleanup_hook_64(key);
}
-void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap)
-{
- enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data());
-}
void QImagePixmapCleanupHooks::enableCleanupHooks(QPixmapData *pixmapData)
{
pixmapData->is_cached = true;
}
+void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap)
+{
+ enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data());
+}
+
void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image)
{
const_cast<QImage &>(image).data_ptr()->is_cached = true;
}
+bool QImagePixmapCleanupHooks::isImageCached(const QImage &image)
+{
+ return const_cast<QImage &>(image).data_ptr()->is_cached;
+}
+
+bool QImagePixmapCleanupHooks::isPixmapCached(const QPixmap &pixmap)
+{
+ return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached;
+}
+
+
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h
index 88dd3a6..eae11f4 100644
--- a/src/gui/image/qimagepixmapcleanuphooks_p.h
+++ b/src/gui/image/qimagepixmapcleanuphooks_p.h
@@ -72,6 +72,9 @@ public:
static void enableCleanupHooks(const QPixmap &pixmap);
static void enableCleanupHooks(QPixmapData *pixmapData);
+ static bool isImageCached(const QImage &image);
+ static bool isPixmapCached(const QPixmap &pixmap);
+
// Gets called when a pixmap data is about to be modified:
void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd);
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 7cafbd0..ae62f06 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1690,10 +1690,9 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
\o
The hasAlphaChannel() returns true if the pixmap has a format that
- respects the alpha channel, otherwise returns false, while the
- hasAlpha() function returns true if the pixmap has an alpha
- channel \e or a mask (otherwise false). The mask() function returns
- the mask as a QBitmap object, which can be set using setMask().
+ respects the alpha channel, otherwise returns false. The hasAlpha(),
+ setMask() and mask() functions are legacy and should not be used.
+ They are potentially very slow.
The createHeuristicMask() function creates and returns a 1-bpp
heuristic mask (i.e. a QBitmap) for this pixmap. It works by
@@ -1780,6 +1779,8 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
Returns true if this pixmap has an alpha channel, \e or has a
mask, otherwise returns false.
+ \warning This is potentially an expensive operation.
+
\sa hasAlphaChannel(), mask()
*/
bool QPixmap::hasAlpha() const
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 2b91711..1ac8ace 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -113,7 +113,7 @@ void QCoeFepInputContext::update()
updateHints(false);
// For pre-5.0 SDKs, we don't do text updates on S60 side.
- if (QSysInfo::s60Version() != QSysInfo::SV_S60_5_0) {
+ if (QSysInfo::s60Version() < QSysInfo::SV_S60_5_0) {
return;
}
@@ -740,6 +740,9 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin
void QCoeFepInputContext::DoCommitFepInlineEditL()
{
commitCurrentString(false);
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
+ ReportAknEdStateEvent(QT_EAknCursorPositionChanged);
+
}
void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction)
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index cbd9a8a..adf3ce3 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1540,6 +1540,11 @@ bool QAbstractItemView::event(QEvent *event)
case QEvent::FontChange:
d->doDelayedItemsLayout(); // the size of the items will change
break;
+#ifdef QT_SOFTKEYS_ENABLED
+ case QEvent::LanguageChange:
+ d->doneSoftKey->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::DoneSoftKey));
+ break;
+#endif
default:
break;
}
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index d0fa22d..706d2a8 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2474,10 +2474,11 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end)
QVector<QTreeViewItem> insertedItems(delta);
for (int i = 0; i < delta; ++i) {
- insertedItems[i].index = d->model->index(i + start, 0, parent);
- insertedItems[i].level = childLevel;
- insertedItems[i].hasChildren = d->hasVisibleChildren(insertedItems[i].index);
- insertedItems[i].hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1));
+ QTreeViewItem &item = insertedItems[i];
+ item.index = d->model->index(i + start, 0, parent);
+ item.level = childLevel;
+ item.hasChildren = d->hasVisibleChildren(item.index);
+ item.hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1));
}
if (d->viewItems.isEmpty())
d->defaultItemHeight = indexRowSizeHint(insertedItems[0].index);
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index 8a67dee..99b77d0 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -497,6 +497,14 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSOtherMouseDragged:
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+ case NSEventTypeGesture: // touch events
+ case NSEventTypeMagnify:
+ case NSEventTypeSwipe:
+ case NSEventTypeRotate:
+ case NSEventTypeBeginGesture:
+ case NSEventTypeEndGesture:
+#endif
result = true;
break;
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 6d108b0..c9a94ee 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -55,24 +55,24 @@ QT_BEGIN_NAMESPACE
QSoftKeyManager *QSoftKeyManagerPrivate::self = 0;
-const char *QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey)
+QString QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey)
{
- const char *softKeyText = 0;
+ QString softKeyText;
switch (standardKey) {
case OkSoftKey:
- softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Ok");
+ softKeyText = QSoftKeyManager::tr("Ok");
break;
case SelectSoftKey:
- softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Select");
+ softKeyText = QSoftKeyManager::tr("Select");
break;
case DoneSoftKey:
- softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Done");
+ softKeyText = QSoftKeyManager::tr("Done");
break;
case MenuSoftKey:
- softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Options");
+ softKeyText = QSoftKeyManager::tr("Options");
break;
case CancelSoftKey:
- softKeyText = QT_TRANSLATE_NOOP("QSoftKeyManager", "Cancel");
+ softKeyText = QSoftKeyManager::tr("Cancel");
break;
default:
break;
@@ -100,8 +100,7 @@ QSoftKeyManager::QSoftKeyManager() :
QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget)
{
- const char* text = standardSoftKeyText(standardKey);
- QAction *action = new QAction(QSoftKeyManager::tr(text), actionWidget);
+ QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget);
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
case MenuSoftKey: // FALL-THROUGH
@@ -211,13 +210,11 @@ bool QSoftKeyManager::handleUpdateSoftKeys()
d->requestedSoftKeyActions.clear();
bool recursiveMerging = false;
QWidget *source = softkeySource(NULL, recursiveMerging);
- do {
- if (source) {
- bool added = appendSoftkeys(*source, level);
- source = softkeySource(source, recursiveMerging);
- level = added ? ++level : level;
- }
- } while (source);
+ while (source) {
+ if (appendSoftkeys(*source, level))
+ ++level;
+ source = softkeySource(source, recursiveMerging);
+ }
d->updateSoftKeys_sys();
return true;
diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h
index ce902fe..a6fe17e 100644
--- a/src/gui/kernel/qsoftkeymanager_p.h
+++ b/src/gui/kernel/qsoftkeymanager_p.h
@@ -87,6 +87,7 @@ public:
static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget);
static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget);
+ static QString standardSoftKeyText(StandardSoftKey standardKey);
protected:
bool event(QEvent *e);
@@ -94,7 +95,6 @@ protected:
private:
QSoftKeyManager();
static QSoftKeyManager *instance();
- static const char *standardSoftKeyText(StandardSoftKey standardKey);
bool appendSoftkeys(const QWidget &source, int level);
QWidget *softkeySource(QWidget *previousSource, bool& recursiveMerging);
bool handleUpdateSoftKeys();
diff --git a/src/gui/painting/qcups.cpp b/src/gui/painting/qcups.cpp
index 7903762..ac41692 100644
--- a/src/gui/painting/qcups.cpp
+++ b/src/gui/painting/qcups.cpp
@@ -342,7 +342,9 @@ bool QCUPSSupport::printerHasPPD(const char *printerName)
{
if (!isAvailable())
return false;
- return _cupsGetPPD(printerName) != 0;
+ const char *ppdFile = _cupsGetPPD(printerName);
+ unlink(ppdFile);
+ return (ppdFile != 0);
}
QString QCUPSSupport::unicodeString(const char *s)
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 7a3da20..070491d 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -8092,20 +8092,43 @@ void qInitDrawhelperAsm()
qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_sse3dnow;
}
#endif // 3DNOW
- extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
- qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
- qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
- }
+
+#ifdef QT_HAVE_SSE2
+ if (features & SSE2) {
+ extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+ } else
+#endif
+ {
+ extern void qt_blend_rgb32_on_rgb32_sse(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ extern void qt_blend_argb32_on_argb32_sse(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse;
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse;
+ }
+}
#endif // SSE
#ifdef QT_HAVE_IWMMXT
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 25860a0..77c5202 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -48,43 +48,43 @@
QT_BEGIN_NAMESPACE
-static inline int16x8_t qvdiv_255_s16(int16x8_t x, int16x8_t half)
+static inline uint16x8_t qvdiv_255_u16(uint16x8_t x, uint16x8_t half)
{
// result = (x + (x >> 8) + 0x80) >> 8
- const int16x8_t temp = vshrq_n_s16(x, 8); // x >> 8
- const int16x8_t sum_part = vaddq_s16(x, half); // x + 0x80
- const int16x8_t sum = vaddq_s16(temp, sum_part);
+ const uint16x8_t temp = vshrq_n_u16(x, 8); // x >> 8
+ const uint16x8_t sum_part = vaddq_u16(x, half); // x + 0x80
+ const uint16x8_t sum = vaddq_u16(temp, sum_part);
- return vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(sum), 8));
+ return vshrq_n_u16(sum, 8);
}
-static inline int16x8_t qvbyte_mul_s16(int16x8_t x, int16x8_t alpha, int16x8_t half)
+static inline uint16x8_t qvbyte_mul_u16(uint16x8_t x, uint16x8_t alpha, uint16x8_t half)
{
// t = qRound(x * alpha / 255.0)
- const int16x8_t t = vmulq_s16(x, alpha); // t
- return qvdiv_255_s16(t, half);
+ const uint16x8_t t = vmulq_u16(x, alpha); // t
+ return qvdiv_255_u16(t, half);
}
-static inline int16x8_t qvinterpolate_pixel_255(int16x8_t x, int16x8_t a, int16x8_t y, int16x8_t b, int16x8_t half)
+static inline uint16x8_t qvinterpolate_pixel_255(uint16x8_t x, uint16x8_t a, uint16x8_t y, uint16x8_t b, uint16x8_t half)
{
// t = x * a + y * b
- const int16x8_t ta = vmulq_s16(x, a);
- const int16x8_t tb = vmulq_s16(y, b);
+ const uint16x8_t ta = vmulq_u16(x, a);
+ const uint16x8_t tb = vmulq_u16(y, b);
- return qvdiv_255_s16(vaddq_s16(ta, tb), half);
+ return qvdiv_255_u16(vaddq_u16(ta, tb), half);
}
-static inline int16x8_t qvsource_over_s16(int16x8_t src16, int16x8_t dst16, int16x8_t half, int16x8_t full)
+static inline uint16x8_t qvsource_over_u16(uint16x8_t src16, uint16x8_t dst16, uint16x8_t half, uint16x8_t full)
{
- const int16x4_t alpha16_high = vdup_lane_s16(vget_high_s16(src16), 3);
- const int16x4_t alpha16_low = vdup_lane_s16(vget_low_s16(src16), 3);
+ const uint16x4_t alpha16_high = vdup_lane_u16(vget_high_u16(src16), 3);
+ const uint16x4_t alpha16_low = vdup_lane_u16(vget_low_u16(src16), 3);
- const int16x8_t alpha16 = vsubq_s16(full, vcombine_s16(alpha16_low, alpha16_high));
+ const uint16x8_t alpha16 = vsubq_u16(full, vcombine_u16(alpha16_low, alpha16_high));
- return vaddq_s16(src16, qvbyte_mul_s16(dst16, alpha16, half));
+ return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half));
}
void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
@@ -94,21 +94,21 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
{
const uint *src = (const uint *) srcPixels;
uint *dst = (uint *) destPixels;
- int16x8_t half = vdupq_n_s16(0x80);
- int16x8_t full = vdupq_n_s16(0xff);
+ uint16x8_t half = vdupq_n_u16(0x80);
+ uint16x8_t full = vdupq_n_u16(0xff);
if (const_alpha == 256) {
for (int y = 0; y < h; ++y) {
int x = 0;
for (; x < w-3; x += 4) {
- int32x4_t src32 = vld1q_s32((int32_t *)&src[x]);
+ uint32x4_t src32 = vld1q_u32((uint32_t *)&src[x]);
if ((src[x] & src[x+1] & src[x+2] & src[x+3]) >= 0xff000000) {
// all opaque
- vst1q_s32((int32_t *)&dst[x], src32);
+ vst1q_u32((uint32_t *)&dst[x], src32);
} else if (src[x] | src[x+1] | src[x+2] | src[x+3]) {
- int32x4_t dst32 = vld1q_s32((int32_t *)&dst[x]);
+ uint32x4_t dst32 = vld1q_u32((uint32_t *)&dst[x]);
- const uint8x16_t src8 = vreinterpretq_u8_s32(src32);
- const uint8x16_t dst8 = vreinterpretq_u8_s32(dst32);
+ const uint8x16_t src8 = vreinterpretq_u8_u32(src32);
+ const uint8x16_t dst8 = vreinterpretq_u8_u32(dst32);
const uint8x8_t src8_low = vget_low_u8(src8);
const uint8x8_t dst8_low = vget_low_u8(dst8);
@@ -116,19 +116,19 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
const uint8x8_t src8_high = vget_high_u8(src8);
const uint8x8_t dst8_high = vget_high_u8(dst8);
- const int16x8_t src16_low = vreinterpretq_s16_u16(vmovl_u8(src8_low));
- const int16x8_t dst16_low = vreinterpretq_s16_u16(vmovl_u8(dst8_low));
+ const uint16x8_t src16_low = vmovl_u8(src8_low);
+ const uint16x8_t dst16_low = vmovl_u8(dst8_low);
- const int16x8_t src16_high = vreinterpretq_s16_u16(vmovl_u8(src8_high));
- const int16x8_t dst16_high = vreinterpretq_s16_u16(vmovl_u8(dst8_high));
+ const uint16x8_t src16_high = vmovl_u8(src8_high);
+ const uint16x8_t dst16_high = vmovl_u8(dst8_high);
- const int16x8_t result16_low = qvsource_over_s16(src16_low, dst16_low, half, full);
- const int16x8_t result16_high = qvsource_over_s16(src16_high, dst16_high, half, full);
+ const uint16x8_t result16_low = qvsource_over_u16(src16_low, dst16_low, half, full);
+ const uint16x8_t result16_high = qvsource_over_u16(src16_high, dst16_high, half, full);
- const int32x2_t result32_low = vreinterpret_s32_s8(vmovn_s16(result16_low));
- const int32x2_t result32_high = vreinterpret_s32_s8(vmovn_s16(result16_high));
+ const uint32x2_t result32_low = vreinterpret_u32_u8(vmovn_u16(result16_low));
+ const uint32x2_t result32_high = vreinterpret_u32_u8(vmovn_u16(result16_high));
- vst1q_s32((int32_t *)&dst[x], vcombine_s32(result32_low, result32_high));
+ vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
}
}
for (; x<w; ++x) {
@@ -143,16 +143,16 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
}
} else if (const_alpha != 0) {
const_alpha = (const_alpha * 255) >> 8;
- int16x8_t const_alpha16 = vdupq_n_s16(const_alpha);
+ uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha);
for (int y = 0; y < h; ++y) {
int x = 0;
for (; x < w-3; x += 4) {
if (src[x] | src[x+1] | src[x+2] | src[x+3]) {
- int32x4_t src32 = vld1q_s32((int32_t *)&src[x]);
- int32x4_t dst32 = vld1q_s32((int32_t *)&dst[x]);
+ uint32x4_t src32 = vld1q_u32((uint32_t *)&src[x]);
+ uint32x4_t dst32 = vld1q_u32((uint32_t *)&dst[x]);
- const uint8x16_t src8 = vreinterpretq_u8_s32(src32);
- const uint8x16_t dst8 = vreinterpretq_u8_s32(dst32);
+ const uint8x16_t src8 = vreinterpretq_u8_u32(src32);
+ const uint8x16_t dst8 = vreinterpretq_u8_u32(dst32);
const uint8x8_t src8_low = vget_low_u8(src8);
const uint8x8_t dst8_low = vget_low_u8(dst8);
@@ -160,22 +160,22 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
const uint8x8_t src8_high = vget_high_u8(src8);
const uint8x8_t dst8_high = vget_high_u8(dst8);
- const int16x8_t src16_low = vreinterpretq_s16_u16(vmovl_u8(src8_low));
- const int16x8_t dst16_low = vreinterpretq_s16_u16(vmovl_u8(dst8_low));
+ const uint16x8_t src16_low = vmovl_u8(src8_low);
+ const uint16x8_t dst16_low = vmovl_u8(dst8_low);
- const int16x8_t src16_high = vreinterpretq_s16_u16(vmovl_u8(src8_high));
- const int16x8_t dst16_high = vreinterpretq_s16_u16(vmovl_u8(dst8_high));
+ const uint16x8_t src16_high = vmovl_u8(src8_high);
+ const uint16x8_t dst16_high = vmovl_u8(dst8_high);
- const int16x8_t srcalpha16_low = qvbyte_mul_s16(src16_low, const_alpha16, half);
- const int16x8_t srcalpha16_high = qvbyte_mul_s16(src16_high, const_alpha16, half);
+ const uint16x8_t srcalpha16_low = qvbyte_mul_u16(src16_low, const_alpha16, half);
+ const uint16x8_t srcalpha16_high = qvbyte_mul_u16(src16_high, const_alpha16, half);
- const int16x8_t result16_low = qvsource_over_s16(srcalpha16_low, dst16_low, half, full);
- const int16x8_t result16_high = qvsource_over_s16(srcalpha16_high, dst16_high, half, full);
+ const uint16x8_t result16_low = qvsource_over_u16(srcalpha16_low, dst16_low, half, full);
+ const uint16x8_t result16_high = qvsource_over_u16(srcalpha16_high, dst16_high, half, full);
- const int32x2_t result32_low = vreinterpret_s32_s8(vmovn_s16(result16_low));
- const int32x2_t result32_high = vreinterpret_s32_s8(vmovn_s16(result16_high));
+ const uint32x2_t result32_low = vreinterpret_u32_u8(vmovn_u16(result16_low));
+ const uint32x2_t result32_high = vreinterpret_u32_u8(vmovn_u16(result16_high));
- vst1q_s32((int32_t *)&dst[x], vcombine_s32(result32_low, result32_high));
+ vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
}
}
for (; x<w; ++x) {
@@ -206,19 +206,19 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
if (const_alpha != 0) {
const uint *src = (const uint *) srcPixels;
uint *dst = (uint *) destPixels;
- int16x8_t half = vdupq_n_s16(0x80);
+ uint16x8_t half = vdupq_n_u16(0x80);
const_alpha = (const_alpha * 255) >> 8;
int one_minus_const_alpha = 255 - const_alpha;
- int16x8_t const_alpha16 = vdupq_n_s16(const_alpha);
- int16x8_t one_minus_const_alpha16 = vdupq_n_s16(255 - const_alpha);
+ uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha);
+ uint16x8_t one_minus_const_alpha16 = vdupq_n_u16(255 - const_alpha);
for (int y = 0; y < h; ++y) {
int x = 0;
for (; x < w-3; x += 4) {
- int32x4_t src32 = vld1q_s32((int32_t *)&src[x]);
- int32x4_t dst32 = vld1q_s32((int32_t *)&dst[x]);
+ uint32x4_t src32 = vld1q_u32((uint32_t *)&src[x]);
+ uint32x4_t dst32 = vld1q_u32((uint32_t *)&dst[x]);
- const uint8x16_t src8 = vreinterpretq_u8_s32(src32);
- const uint8x16_t dst8 = vreinterpretq_u8_s32(dst32);
+ const uint8x16_t src8 = vreinterpretq_u8_u32(src32);
+ const uint8x16_t dst8 = vreinterpretq_u8_u32(dst32);
const uint8x8_t src8_low = vget_low_u8(src8);
const uint8x8_t dst8_low = vget_low_u8(dst8);
@@ -226,19 +226,19 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
const uint8x8_t src8_high = vget_high_u8(src8);
const uint8x8_t dst8_high = vget_high_u8(dst8);
- const int16x8_t src16_low = vreinterpretq_s16_u16(vmovl_u8(src8_low));
- const int16x8_t dst16_low = vreinterpretq_s16_u16(vmovl_u8(dst8_low));
+ const uint16x8_t src16_low = vmovl_u8(src8_low);
+ const uint16x8_t dst16_low = vmovl_u8(dst8_low);
- const int16x8_t src16_high = vreinterpretq_s16_u16(vmovl_u8(src8_high));
- const int16x8_t dst16_high = vreinterpretq_s16_u16(vmovl_u8(dst8_high));
+ const uint16x8_t src16_high = vmovl_u8(src8_high);
+ const uint16x8_t dst16_high = vmovl_u8(dst8_high);
- const int16x8_t result16_low = qvinterpolate_pixel_255(src16_low, const_alpha16, dst16_low, one_minus_const_alpha16, half);
- const int16x8_t result16_high = qvinterpolate_pixel_255(src16_high, const_alpha16, dst16_high, one_minus_const_alpha16, half);
+ const uint16x8_t result16_low = qvinterpolate_pixel_255(src16_low, const_alpha16, dst16_low, one_minus_const_alpha16, half);
+ const uint16x8_t result16_high = qvinterpolate_pixel_255(src16_high, const_alpha16, dst16_high, one_minus_const_alpha16, half);
- const int32x2_t result32_low = vreinterpret_s32_s8(vmovn_s16(result16_low));
- const int32x2_t result32_high = vreinterpret_s32_s8(vmovn_s16(result16_high));
+ const uint32x2_t result32_low = vreinterpret_u32_u8(vmovn_u16(result16_low));
+ const uint32x2_t result32_high = vreinterpret_u32_u8(vmovn_u16(result16_high));
- vst1q_s32((int32_t *)&dst[x], vcombine_s32(result32_low, result32_high));
+ vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
}
for (; x<w; ++x) {
uint s = src[x];
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index dd6fa1b..6ac64d3 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -57,6 +57,217 @@
QT_BEGIN_NAMESPACE
+/*
+ * Multiply the components of pixelVector by alphaChannel
+ * Each 32bits components of alphaChannel must be in the form 0x00AA00AA
+ * colorMask must have 0x00ff00ff on each 32 bits component
+ * half must have the value 128 (0x80) for each 32 bits compnent
+ */
+#define BYTE_MUL_SSE2(result, pixelVector, alphaChannel, colorMask, half) \
+{ \
+ /* 1. separate the colors in 2 vectors so each color is on 16 bits \
+ (in order to be multiplied by the alpha \
+ each 32 bit of dstVectorAG are in the form 0x00AA00GG \
+ each 32 bit of dstVectorRB are in the form 0x00RR00BB */\
+ __m128i pixelVectorAG = _mm_srli_epi16(pixelVector, 8); \
+ __m128i pixelVectorRB = _mm_and_si128(pixelVector, colorMask); \
+ \
+ /* 2. multiply the vectors by the alpha channel */\
+ pixelVectorAG = _mm_mullo_epi16(pixelVectorAG, alphaChannel); \
+ pixelVectorRB = _mm_mullo_epi16(pixelVectorRB, alphaChannel); \
+ \
+ /* 3. devide by 255, that's the tricky part. \
+ we do it like for BYTE_MUL(), with bit shift: X/255 ~= (X + X/256 + rounding)/256 */ \
+ /** so first (X + X/256 + rounding) */\
+ pixelVectorRB = _mm_add_epi16(pixelVectorRB, _mm_srli_epi16(pixelVectorRB, 8)); \
+ pixelVectorRB = _mm_add_epi16(pixelVectorRB, half); \
+ pixelVectorAG = _mm_add_epi16(pixelVectorAG, _mm_srli_epi16(pixelVectorAG, 8)); \
+ pixelVectorAG = _mm_add_epi16(pixelVectorAG, half); \
+ \
+ /** second devide by 256 */\
+ pixelVectorRB = _mm_srli_epi16(pixelVectorRB, 8); \
+ /** for AG, we could >> 8 to divide followed by << 8 to put the \
+ bytes in the correct position. By masking instead, we execute \
+ only one instruction */\
+ pixelVectorAG = _mm_andnot_si128(colorMask, pixelVectorAG); \
+ \
+ /* 4. combine the 2 pairs of colors */ \
+ result = _mm_or_si128(pixelVectorAG, pixelVectorRB); \
+}
+
+/*
+ * Each 32bits components of alphaChannel must be in the form 0x00AA00AA
+ * oneMinusAlphaChannel must be 255 - alpha for each 32 bits component
+ * colorMask must have 0x00ff00ff on each 32 bits component
+ * half must have the value 128 (0x80) for each 32 bits compnent
+ */
+#define INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, alphaChannel, oneMinusAlphaChannel, colorMask, half) { \
+ /* interpolate AG */\
+ __m128i srcVectorAG = _mm_srli_epi16(srcVector, 8); \
+ __m128i dstVectorAG = _mm_srli_epi16(dstVector, 8); \
+ __m128i srcVectorAGalpha = _mm_mullo_epi16(srcVectorAG, alphaChannel); \
+ __m128i dstVectorAGoneMinusAlphalpha = _mm_mullo_epi16(dstVectorAG, oneMinusAlphaChannel); \
+ __m128i finalAG = _mm_add_epi16(srcVectorAGalpha, dstVectorAGoneMinusAlphalpha); \
+ finalAG = _mm_add_epi16(finalAG, _mm_srli_epi16(finalAG, 8)); \
+ finalAG = _mm_add_epi16(finalAG, half); \
+ finalAG = _mm_andnot_si128(colorMask, finalAG); \
+ \
+ /* interpolate RB */\
+ __m128i srcVectorRB = _mm_and_si128(srcVector, colorMask); \
+ __m128i dstVectorRB = _mm_and_si128(dstVector, colorMask); \
+ __m128i srcVectorRBalpha = _mm_mullo_epi16(srcVectorRB, alphaChannel); \
+ __m128i dstVectorRBoneMinusAlphalpha = _mm_mullo_epi16(dstVectorRB, oneMinusAlphaChannel); \
+ __m128i finalRB = _mm_add_epi16(srcVectorRBalpha, dstVectorRBoneMinusAlphalpha); \
+ finalRB = _mm_add_epi16(finalRB, _mm_srli_epi16(finalRB, 8)); \
+ finalRB = _mm_add_epi16(finalRB, half); \
+ finalRB = _mm_srli_epi16(finalRB, 8); \
+ \
+ /* combine */\
+ result = _mm_or_si128(finalAG, finalRB); \
+}
+
+void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const quint32 *src = (const quint32 *) srcPixels;
+ quint32 *dst = (uint *) destPixels;
+ if (const_alpha == 256) {
+ const __m128i alphaMask = _mm_set1_epi32(0xff000000);
+ const __m128i nullVector = _mm_set1_epi32(0);
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i one = _mm_set1_epi16(0xff);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+ for (int y = 0; y < h; ++y) {
+ int x = 0;
+ for (; x < w-3; x += 4) {
+ const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask);
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) {
+ // all opaque
+ _mm_storeu_si128((__m128i *)&dst[x], srcVector);
+ } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) {
+ // not fully transparent
+ // result = s + d * (1-alpha)
+
+ // extract the alpha channel on 2 x 16 bits
+ // so we have room for the multiplication
+ // each 32 bits will be in the form 0x00AA00AA
+ // with A being the 1 - alpha
+ __m128i alphaChannel = _mm_srli_epi32(srcVector, 24);
+ alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16));
+ alphaChannel = _mm_sub_epi16(one, alphaChannel);
+
+ const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+ __m128i destMultipliedByOneMinusAlpha;
+ BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half);
+
+ // result = s + d * (1-alpha)
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha);
+ _mm_storeu_si128((__m128i *)&dst[x], result);
+ }
+ }
+ for (; x<w; ++x) {
+ uint s = src[x];
+ if (s >= 0xff000000)
+ dst[x] = s;
+ else if (s != 0)
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else if (const_alpha != 0) {
+ // dest = (s + d * sia) * ca + d * cia
+ // = s * ca + d * (sia * ca + cia)
+ // = s * ca + d * (1 - sa*ca)
+ const_alpha = (const_alpha * 255) >> 8;
+ const __m128i nullVector = _mm_set1_epi32(0);
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i one = _mm_set1_epi16(0xff);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+ const __m128i constAlphaVector = _mm_set1_epi16(const_alpha);
+ for (int y = 0; y < h; ++y) {
+ int x = 0;
+ for (; x < w-3; x += 4) {
+ __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) {
+ BYTE_MUL_SSE2(srcVector, srcVector, constAlphaVector, colorMask, half);
+
+ __m128i alphaChannel = _mm_srli_epi32(srcVector, 24);
+ alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16));
+ alphaChannel = _mm_sub_epi16(one, alphaChannel);
+
+ const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+ __m128i destMultipliedByOneMinusAlpha;
+ BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half);
+
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha);
+ _mm_storeu_si128((__m128i *)&dst[x], result);
+ }
+ }
+ for (; x<w; ++x) {
+ quint32 s = src[x];
+ if (s != 0) {
+ s = BYTE_MUL(s, const_alpha);
+ dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
+ }
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+// qblendfunctions.cpp
+void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const quint32 *src = (const quint32 *) srcPixels;
+ quint32 *dst = (uint *) destPixels;
+ if (const_alpha != 256) {
+ if (const_alpha != 0) {
+ const __m128i nullVector = _mm_set1_epi32(0);
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+
+ const_alpha = (const_alpha * 255) >> 8;
+ int one_minus_const_alpha = 255 - const_alpha;
+ const __m128i constAlphaVector = _mm_set1_epi16(const_alpha);
+ const __m128i oneMinusConstAlpha = _mm_set1_epi16(one_minus_const_alpha);
+ for (int y = 0; y < h; ++y) {
+ int x = 0;
+ for (; x < w-3; x += 4) {
+ __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) {
+ const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+ __m128i result;
+ INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
+ _mm_storeu_si128((__m128i *)&dst[x], result);
+ }
+ }
+ for (; x<w; ++x) {
+ quint32 s = src[x];
+ s = BYTE_MUL(s, const_alpha);
+ dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha);
+ }
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+ } else {
+ qt_blend_rgb32_on_rgb32(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
+ }
+}
+
void qt_memfill32_sse2(quint32 *dest, quint32 value, int count)
{
if (count < 7) {
diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h
index 30aadd0..d7282a7 100644
--- a/src/gui/painting/qdrawhelper_x86_p.h
+++ b/src/gui/painting/qdrawhelper_x86_p.h
@@ -114,6 +114,14 @@ void qt_bitmapblit32_sse2(QRasterBuffer *rasterBuffer, int x, int y,
void qt_bitmapblit16_sse2(QRasterBuffer *rasterBuffer, int x, int y,
quint32 color,
const uchar *src, int width, int height, int stride);
+void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
#endif // QT_HAVE_SSE2
#ifdef QT_HAVE_IWMMXT
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 41c4f14..60265c5 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -101,10 +101,6 @@
#endif
#include <limits.h>
-#if defined(QT_NO_FPU) || (_MSC_VER >= 1300 && _MSC_VER < 1400)
-# define FLOATING_POINT_BUGGY_OR_NO_FPU
-#endif
-
QT_BEGIN_NAMESPACE
extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
@@ -3694,9 +3690,6 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect)
if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen)
|| (qpen_style(s->lastPen) == Qt::NoPen && !s->flags.antialiased))
&& qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT
-#ifdef FLOATING_POINT_BUGGY_OR_NO_FPU
- && qMax(rect.width(), rect.height()) < 128 // integer math breakdown
-#endif
&& s->matrix.type() <= QTransform::TxScale) // no shear
{
ensureBrush();
@@ -6069,15 +6062,9 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
ProcessSpans pen_func, ProcessSpans brush_func,
QSpanData *pen_data, QSpanData *brush_data)
{
-#ifdef FLOATING_POINT_BUGGY_OR_NO_FPU // no fpu, so use fixed point
- const QFixed a = QFixed(rect.width()) >> 1;
- const QFixed b = QFixed(rect.height()) >> 1;
- QFixed d = b*b - (a*a*b) + ((a*a) >> 2);
-#else
const qreal a = qreal(rect.width()) / 2;
const qreal b = qreal(rect.height()) / 2;
qreal d = b*b - (a*a*b) + 0.25*a*a;
-#endif
int x = 0;
int y = (rect.height() + 1) / 2;
@@ -6100,12 +6087,7 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
pen_func, brush_func, pen_data, brush_data);
// region 2
-#ifdef FLOATING_POINT_BUGGY_OR_NO_FPU
- d = b*b*(x + (QFixed(1) >> 1))*(x + (QFixed(1) >> 1))
- + a*a*((y - 1)*(y - 1) - b*b);
-#else
d = b*b*(x + 0.5)*(x + 0.5) + a*a*((y - 1)*(y - 1) - b*b);
-#endif
const int miny = rect.height() & 0x1;
while (y > miny) {
if (d < 0) { // select SE
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 1b8b718..e69512d 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -710,13 +710,14 @@ void QPainterPrivate::updateEmulationSpecifier(QPainterState *s)
bool penTextureAlpha = false;
if (penBrush.style() == Qt::TexturePattern)
penTextureAlpha = qHasPixmapTexture(penBrush)
- ? penBrush.texture().hasAlpha()
+ ? (penBrush.texture().depth() > 1) && penBrush.texture().hasAlpha()
: penBrush.textureImage().hasAlphaChannel();
bool brushTextureAlpha = false;
- if (s->brush.style() == Qt::TexturePattern)
+ if (s->brush.style() == Qt::TexturePattern) {
brushTextureAlpha = qHasPixmapTexture(s->brush)
- ? s->brush.texture().hasAlpha()
+ ? (s->brush.texture().depth() > 1) && s->brush.texture().hasAlpha()
: s->brush.textureImage().hasAlphaChannel();
+ }
if (((penBrush.style() == Qt::TexturePattern && penTextureAlpha)
|| (s->brush.style() == Qt::TexturePattern && brushTextureAlpha))
&& !engine->hasFeature(QPaintEngine::MaskedBrush))
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index ea7399f..565cc2c 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -120,6 +120,8 @@ QPixmap *QS60StylePrivate::m_background = 0;
// theme palette
QPalette *QS60StylePrivate::m_themePalette = 0;
+qint64 QS60StylePrivate::m_webPaletteKey = 0;
+
const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = {
{SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter},
{SE_ButtonPressed, QS60StyleEnums::SP_QsnFrButtonTbCenterPressed},
@@ -807,8 +809,12 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
QPalette webPalette = *palette;
webPalette.setColor(QPalette::WindowText, Qt::black);
webPalette.setColor(QPalette::Text, Qt::black);
+ webPalette.setBrush(QPalette::Base, Qt::white);
+
QApplication::setPalette(webPalette, "QWebView");
QApplication::setPalette(webPalette, "QGraphicsWebView");
+
+ m_webPaletteKey = webPalette.cacheKey();
}
QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags)
@@ -896,8 +902,11 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag
return result;
}
-bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush)
+bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush, const QWidget *widget)
{
+ // Always return true for web pages.
+ if (widget && m_webPaletteKey == QApplication::palette(widget).cacheKey())
+ return true;
//If brush is not changed from style's default values, draw theme graphics.
return (backgroundBrush.color() == Qt::transparent ||
backgroundBrush.style() == Qt::NoBrush) ? true : false;
@@ -1901,7 +1910,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_ShapedFrame:
if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) {
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option);
- if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base()))
+ if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget))
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags);
else
QCommonStyle::drawControl(element, option, painter, widget);
@@ -2013,7 +2022,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
if (widget && qobject_cast<const QComboBox *>(widget->parentWidget()))
break;
#endif
- if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()))
+ if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget))
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, painter, option->rect, flags);
else
commonStyleDraws = true;
@@ -2093,7 +2102,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_PanelButtonTool:
case PE_PanelButtonBevel:
case PE_FrameButtonBevel:
- if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) {
+ if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)) {
const bool isPressed = option->state & State_Sunken;
const QS60StylePrivate::SkinElements skinElement =
isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal;
@@ -2125,7 +2134,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
case PE_IndicatorSpinDown:
case PE_IndicatorSpinUp:
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
- if (QS60StylePrivate::canDrawThemeBackground(spinBox->palette.base())) {
+ if (QS60StylePrivate::canDrawThemeBackground(spinBox->palette.base(), widget)) {
QStyleOptionSpinBox optionSpinBox = *spinBox;
const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ?
QS60StyleEnums::SP_QgnGrafScrollArrowUp :
@@ -2140,7 +2149,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#endif //QT_NO_SPINBOX
#ifndef QT_NO_COMBOBOX
if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- if (QS60StylePrivate::canDrawThemeBackground( option->palette.base())) {
+ if (QS60StylePrivate::canDrawThemeBackground( option->palette.base(), widget)) {
// We want to draw down arrow here for comboboxes as well.
QStyleOptionFrame optionsComboBox = *cmb;
const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown;
@@ -2179,7 +2188,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#endif //QT_NO_MENU
) {
//Need extra check since dialogs have their own theme background
- if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()) &&
+ if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget) &&
option->palette.window().texture().cacheKey() ==
QS60StylePrivate::m_themePalette->window().texture().cacheKey())
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags);
@@ -2387,10 +2396,20 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case CT_PushButton:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
//FIXME properly - style should calculate the location of border frame-part
- sz += QSize(2 * pixelMetric(PM_ButtonMargin), 2 * pixelMetric(PM_ButtonMargin));
- if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget)))
+ if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) {
if (buttonWidget->isCheckable())
sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0);
+ const int iconHeight = (!buttonWidget->icon().isNull()) ? buttonWidget->iconSize().height() : 0;
+ const int textHeight = (buttonWidget->text().length() > 0) ?
+ buttonWidget->fontMetrics().size(Qt::TextSingleLine, buttonWidget->text()).height() : 0;
+ const int decoratorHeight = (buttonWidget->isCheckable()) ? pixelMetric(PM_IndicatorHeight) : 0;
+
+ const int contentHeight =
+ qMax(qMax(iconHeight, decoratorHeight) + pixelMetric(PM_ButtonMargin),
+ textHeight + 2*pixelMetric(PM_ButtonMargin));
+ sz.setHeight(contentHeight);
+ sz += QSize(2 * pixelMetric(PM_ButtonMargin), 0);
+ }
break;
case CT_LineEdit:
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt))
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index ea30b81..16d82e7 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -542,7 +542,7 @@ public:
//Checks that the current brush is transparent or has BrushStyle NoBrush,
//so that theme graphic background can be drawn.
- static bool canDrawThemeBackground(const QBrush &backgroundBrush);
+ static bool canDrawThemeBackground(const QBrush &backgroundBrush, const QWidget *widget);
static int currentAnimationFrame(QS60StyleEnums::SkinParts part);
#ifdef Q_WS_S60
@@ -596,6 +596,7 @@ private:
QPalette m_originalPalette;
QPointer<QFocusFrame> m_focusFrame;
+ static qint64 m_webPaletteKey;
#ifdef Q_WS_S60
//list of progress bars having animation running
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp
index b30a6c3..c50d363 100644
--- a/src/gui/text/qfontdatabase_win.cpp
+++ b/src/gui/text/qfontdatabase_win.cpp
@@ -336,8 +336,18 @@ void addFontToDatabase(QString familyName, const QString &scriptName,
signature->fsCsb[0], signature->fsCsb[1]
};
QList<QFontDatabase::WritingSystem> systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
- for (int i = 0; i < systems.count(); ++i)
- family->writingSystems[systems.at(i)] = QtFontFamily::Supported;
+
+ for (int i = 0; i < systems.count(); ++i) {
+ QFontDatabase::WritingSystem writingSystem = systems.at(i);
+
+ // ### Hack to work around problem with Thai text on Windows 7. Segoe UI contains
+ // the symbol for Baht, and Windows thus reports that it supports the Thai script.
+ // Since it's the default UI font on this platform, most widgets will be unable to
+ // display Thai text by default. As a temporary work around, we special case Segoe UI
+ // and remove the Thai script from its list of supported writing systems.
+ if (writingSystem != QFontDatabase::Thai || familyName != QLatin1String("Segoe UI"))
+ family->writingSystems[writingSystem] = QtFontFamily::Supported;
+ }
} else if (!family->writingSystemCheck) {
//qDebug("family='%s' script=%s", family->name.latin1(), script.latin1());
if (scriptName == QLatin1String("Western")
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 0f5792f..65b998f 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -48,7 +48,6 @@
#include <qurl.h>
#include <private/qcore_symbian_p.h>
-#include <miutset.h> // KUidMsgTypeSMTP
#include <txtrich.h> // CRichText
#include <f32file.h> // TDriveUnit etc
#include <eikenv.h> // CEikonEnv
@@ -57,6 +56,9 @@
#include <rsendas.h> // RSendAs
#include <rsendasmessage.h> // RSendAsMessage
+// copied from miutset.h, so we don't get a dependency into the app layer
+const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592
+
#ifdef Q_WS_S60
# include <pathinfo.h> // PathInfo
# ifdef USE_DOCUMENTHANDLER
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index be20a38..f71d250 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -607,7 +607,13 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e)
view->setMouseTracking(combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) ||
combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo));
setFrameStyle(combo->style()->styleHint(QStyle::SH_ComboBox_PopupFrameStyle, &opt, combo));
+#ifdef QT_SOFTKEYS_ENABLED
+ } else if (e->type() == QEvent::LanguageChange) {
+ selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey));
+ cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey));
+#endif
}
+
QWidget::changeEvent(e);
}
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index 13f31df..2b8cf59 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -2637,7 +2637,7 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
QSize bottom_max = docks[QInternal::BottomDock].maximumSize();
bottom_hint = bottom_hint.boundedTo(bottom_max).expandedTo(bottom_min);
- fallbackToSizeHints = !have_central;
+ fallbackToSizeHints = false;
if (_ver_struct_list != 0) {
QVector<QLayoutStruct> &ver_struct_list = *_ver_struct_list;
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index a63f3bf..4620597 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -1427,6 +1427,11 @@ bool QMainWindow::event(QEvent *event)
}
break;
#endif
+#ifdef QT_SOFTKEYS_ENABLED
+ case QEvent::LanguageChange:
+ d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey));
+ break;
+#endif
default:
break;
}
diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp
index fc75c92..593e391 100644
--- a/src/gui/widgets/qmainwindowlayout.cpp
+++ b/src/gui/widgets/qmainwindowlayout.cpp
@@ -1772,6 +1772,7 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget)
if (savedState.isValid()) {
#ifndef QT_NO_DOCKWIDGET
savedState.dockAreaLayout.centralWidgetItem = layoutState.dockAreaLayout.centralWidgetItem;
+ savedState.dockAreaLayout.fallbackToSizeHints = true;
#else
savedState.centralWidgetItem = layoutState.centralWidgetItem;
#endif
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 08960da..e2cf25b 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -117,7 +117,7 @@ public:
if (parentWidget->parentWidget())
parentWidget = parentWidget->parentWidget();
setParent(parentWidget, Qt::Window | Qt::Tool);
- setAttribute(Qt::WA_DeleteOnClose, true);
+ setAttribute(Qt::WA_DeleteOnClose, true);
setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true);
setWindowTitle(p->windowTitle());
setEnabled(p->isEnabled());
@@ -1226,7 +1226,7 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
else if (action->isSeparator())
option->menuItemType = QStyleOptionMenuItem::Separator;
else if (d->defaultAction == action)
- option->menuItemType = QStyleOptionMenuItem::DefaultItem;
+ option->menuItemType = QStyleOptionMenuItem::DefaultItem;
else
option->menuItemType = QStyleOptionMenuItem::Normal;
if (action->isIconVisibleInMenu())
@@ -1719,7 +1719,14 @@ bool QMenu::isEmpty() const
void QMenu::clear()
{
QList<QAction*> acts = actions();
+
for(int i = 0; i < acts.size(); i++) {
+#ifdef QT_SOFTKEYS_ENABLED
+ Q_D(QMenu);
+ // Lets not touch to our internal softkey actions
+ if(acts[i] == d->selectAction || acts[i] == d->cancelAction)
+ continue;
+#endif
removeAction(acts[i]);
if (acts[i]->parent() == this && acts[i]->d_func()->widgets.isEmpty())
delete acts[i];
@@ -2406,6 +2413,13 @@ QMenu::event(QEvent *e)
}
return true;
#endif
+#ifdef QT_SOFTKEYS_ENABLED
+ case QEvent::LanguageChange: {
+ d->selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey));
+ d->cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey));
+ }
+ break;
+#endif
default:
break;
}
@@ -2917,7 +2931,7 @@ void QMenu::actionEvent(QActionEvent *e)
#endif
if (isVisible()) {
d->updateActionRects();
- resize(sizeHint());
+ resize(sizeHint());
update();
}
}