diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-17 13:32:40 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-17 13:32:40 (GMT) |
commit | 0610902bcd722605f10840a6a3d1600e1e07f771 (patch) | |
tree | d23cf33f3b318224c539899140aa79fd7f104bfb /src/gui | |
parent | 08c6a3485b236b53ac925a404f01a077147cd556 (diff) | |
parent | 68a2073cca205d8a6c4a44305045e1ac64f664f0 (diff) | |
download | Qt-0610902bcd722605f10840a6a3d1600e1e07f771.zip Qt-0610902bcd722605f10840a6a3d1600e1e07f771.tar.gz Qt-0610902bcd722605f10840a6a3d1600e1e07f771.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
doc: Added more DITA output to the XML generator
Usefully convert from QtScript object/array to QVariant
document QSslSocket::systemCaCertificates() change in changelog
Implement QIODevice::peek() using read() + ungetBlock().
Allocate the memory for QtFontSize when count > 1
doc: Added more DITA output to the XML generator
Defer allocation of GIF decoding tables/stack.
Make sure only started gestures can cause cancellations
Updated JavaScriptCore from /home/khansen/dev/qtwebkit-qtscript-integration to javascriptcore-snapshot-16062010 ( 8b2d3443afca194f8ac50a63151dc9d19a150582 )
qmake: Fix CONFIG += exceptions_off with the MSVC project generator.
Fix some kind of race condition while using remote commands.
Work around ICE in Intel C++ Compiler 11.1.072
Reduce the memory consumption of QtFontStyle
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 3 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 13 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 6c5623e..ca3b56f 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -6277,7 +6277,8 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original) { Q_ASSERT(original); QGraphicsItem *originalItem = gestureTargets.value(original); - Q_ASSERT(originalItem); + if (originalItem == 0) // we only act on accepted gestures, which implies it has a target. + return; // iterate over all active gestures and for each find the owner // if the owner is part of our sub-hierarchy, cancel it. diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index ff29462..139139f 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -145,18 +145,18 @@ struct QtFontEncoding struct QtFontSize { - unsigned short pixelSize; - #ifdef Q_WS_X11 - int count; QtFontEncoding *encodings; QtFontEncoding *encodingID(int id, uint xpoint = 0, uint xres = 0, uint yres = 0, uint avgwidth = 0, bool add = false); + unsigned short count : 16; #endif // Q_WS_X11 #if defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QByteArray fileName; int fileIndex; #endif // defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) + + unsigned short pixelSize : 16; }; @@ -284,7 +284,12 @@ QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add) if (!add) return 0; - if (!(count % 8)) { + if (!pixelSizes) { + // Most style have only one font size, we avoid waisting memory + QtFontSize *newPixelSizes = (QtFontSize *)malloc(sizeof(QtFontSize)); + Q_CHECK_PTR(newPixelSizes); + pixelSizes = newPixelSizes; + } else if (!(count % 8) || count == 1) { QtFontSize *newPixelSizes = (QtFontSize *) realloc(pixelSizes, (((count+8) >> 3) << 3) * sizeof(QtFontSize)); |