summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-06-16 10:32:05 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-06-16 10:32:05 (GMT)
commit39d357505c7de6430f73cd5a491c2a7ddccd55ea (patch)
treea1dd8a773bdd1f685945c4c761a7bad1c9823460 /src
parent59ec66675b725f56111e4b133e79828bc6d5d95a (diff)
parent4ae3fd65f5f832a2b6a7463eb758cc0a5819ad9d (diff)
downloadQt-39d357505c7de6430f73cd5a491c2a7ddccd55ea.zip
Qt-39d357505c7de6430f73cd5a491c2a7ddccd55ea.tar.gz
Qt-39d357505c7de6430f73cd5a491c2a7ddccd55ea.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog13
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pri2
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro7
-rw-r--r--src/corelib/global/qglobal.cpp27
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp25
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp11
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp19
-rw-r--r--src/declarative/qml/qdeclarativemetatype_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h4
-rw-r--r--src/gui/image/qbmphandler.cpp10
-rw-r--r--src/gui/image/qimage.cpp13
-rw-r--r--src/gui/image/qpnghandler.cpp10
-rw-r--r--src/gui/image/qppmhandler.cpp10
-rw-r--r--src/gui/image/qxbmhandler.cpp10
-rw-r--r--src/gui/image/qxpmhandler.cpp8
-rw-r--r--src/gui/itemviews/qtreewidget.cpp4
-rw-r--r--src/gui/painting/qgrayraster.c35
-rw-r--r--src/gui/painting/qgrayraster_p.h4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp13
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp5
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/gui/painting/qrasterdefs_p.h6
-rw-r--r--src/gui/styles/qs60style.cpp105
-rw-r--r--src/gui/styles/qs60style_s60.cpp10
-rw-r--r--src/gui/text/qfontengine_ft.cpp2
-rw-r--r--src/gui/text/qstatictext.cpp34
-rw-r--r--src/gui/text/qstatictext.h5
-rw-r--r--src/gui/text/qstatictext_p.h6
-rw-r--r--src/gui/widgets/qslider.cpp2
-rw-r--r--src/plugins/imageformats/gif/qgifhandler.cpp4
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp10
-rw-r--r--src/plugins/imageformats/mng/qmnghandler.cpp8
-rw-r--r--src/s60installs/s60installs.pro4
39 files changed, 336 insertions, 127 deletions
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 125e175..07a02d7 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-0f8941d0dd5f947530e1dc55b859d810bba14764
+40c2d6907ef75288b4f15e7fad334b9138acdbbf
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 6aaae4f..b648b94 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- f943ead2759537527faa7f3cb057d995291663b9
+ 40c2d6907ef75288b4f15e7fad334b9138acdbbf
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index e04729d..6a7da30 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-06-15 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] The qt_webkit_version.pri file gets overwritten on install
+ https://bugs.webkit.org/show_bug.cgi?id=40487
+
+ Don't install qt_webkit_version.pri when building WebKit inside of Qt.
+ The import of WebKit into Qt will take care of providing the file
+ in mkspecs/modules and it'll be installed through projects.pro.
+
+ * WebCore.pro:
+
2010-06-13 Noam Rosenthal <noam.rosenthal@nokia.com>
Reviewed by Eric Seidel.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pri b/src/3rdparty/webkit/WebCore/WebCore.pri
index 9debd6a..97ae526 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pri
+++ b/src/3rdparty/webkit/WebCore/WebCore.pri
@@ -107,7 +107,7 @@ greaterThan(QT_MINOR_VERSION, 5) {
!lessThan(QT_MINOR_VERSION, 7) {
DEFINES += ENABLE_QT_BEARER=1
} else {
- load(mobilityconfig)
+ load(mobilityconfig, true)
contains(MOBILITY_CONFIG, bearer) {
DEFINES += ENABLE_QT_BEARER=1
}
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 048fc93..07ef474 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -2845,12 +2845,7 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
include($$PWD/../WebKit/qt/Api/headers.pri)
HEADERS += $$WEBKIT_API_HEADERS
-CONFIG(QTDIR_build) {
- modfile.files = $$moduleFile
- modfile.path = $$[QMAKE_MKSPECS]/modules
-
- INSTALLS += modfile
-} else {
+!CONFIG(QTDIR_build) {
exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 373c0b4..b31c83b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2503,6 +2503,19 @@ void qFatal(const char *msg, ...)
// getenv is declared as deprecated in VS2005. This function
// makes use of the new secure getenv function.
+/*!
+ \relates <QtGlobal>
+
+ Returns the value of the environment variable with name \a
+ varName. To get the variable string, use QByteArray::constData().
+
+ \note qgetenv() was introduced because getenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qgetenv()
+ uses the new replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qputenv()
+*/
QByteArray qgetenv(const char *varName)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
@@ -2522,6 +2535,20 @@ QByteArray qgetenv(const char *varName)
#endif
}
+/*!
+ \relates <QtGlobal>
+
+ This function sets the \a value of the environment variable named
+ \a varName. It will create the variable if it does not exist. It
+ returns 0 if the variable could not be set.
+
+ \note qputenv() was introduced because putenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qputenv()
+ uses the replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qgetenv()
+*/
bool qputenv(const char *varName, const QByteArray& value)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 4e6e6b9..0a5e06e 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1073,7 +1073,7 @@ void QCoreApplication::exit(int returnCode)
The event must be allocated on the heap since the post event queue
will take ownership of the event and delete it once it has been
- posted. It is \e {not safe} to modify or delete the event after
+ posted. It is \e {not safe} to access the event after
it has been posted.
When control returns to the main event loop, all events that are
@@ -1104,7 +1104,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event)
The event must be allocated on the heap since the post event queue
will take ownership of the event and delete it once it has been
- posted. It is \e {not safe} to modify or delete the event after
+ posted. It is \e {not safe} to access the event after
it has been posted.
When control returns to the main event loop, all events that are
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index fdc1444..6dfd4d9 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1214,6 +1214,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
default:
break;
}
+ stealThisEvent = d->stealMouse; // Update stealThisEvent and grabber in case changed by function calls above
grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) {
d->clearDelayedPress();
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 0be8dac..b198077 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -79,8 +79,24 @@
#endif
#include "private/qdeclarativeanchors_p.h"
+static QDeclarativePrivate::AutoParentResult qgraphicsobject_autoParent(QObject *obj, QObject *parent)
+{
+ QGraphicsObject* gobj = qobject_cast<QGraphicsObject*>(obj);
+ if (!gobj)
+ return QDeclarativePrivate::IncompatibleObject;
+
+ QGraphicsObject* gparent = qobject_cast<QGraphicsObject*>(parent);
+ if (!gparent)
+ return QDeclarativePrivate::IncompatibleParent;
+
+ gobj->setParentItem(gparent);
+ return QDeclarativePrivate::Parented;
+}
+
void QDeclarativeItemModule::defineModule()
{
+ QDeclarativePrivate::registerAutoParentFunction(qgraphicsobject_autoParent);
+
#ifdef QT_NO_MOVIE
qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage",
qApp->translate("QDeclarativeAnimatedImage","Qt was built without support for QMovie"));
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index dcf18af..48ac4a4 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1936,6 +1936,8 @@ void QDeclarativeListView::setCacheBuffer(int b)
/*!
\qmlproperty string ListView::section.property
\qmlproperty enumeration ListView::section.criteria
+ \qmlproperty Component ListView::section.delegate
+
These properties hold the expression to be evaluated for the \l section attached property.
\c section.property hold the name of the property to use to determine
@@ -1949,6 +1951,8 @@ void QDeclarativeListView::setCacheBuffer(int b)
\o ViewSection.FirstCharacter - section is the first character of the property value.
\endlist
+ \c section.delegate holds the delegate component for each section.
+
Each item in the list has attached properties named \c ListView.section and
\c ListView.prevSection. These may be used to place a section header for
related items. The example below assumes that the model is sorted by size of
@@ -1985,7 +1989,7 @@ QString QDeclarativeListView::currentSection() const
These properties hold the move and resize animation speed of the highlight delegate.
- \c highlightFollowsCurrentItem must be true for these properties
+ \l highlightFollowsCurrentItem must be true for these properties
to have effect.
The default value for the speed properties is 400 pixels/second.
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 55ee783..b4919ff 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -60,7 +60,6 @@
#include <QFileInfo>
#include <QtCore/qdebug.h>
#include <QApplication>
-#include <QGraphicsObject>
QT_BEGIN_NAMESPACE
@@ -579,20 +578,26 @@ QScriptValue QDeclarativeComponent::createObject(QObject* parent)
if (!ret)
return QScriptValue(QScriptValue::NullValue);
- QGraphicsObject* gobj = qobject_cast<QGraphicsObject*>(ret);
- bool needParent = (gobj != 0);
- if(parent){
+
+ if (parent) {
ret->setParent(parent);
- if (gobj) {
- QGraphicsObject* gparent = qobject_cast<QGraphicsObject*>(parent);
- if(gparent){
- gobj->setParentItem(gparent);
+ QList<QDeclarativePrivate::AutoParentFunction> functions = QDeclarativeMetaType::parentFunctions();
+
+ bool needParent = false;
+
+ for (int ii = 0; ii < functions.count(); ++ii) {
+ QDeclarativePrivate::AutoParentResult res = functions.at(ii)(ret, parent);
+ if (res == QDeclarativePrivate::Parented) {
needParent = false;
+ break;
+ } else if (res == QDeclarativePrivate::IncompatibleParent) {
+ needParent = true;
}
}
+
+ if (needParent)
+ qWarning("QDeclarativeComponent: Created graphical object was not placed in the graphics scene.");
}
- if(needParent)
- qWarning("QDeclarativeComponent: Created graphical object was not placed in the graphics scene.");
QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine);
QDeclarativeData::get(ret, true)->setImplicitDestructible();
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 0715624..5c4d229 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -93,7 +93,6 @@
#include <QtGui/qcolor.h>
#include <QtGui/qvector3d.h>
#include <QtGui/qsound.h>
-#include <QGraphicsObject>
#include <QtCore/qcryptographichash.h>
#include <private/qobject_p.h>
@@ -1195,10 +1194,12 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
Q_ASSERT(obj);
obj->setParent(parentArg);
- QGraphicsObject* gobj = qobject_cast<QGraphicsObject*>(obj);
- QGraphicsObject* gparent = qobject_cast<QGraphicsObject*>(parentArg);
- if(gobj && gparent)
- gobj->setParentItem(gparent);
+
+ QList<QDeclarativePrivate::AutoParentFunction> functions = QDeclarativeMetaType::parentFunctions();
+ for (int ii = 0; ii < functions.count(); ++ii) {
+ if (QDeclarativePrivate::Parented == functions.at(ii)(obj, parentArg))
+ break;
+ }
QDeclarativeData::get(obj, true)->setImplicitDestructible();
return activeEnginePriv->objectClass->newQObject(obj, QMetaType::QObjectStar);
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 5fcb7ee..c32cab6 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -112,6 +112,8 @@ struct QDeclarativeMetaTypeData
QBitArray objects;
QBitArray interfaces;
QBitArray lists;
+
+ QList<QDeclarativePrivate::AutoParentFunction> parentFunctions;
};
Q_GLOBAL_STATIC(QDeclarativeMetaTypeData, metaTypeData)
Q_GLOBAL_STATIC(QReadWriteLock, metaTypeDataLock)
@@ -483,6 +485,16 @@ int QDeclarativeType::index() const
return d->m_index;
}
+int QDeclarativePrivate::registerAutoParentFunction(AutoParentFunction function)
+{
+ QWriteLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ data->parentFunctions.append(function);
+
+ return data->parentFunctions.count() - 1;
+}
+
int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &interface)
{
if (interface.version > 0)
@@ -583,6 +595,13 @@ bool QDeclarativeMetaType::isModule(const QByteArray &module, int versionMajor,
((*it).vmajor_min == versionMajor && (*it).vminor_min <= versionMinor))));
}
+QList<QDeclarativePrivate::AutoParentFunction> QDeclarativeMetaType::parentFunctions()
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return data->parentFunctions;
+}
+
QObject *QDeclarativeMetaType::toQObject(const QVariant &v, bool *ok)
{
if (!isQObject(v.userType())) {
diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h
index bf6a700..4c98b6f 100644
--- a/src/declarative/qml/qdeclarativemetatype_p.h
+++ b/src/declarative/qml/qdeclarativemetatype_p.h
@@ -99,6 +99,8 @@ public:
static StringConverter customStringConverter(int);
static bool isModule(const QByteArray &module, int versionMajor, int versionMinor);
+
+ static QList<QDeclarativePrivate::AutoParentFunction> parentFunctions();
};
class QDeclarativeTypePrivate;
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index e657dd5..cd859fe 100644
--- a/src/declarative/qml/qdeclarativeprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -214,6 +214,10 @@ namespace QDeclarativePrivate
const char *iid;
};
+ enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent };
+ typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent);
+
+ int Q_DECLARATIVE_EXPORT registerAutoParentFunction(AutoParentFunction);
int Q_DECLARATIVE_EXPORT registerType(const RegisterType &);
int Q_DECLARATIVE_EXPORT registerType(const RegisterInterface &);
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 42e19b8..074b8f0 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -674,13 +674,15 @@ bool QBmpHandler::readHeader()
bool QBmpHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device()))
- return false;
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("bmp");
return true;
}
- return state != Error;
+
+ return false;
}
bool QBmpHandler::canRead(QIODevice *device)
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index d89ffe6..adc2632 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4210,6 +4210,7 @@ QImage QImage::createHeuristicMask(bool clipTight) const
int w = width();
int h = height();
QImage m(w, h, Format_MonoLSB);
+ QIMAGE_SANITYCHECK_MEMORY(m);
m.setColorCount(2);
m.setColor(0, QColor(Qt::color0).rgba());
m.setColor(1, QColor(Qt::color1).rgba());
@@ -4302,6 +4303,7 @@ QImage QImage::createMaskFromColor(QRgb color, Qt::MaskMode mode) const
if (!d)
return QImage();
QImage maskImage(size(), QImage::Format_MonoLSB);
+ QIMAGE_SANITYCHECK_MEMORY(maskImage);
maskImage.fill(0);
uchar *s = maskImage.bits();
@@ -4362,6 +4364,7 @@ QImage QImage::mirrored(bool horizontal, bool vertical) const
int h = d->height;
// Create result image, copy colormap
QImage result(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(result);
// check if we ran out of of memory..
if (!result.d)
@@ -4499,6 +4502,7 @@ QImage QImage::rgbSwapped() const
case Format_ARGB32:
case Format_ARGB32_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
uint *q = (uint*)res.scanLine(i);
uint *p = (uint*)scanLine(i);
@@ -4512,6 +4516,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB16:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
ushort *q = (ushort*)res.scanLine(i);
const ushort *p = (const ushort*)scanLine(i);
@@ -4525,6 +4530,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB8565_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *p = (quint8*)scanLine(i);
const quint8 *end = p + d->width * sizeof(qargb8565);
@@ -4537,6 +4543,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB666:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
qrgb666 *q = reinterpret_cast<qrgb666*>(res.scanLine(i));
const qrgb666 *p = reinterpret_cast<const qrgb666*>(scanLine(i));
@@ -4549,6 +4556,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB6666_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
qargb6666 *q = reinterpret_cast<qargb6666*>(res.scanLine(i));
const qargb6666 *p = reinterpret_cast<const qargb6666*>(scanLine(i));
@@ -4561,6 +4569,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB555:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
ushort *q = (ushort*)res.scanLine(i);
const ushort *p = (const ushort*)scanLine(i);
@@ -4574,6 +4583,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB8555_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *p = (quint8*)scanLine(i);
const quint8 *end = p + d->width * sizeof(qargb8555);
@@ -4586,6 +4596,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB888:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
@@ -4601,6 +4612,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_RGB444:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
@@ -4615,6 +4627,7 @@ QImage QImage::rgbSwapped() const
break;
case Format_ARGB4444_Premultiplied:
res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index dd31834..2cf8222 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -892,13 +892,15 @@ QPngHandler::~QPngHandler()
bool QPngHandler::canRead() const
{
- if (d->state == QPngHandlerPrivate::Ready) {
- if (!canRead(device()))
- return false;
+ if (d->state == QPngHandlerPrivate::Ready && !canRead(device()))
+ return false;
+
+ if (d->state != QPngHandlerPrivate::Error) {
setFormat("png");
return true;
}
- return d->state != QPngHandlerPrivate::Error;
+
+ return false;
}
bool QPngHandler::canRead(QIODevice *device)
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp
index cbbbef4..a9e796c 100644
--- a/src/gui/image/qppmhandler.cpp
+++ b/src/gui/image/qppmhandler.cpp
@@ -409,13 +409,15 @@ bool QPpmHandler::readHeader()
bool QPpmHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device(), &subType))
- return false;
+ if (state == Ready && !canRead(device(), &subType))
+ return false;
+
+ if (state != Error) {
setFormat(subType);
return true;
}
- return state != Error;
+
+ return false;
}
bool QPpmHandler::canRead(QIODevice *device, QByteArray *subType)
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index 385340a..0dd4e99 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -261,13 +261,15 @@ bool QXbmHandler::readHeader()
bool QXbmHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device()))
- return false;
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("xbm");
return true;
}
- return state != Error;
+
+ return false;
}
bool QXbmHandler::canRead(QIODevice *device)
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index a475cd0..b97afd3 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -1225,11 +1225,15 @@ bool QXpmHandler::readImage(QImage *image)
bool QXpmHandler::canRead() const
{
- if (state == Ready && canRead(device())) {
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("xpm");
return true;
}
- return state != Error;
+
+ return false;
}
bool QXpmHandler::canRead(QIODevice *device)
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index 0e06f34..8f55734 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -1472,6 +1472,10 @@ QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem *parent, QTreeWidgetItem *after
/*!
Destroys this tree widget item.
+
+ The item will be removed from \l{QTreeWidget}s to which it has
+ been added. This makes it safe to delete an item at any time.
+
*/
QTreeWidgetItem::~QTreeWidgetItem()
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index ff2469c..5e7c67a 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -156,6 +156,7 @@
#define ErrRaster_Invalid_Outline -1
#define ErrRaster_Invalid_Argument -3
#define ErrRaster_Memory_Overflow -4
+#define ErrRaster_OutOfMemory -6
#define QT_FT_BEGIN_HEADER
#define QT_FT_END_HEADER
@@ -222,7 +223,6 @@
#define DOWNSCALE( x ) ( (x) << ( 6 - PIXEL_BITS ) )
#endif
-
/*************************************************************************/
/* */
/* TYPE DEFINITIONS */
@@ -1757,8 +1757,7 @@
#ifdef DEBUG_GRAYS
fprintf( stderr, "Rotten glyph!\n" );
#endif
- /* == Raster_Err_OutOfMemory in qblackraster.c */
- return -6;
+ return ErrRaster_OutOfMemory;
}
if ( bottom-top >= ras.band_size )
@@ -1784,7 +1783,7 @@
static int
- gray_raster_render( PRaster raster,
+ gray_raster_render( QT_FT_Raster raster,
const QT_FT_Raster_Params* params )
{
const QT_FT_Outline* outline = (const QT_FT_Outline*)params->source;
@@ -1795,6 +1794,12 @@
if ( !raster || !raster->buffer || !raster->buffer_size )
return ErrRaster_Invalid_Argument;
+ // If raster object and raster buffer are allocated, but
+ // raster size isn't of the minimum size, indicate out of
+ // memory.
+ if (raster && raster->buffer && raster->buffer_size < MINIMUM_POOL_SIZE )
+ return ErrRaster_OutOfMemory;
+
/* return immediately if the outline is empty */
if ( outline->n_points == 0 || outline->n_contours <= 0 )
return 0;
@@ -1874,19 +1879,15 @@
/**** a static object. *****/
static int
- gray_raster_new( void * memory,
- QT_FT_Raster* araster )
+ gray_raster_new( QT_FT_Raster* araster )
{
- if (memory)
- fprintf(stderr, "gray_raster_new(), memory ignored");
- memory = malloc(sizeof(TRaster));
- if (!memory) {
+ *araster = malloc(sizeof(TRaster));
+ if (!*araster) {
*araster = 0;
return ErrRaster_Memory_Overflow;
}
- QT_FT_MEM_ZERO(memory, sizeof(TRaster));
+ QT_FT_MEM_ZERO(*araster, sizeof(TRaster));
- *araster = (QT_FT_Raster) memory;
return 0;
}
@@ -1905,10 +1906,9 @@
{
PRaster rast = (PRaster)raster;
-
if ( raster )
{
- if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 )
+ if ( pool_base && ( pool_size >= MINIMUM_POOL_SIZE ) )
{
PWorker worker = (PWorker)pool_base;
@@ -1923,6 +1923,13 @@
rast->band_size = (int)( rast->buffer_size /
( sizeof ( TCell ) * 8 ) );
}
+ else if ( pool_base)
+ { // Case when there is a raster pool allocated, but it
+ // doesn't have the minimum size (and so memory will be reallocated)
+ rast->buffer = pool_base;
+ rast->worker = NULL;
+ rast->buffer_size = pool_size;
+ }
else
{
rast->buffer = NULL;
diff --git a/src/gui/painting/qgrayraster_p.h b/src/gui/painting/qgrayraster_p.h
index 4463fc9..ad595b8 100644
--- a/src/gui/painting/qgrayraster_p.h
+++ b/src/gui/painting/qgrayraster_p.h
@@ -89,6 +89,10 @@
#define QT_FT_EXPORT_VAR( x ) extern x
#endif
+/* Minimum buffer size for raster object, that accounts
+ for TWorker and TCell sizes.*/
+#define MINIMUM_POOL_SIZE 4096
+
QT_FT_EXPORT_VAR( const QT_FT_Raster_Funcs ) qt_ft_grays_raster;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 08e14fb..f10f12f 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -345,7 +345,7 @@ void QRasterPaintEngine::init()
// The antialiasing raster.
d->grayRaster.reset(new QT_FT_Raster);
Q_CHECK_PTR(d->grayRaster.data());
- if (qt_ft_grays_raster.raster_new(0, d->grayRaster.data()))
+ if (qt_ft_grays_raster.raster_new(d->grayRaster.data()))
QT_THROW(std::bad_alloc()); // an error creating the raster is caused by a bad malloc
@@ -3789,6 +3789,7 @@ 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
+ && !rect.isEmpty()
&& s->matrix.type() <= QTransform::TxScale) // no shear
{
ensureBrush();
@@ -4185,7 +4186,11 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
return;
}
- const int rasterPoolInitialSize = 8192;
+ // Initial size for raster pool is MINIMUM_POOL_SIZE so as to
+ // minimize memory reallocations. However if initial size for
+ // raster pool is changed for lower value, reallocations will
+ // occur normally.
+ const int rasterPoolInitialSize = MINIMUM_POOL_SIZE;
int rasterPoolSize = rasterPoolInitialSize;
unsigned char *rasterPoolBase;
#if defined(Q_WS_WIN64)
@@ -4229,7 +4234,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
error = qt_ft_grays_raster.raster_render(*grayRaster.data(), &rasterParams);
// Out of memory, reallocate some more and try again...
- if (error == -6) { // -6 is Result_err_OutOfMemory
+ if (error == -6) { // ErrRaster_OutOfMemory from qgrayraster.c
int new_size = rasterPoolSize * 2;
if (new_size > 1024 * 1024) {
qWarning("QPainter: Rasterization of primitive failed");
@@ -4255,7 +4260,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
Q_CHECK_PTR(rasterPoolBase); // note: we just freed the old rasterPoolBase. I hope it's not fatal.
qt_ft_grays_raster.raster_done(*grayRaster.data());
- qt_ft_grays_raster.raster_new(0, grayRaster.data());
+ qt_ft_grays_raster.raster_new(grayRaster.data());
qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
} else {
done = true;
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index b8ad9b3..910b2df 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1453,6 +1453,11 @@ void QX11PaintEngine::drawEllipse(const QRectF &rect)
void QX11PaintEngine::drawEllipse(const QRect &rect)
{
+ if (rect.isEmpty()) {
+ drawRects(&rect, 1);
+ return;
+ }
+
Q_D(QX11PaintEngine);
QRect devclip(SHRT_MIN, SHRT_MIN, SHRT_MAX*2 - 1, SHRT_MAX*2 - 1);
QRect r(rect);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index e8c4599..d17c711 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -4238,8 +4238,6 @@ void QPainter::drawEllipse(const QRectF &r)
return;
QRectF rect(r.normalized());
- if (rect.isEmpty())
- return;
if (d->extended) {
d->extended->drawEllipse(rect);
@@ -4281,8 +4279,6 @@ void QPainter::drawEllipse(const QRect &r)
return;
QRect rect(r.normalized());
- if (rect.isEmpty())
- return;
if (d->extended) {
d->extended->drawEllipse(rect);
diff --git a/src/gui/painting/qrasterdefs_p.h b/src/gui/painting/qrasterdefs_p.h
index c33fa57..19a0b16 100644
--- a/src/gui/painting/qrasterdefs_p.h
+++ b/src/gui/painting/qrasterdefs_p.h
@@ -81,7 +81,6 @@
QT_FT_BEGIN_HEADER
-
/*************************************************************************/
/* */
/* <Section> */
@@ -837,7 +836,7 @@ QT_FT_BEGIN_HEADER
/* A handle (pointer) to a raster object. Each object can be used */
/* independently to convert an outline into a bitmap or pixmap. */
/* */
- typedef struct QT_FT_RasterRec_* QT_FT_Raster;
+ typedef struct TRaster_ *QT_FT_Raster;
/*************************************************************************/
@@ -1118,8 +1117,7 @@ QT_FT_BEGIN_HEADER
/* ignored by a given raster implementation. */
/* */
typedef int
- (*QT_FT_Raster_NewFunc)( void* memory,
- QT_FT_Raster* raster );
+ (*QT_FT_Raster_NewFunc)( QT_FT_Raster* raster );
#define QT_FT_Raster_New_Func QT_FT_Raster_NewFunc
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 91d3fa6..45bcc00 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1762,40 +1762,65 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (!styleHint(SH_UnderlineShortcut, menuItem, widget))
text_flags |= Qt::TextHideMnemonic;
- const bool selected = (option->state & State_Selected) && (option->state & State_Enabled);
- if (selected)
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
-
QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget);
QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget);
//todo: move the vertical spacing stuff into subElementRect
const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing);
- if (checkable){
- const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
- QStyleOptionMenuItem optionCheckBox;
- optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
- optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
- optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
- optionCheckBox.rect.moveCenter(QPoint(
- optionCheckBox.rect.center().x(),
- menuItem->rect.center().y()));
- const int moveByX = optionCheckBox.rect.width() + vSpacing;
- if (optionMenuItem.direction == Qt::LeftToRight) {
- textRect.translate(moveByX, 0);
+ QStyleOptionMenuItem optionCheckBox;
+
+ //Regardless of checkbox visibility, make room for it, this mirrors native implementation,
+ //where text and icon placement is static regardless of content of menu item.
+ const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing);
+ optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
+ optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
+ optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
+ optionCheckBox.rect.moveCenter(QPoint(
+ optionCheckBox.rect.center().x(),
+ menuItem->rect.center().y()));
+ const int moveByX = optionCheckBox.rect.width() + vSpacing +
+ pixelMetric(PM_DefaultFrameWidth);
+ if (optionMenuItem.direction == Qt::LeftToRight) {
+ if (iconRect.isValid()) {
iconRect.translate(moveByX, 0);
iconRect.setWidth(iconRect.width() + vSpacing);
+ }
+ if (textRect.isValid()) {
+ textRect.translate(moveByX, 0);
textRect.setWidth(textRect.width() - moveByX - vSpacing);
- optionCheckBox.rect.translate(vSpacing >> 1, hSpacing >> 1);
- } else {
+ }
+ optionCheckBox.rect.translate(vSpacing + pixelMetric(PM_DefaultFrameWidth), hSpacing >> 1);
+ } else {
+ if (textRect.isValid())
textRect.setWidth(textRect.width() - moveByX);
+ if (iconRect.isValid()) {
iconRect.setWidth(iconRect.width() + vSpacing);
iconRect.translate(-optionCheckBox.rect.width() - vSpacing, 0);
- optionCheckBox.rect.translate(textRect.width() + iconRect.width(), 0);
}
- if (!ignoreCheckMark)
- drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
+ optionCheckBox.rect.translate(textRect.width() + iconRect.width(), 0);
}
+
+ const bool selected = (option->state & State_Selected) && (option->state & State_Enabled);
+ if (selected) {
+ const int spacing = pixelMetric(PM_DefaultFrameWidth) * 2;
+ int start; int end;
+ if (QApplication::layoutDirection() == Qt::LeftToRight) {
+ start = optionMenuItem.rect.left() + spacing;
+ end = qMax(textRect.right(), iconRect.right() + spacing);
+ } else {
+ start = qMax(spacing, qMin(textRect.left(), iconRect.left() - spacing));
+ end = optionMenuItem.rect.right() - spacing;
+ }
+ //-1 adjustment to avoid highlight being on top of possible separator item
+ const QRect highlightRect = QRect(
+ QPoint(start, option->rect.top()),
+ QPoint(end, option->rect.bottom() - 1));
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags);
+ }
+
+ if (checkable && !ignoreCheckMark)
+ drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
+
//draw icon and/or checkState
QPixmap pix = menuItem->icon.pixmap(pixelMetric(PM_SmallIconSize),
enabled ? QIcon::Normal : QIcon::Disabled);
@@ -1806,7 +1831,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
textRect.translate(vSpacing, 0);
else
textRect.translate(-vSpacing, 0);
- textRect.setWidth(textRect.width()-vSpacing);
+ textRect.setWidth(textRect.width() - vSpacing);
}
//draw indicators
@@ -1844,6 +1869,24 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QCommonStyle::drawItemText(painter, textRect, text_flags,
optionMenuItem.palette, enabled,
optionMenuItem.text, QPalette::Text);
+
+ //In Sym^3, native menu items have "lines" between them
+ if (QS60StylePrivate::isSingleClickUi()) {
+ const QColor lineColorAlpha = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 15, 0);
+ const int spacing = QS60StylePrivate::pixelMetric(PM_FrameCornerWidth);
+ //native platform sets each color byte to same value for "line 16" which just defines alpha for
+ //menuitem lines; lets use first byte "red".
+ QColor lineColor = optionMenuItem.palette.text().color();
+ if (lineColorAlpha.isValid())
+ lineColor.setAlpha(lineColorAlpha.red());
+ painter->save();
+ painter->setPen(lineColor);
+
+ const int lineStartX = optionMenuItem.rect.left() + (QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) - 2) + spacing;
+ const int lineEndX = optionMenuItem.rect.right() - (QS60StylePrivate::pixelMetric(PM_FrameCornerWidth) - 2) - spacing;
+ painter->drawLine(QPoint(lineStartX, optionMenuItem.rect.bottom()), QPoint(lineEndX, optionMenuItem.rect.bottom()));
+ painter->restore();
+ }
if (!enabled)
painter->restore();
}
@@ -2240,6 +2283,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget) &&
option->palette.window().texture().cacheKey() ==
QS60StylePrivate::m_themePalette->window().texture().cacheKey())
+ //todo: for combobox listviews, the background should include area for menu scrollers,
+ //but this produces drawing issues as we need to turn clipping off.
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, option->rect, flags);
else
commonStyleDraws = true;
@@ -2555,10 +2600,12 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
}
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ //native items have small empty areas at the beginning and end of menu item
+ sz.setWidth(sz.width() + 2 * pixelMetric(PM_MenuHMargin) + 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth));
if (QS60StylePrivate::isTouchSupported())
//Make itemview easier to use in touch devices
//QCommonStyle does not adjust height with horizontal margin, it only adjusts width
- sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin));
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin) - 8); //QCommonstyle adds 8 to height that this style handles through PM values
break;
#ifndef QT_NO_COMBOBOX
case CT_ComboBox: {
@@ -2823,16 +2870,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
}
break;
case SC_ComboBoxListBoxPopup: {
- const QRect desktopContent = QApplication::desktop()->availableGeometry();
-
- // take the size of this and position bottom above available area
- QRect popupRect;
- const int width = desktopContent.width() - pixelMetric(PM_LayoutRightMargin) - pixelMetric(PM_LayoutLeftMargin);
- popupRect.setWidth(width);
- popupRect.setHeight(desktopContent.height()); //combobox resets height anyway based on content
- popupRect.setBottom(desktopContent.bottom());
- popupRect.translate(pixelMetric(PM_LayoutLeftMargin), 0);
- ret = popupRect;
+ ret = QApplication::desktop()->availableGeometry();
}
break;
default:
@@ -2996,7 +3034,6 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
ret.setWidth(indicatorWidth);
}
} else {
- ret = menuItem->rect;
if (!menuItem->icon.isNull())
if (menuItem->direction == Qt::LeftToRight)
ret.adjust(indicatorWidth, 0, 0, 0);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index e5c74ad..4bb2ea8 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1023,8 +1023,14 @@ TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameEl
heightShrink = heightShrink >> 1;
break;
case QS60StylePrivate::SF_ListHighlight:
- widthShrink = widthShrink - 2;
- heightShrink = heightShrink - 2;
+ //In Sym^3 devices highlights are less blocky
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
+ widthShrink += 2;
+ heightShrink += 2;
+ } else {
+ widthShrink -= 2;
+ heightShrink -= 2;
+ }
break;
case QS60StylePrivate::SF_PopupBackground:
widthShrink = widthShrink + 5;
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 9056012..2c4fbab 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -690,7 +690,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format)
if (fake_oblique)
transform = true;
// fake bold
- if ((fontDef.weight == QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD))
+ if ((fontDef.weight == QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face))
embolden = true;
// underline metrics
line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale));
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 10870aa..c742455 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -324,6 +324,26 @@ QStaticText::PerformanceHint QStaticText::performanceHint() const
}
/*!
+ Sets the text option structure that controls the layout process to the given \a textOption.
+
+ \sa textOption()
+*/
+void QStaticText::setTextOption(const QTextOption &textOption)
+{
+ detach();
+ data->textOption = textOption;
+ data->invalidate();
+}
+
+/*!
+ Returns the current text option used to control the layout process.
+*/
+QTextOption QStaticText::textOption() const
+{
+ return data->textOption;
+}
+
+/*!
Sets the preferred width for this QStaticText. If the text is wider than the specified width,
it will be broken into multiple lines and grow vertically. If the text cannot be split into
multiple lines, it will be larger than the specified \a textWidth.
@@ -580,6 +600,7 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
QTextLayout textLayout;
textLayout.setText(text);
textLayout.setFont(font);
+ textLayout.setTextOption(textOption);
qreal leading = QFontMetricsF(font).leading();
qreal height = -leading;
@@ -610,21 +631,26 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
.arg(QString::number(color.blue(), 16), 2, QLatin1Char('0')));
#endif
document.setDefaultFont(font);
- document.setDocumentMargin(0.0);
- if (textWidth >= 0.0)
- document.setTextWidth(textWidth);
+ document.setDocumentMargin(0.0);
#ifndef QT_NO_TEXTHTMLPARSER
document.setHtml(text);
#else
document.setPlainText(text);
#endif
+ if (textWidth >= 0.0)
+ document.setTextWidth(textWidth);
+ else
+ document.adjustSize();
+ document.setDefaultTextOption(textOption);
- document.adjustSize();
p->save();
p->translate(topLeftPosition);
document.drawContents(p);
p->restore();
+ if (textWidth >= 0.0)
+ document.adjustSize(); // Find optimal size
+
actualSize = document.size();
}
}
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index f3bef93..4febde2 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -48,7 +48,7 @@
#include <QtGui/qtransform.h>
#include <QtGui/qfont.h>
-
+#include <QtGui/qtextoption.h>
QT_BEGIN_HEADER
@@ -79,6 +79,9 @@ public:
void setTextWidth(qreal textWidth);
qreal textWidth() const;
+ void setTextOption(const QTextOption &textOption);
+ QTextOption textOption() const;
+
QSizeF size() const;
void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont());
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 1a96291..cb60626 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -53,6 +53,8 @@
// We mean it.
//
+#include "qstatictext.h"
+
#include <private/qtextureglyphcache_p.h>
#include <QtGui/qcolor.h>
@@ -148,12 +150,14 @@ public:
QFixedPoint *positionPool; // 4 bytes per text
QChar *charPool; // 4 bytes per text
+ QTextOption textOption; // 28 bytes per text
+
unsigned char needsRelayout : 1; // 1 byte per text
unsigned char useBackendOptimizations : 1;
unsigned char textFormat : 2;
unsigned char untransformedCoordinates : 1;
// ================
- // 167 bytes per text
+ // 195 bytes per text
static QStaticTextPrivate *get(const QStaticText *q);
};
diff --git a/src/gui/widgets/qslider.cpp b/src/gui/widgets/qslider.cpp
index a5e62cf..5755202 100644
--- a/src/gui/widgets/qslider.cpp
+++ b/src/gui/widgets/qslider.cpp
@@ -621,7 +621,7 @@ QSlider::TickPosition QSlider::tickPosition() const
\brief the interval between tickmarks
This is a value interval, not a pixel interval. If it is 0, the
- slider will choose between lineStep() and pageStep().
+ slider will choose between singleStep() and pageStep().
The default value is 0.
diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp
index 8abc2d1..5e2157e 100644
--- a/src/plugins/imageformats/gif/qgifhandler.cpp
+++ b/src/plugins/imageformats/gif/qgifhandler.cpp
@@ -1061,12 +1061,12 @@ bool QGifHandler::imageIsComing() const
bool QGifHandler::canRead() const
{
- if (!nextDelay && canRead(device())) {
+ if (!nextDelay && canRead(device()) || imageIsComing()) {
setFormat("gif");
return true;
}
- return imageIsComing();
+ return false;
}
bool QGifHandler::canRead(QIODevice *device)
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 72dde15..60e7cce 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -802,13 +802,15 @@ QJpegHandler::~QJpegHandler()
bool QJpegHandler::canRead() const
{
- if(d->state == QJpegHandlerPrivate::Ready) {
- if (!canRead(device()))
- return false;
+ if(d->state == QJpegHandlerPrivate::Ready && !canRead(device()))
+ return false;
+
+ if (d->state != QJpegHandlerPrivate::Error) {
setFormat("jpeg");
return true;
}
- return d->state != QJpegHandlerPrivate::Error;
+
+ return false;
}
bool QJpegHandler::canRead(QIODevice *device)
diff --git a/src/plugins/imageformats/mng/qmnghandler.cpp b/src/plugins/imageformats/mng/qmnghandler.cpp
index d408e6c..c134fd6 100644
--- a/src/plugins/imageformats/mng/qmnghandler.cpp
+++ b/src/plugins/imageformats/mng/qmnghandler.cpp
@@ -381,10 +381,10 @@ QMngHandler::~QMngHandler()
bool QMngHandler::canRead() const
{
Q_D(const QMngHandler);
- if (!d->haveReadNone)
- return (!d->haveReadAll || (d->haveReadAll && (d->nextIndex < d->frameCount)));
-
- if (canRead(device())) {
+ if ((!d->haveReadNone
+ && (!d->haveReadAll || (d->haveReadAll && (d->nextIndex < d->frameCount))))
+ || canRead(device()))
+ {
setFormat("mng");
return true;
}
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index d751134..ce0f4f1 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -16,8 +16,8 @@ symbian: {
# It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll.
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
BLD_INF_RULES.prj_exports += \
- "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
- "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
+ "sqlite3.sis /epoc32/data/qt/sis/sqlite3.sis" \
+ "sqlite3_selfsigned.sis /epoc32/data/qt/sis/sqlite3_selfsigned.sis"
symbian-abld|symbian-sbsv2 {
sqlitedeployment = \
"; Deploy sqlite onto phone that does not have it already" \