diff options
author | Iain <qt-info@nokia.com> | 2010-04-13 08:46:39 (GMT) |
---|---|---|
committer | Iain <qt-info@nokia.com> | 2010-04-13 08:46:39 (GMT) |
commit | ef84739c3737d03da9de2b5e92a68f70294c65d3 (patch) | |
tree | 442cc0906ff5e5ee079d0777d7d6d1a1b66fce0a | |
parent | a036df97b0f66a8bf57171c5725becf2d2b6467b (diff) | |
parent | 921f54e051b6fcc0268097347e2ad13ba0bfc37d (diff) | |
download | Qt-ef84739c3737d03da9de2b5e92a68f70294c65d3.zip Qt-ef84739c3737d03da9de2b5e92a68f70294c65d3.tar.gz Qt-ef84739c3737d03da9de2b5e92a68f70294c65d3.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7
40 files changed, 401 insertions, 184 deletions
diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 7b18bfb..8a5667d 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -25,7 +25,6 @@ INSTALLS = sources MinehuntCore_sources target symbian:{ load(data_caging_paths) TARGET.EPOCALLOWDLLDATA = 1 - TARGET.CAPABILITY = all -tcb include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) importFiles.sources = minehunt.dll \ diff --git a/doc/src/platforms/emb-features.qdoc b/doc/src/platforms/emb-features.qdoc index 1974a45..ab549d3 100644 --- a/doc/src/platforms/emb-features.qdoc +++ b/doc/src/platforms/emb-features.qdoc @@ -105,9 +105,6 @@ \note The \c qconfig tool is intended to be built against Qt on desktop platforms. - \bold{Windows CE:} The Qt for Windows CE package contains a \c qconfig - executable that you can run on a Windows desktop to configure the build. - \image qt-embedded-qconfigtool.png The \c qconfig tool's interface displays all of Qt's diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index d9e5d3c..5789662 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -886,7 +886,7 @@ TARGET.CAPABILITY += AllFiles //! [133] //! [134] -TARGET.CAPABILITY = ALL -TCB +TARGET.CAPABILITY = ALL -TCB -DRM -AllFiles //! [134] //! [135] diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index 29ba313..474ec11 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -14,6 +14,6 @@ symbian { include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection - TARGET.CAPABILITY = "All -TCB" + TARGET.CAPABILITY = "NetworkServices ReadUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index bd5768b..1df3671 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -26,7 +26,7 @@ QMAKE_CFLAGS_RELEASE = QMAKE_CFLAGS_DEBUG = QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses - +MMP_OPTION_KEYWORDS = CW ARMCC GCCE VERSION_FLAGS.ARMCC = ARMCC_4_0 QMAKE_CXXFLAGS = $$QMAKE_CFLAGS # Symbian build system applies -cwd source on the MWCC command line. diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index e05ced2..faafb20 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -68,12 +68,8 @@ #define MMP_TARGET "TARGET" #define MMP_TARGETTYPE "TARGETTYPE" #define MMP_SECUREID "SECUREID" -#define MMP_OPTION_CW "OPTION CW" -#define MMP_OPTION_ARMCC "OPTION ARMCC" -#define MMP_OPTION_GCCE "OPTION GCCE" -#define MMP_LINKEROPTION_CW "LINKEROPTION CW" -#define MMP_LINKEROPTION_ARMCC "LINKEROPTION ARMCC" -#define MMP_LINKEROPTION_GCCE "LINKEROPTION GCCE" +#define MMP_OPTION "OPTION" +#define MMP_LINKEROPTION "LINKEROPTION" #define MMP_CAPABILITY "CAPABILITY" #define MMP_EPOCALLOWDLLDATA "EPOCALLOWDLLDATA" #define MMP_EPOCHEAPSIZE "EPOCHEAPSIZE" @@ -84,6 +80,10 @@ #define MMP_START_RESOURCE "START RESOURCE" #define MMP_END_RESOURCE "END" +#define VAR_CXXFLAGS "QMAKE_CXXFLAGS" +#define VAR_CFLAGS "QMAKE_CFLAGS" +#define VAR_LFLAGS "QMAKE_LFLAGS" + QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) { static QString epocRootStr; @@ -426,9 +426,7 @@ void SymbianMakefileGenerator::initMmpVariables() overridableMmpKeywords << QLatin1String(MMP_TARGETTYPE) << QLatin1String(MMP_EPOCHEAPSIZE); restrictableMmpKeywords << QLatin1String(MMP_TARGET) << QLatin1String(MMP_SECUREID) - << QLatin1String(MMP_OPTION_CW) << QLatin1String(MMP_OPTION_ARMCC) - << QLatin1String(MMP_OPTION_GCCE) << QLatin1String(MMP_LINKEROPTION_CW) - << QLatin1String(MMP_LINKEROPTION_ARMCC) << QLatin1String(MMP_LINKEROPTION_GCCE) + << QLatin1String(MMP_OPTION) << QLatin1String(MMP_LINKEROPTION) << QLatin1String(MMP_CAPABILITY) << QLatin1String(MMP_EPOCALLOWDLLDATA) << QLatin1String(MMP_EPOCSTACKSIZE) << QLatin1String(MMP_UID) << QLatin1String(MMP_VENDORID) << QLatin1String(MMP_VERSION); @@ -778,120 +776,65 @@ void SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) t << endl << endl; } -void SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) +void SymbianMakefileGenerator::writeMmpFileConditionalOptions(QTextStream& t, + const QString &optionType, + const QString &optionTag, + const QString &variableBase) { - QString cw, armcc, gcce; - QString cwlink, armlink, gccelink; - - if (0 != project->values("QMAKE_CXXFLAGS.CW").size()) { - cw.append(project->values("QMAKE_CXXFLAGS.CW").join(" ")); - cw.append(" "); - } - - if (0 != project->values("QMAKE_CXXFLAGS.ARMCC").size()) { - armcc.append(project->values("QMAKE_CXXFLAGS.ARMCC").join(" ")); - armcc.append(" "); - } - - if (0 != project->values("QMAKE_CXXFLAGS.GCCE").size()) { - gcce.append(project->values("QMAKE_CXXFLAGS.GCCE").join(" ")); - gcce.append(" "); - } - - if (0 != project->values("QMAKE_CFLAGS.CW").size()) { - cw.append(project->values("QMAKE_CFLAGS.CW").join(" ")); - cw.append(" "); - } - - if (0 != project->values("QMAKE_CFLAGS.ARMCC").size()) { - armcc.append(project->values("QMAKE_CFLAGS.ARMCC").join(" ")); - armcc.append(" "); + foreach(QString compilerVersion, project->values("VERSION_FLAGS." + optionTag)) { + QStringList currentValues = project->values(variableBase + "." + compilerVersion); + if (currentValues.size()) { + t << "#if defined(" << compilerVersion << ")" << endl; + t << optionType << " " << optionTag << " " << currentValues.join(" ") << endl; + t << "#endif" << endl; + } } +} - if (0 != project->values("QMAKE_CFLAGS.GCCE").size()) { - gcce.append(project->values("QMAKE_CXXFLAGS.GCCE").join(" ")); - gcce.append(" "); - } +void SymbianMakefileGenerator::writeMmpFileSimpleOption(QTextStream& t, + const QString &optionType, + const QString &optionTag, + const QString &options) +{ + QString trimmedOptions = options.trimmed(); + if (!trimmedOptions.isEmpty()) + t << optionType << " " << optionTag << " " << trimmedOptions << endl; +} - if (0 != project->values("QMAKE_CXXFLAGS").size()) { - cw.append(project->values("QMAKE_CXXFLAGS").join(" ")); - cw.append(" "); - armcc.append(project->values("QMAKE_CXXFLAGS").join(" ")); - armcc.append(" "); - gcce.append(project->values("QMAKE_CXXFLAGS").join(" ")); - gcce.append(" "); +void SymbianMakefileGenerator::appendMmpFileOptions(QString &options, const QStringList &list) +{ + if (list.size()) { + options.append(list.join(" ")); + options.append(" "); } +} - if (0 != project->values("QMAKE_CFLAGS").size()) { - cw.append(project->values("QMAKE_CFLAGS").join(" ")); - cw.append(" "); - armcc.append(project->values("QMAKE_CFLAGS").join(" ")); - armcc.append(" "); - gcce.append(project->values("QMAKE_CFLAGS").join(" ")); - gcce.append(" "); - } +void SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) +{ + QStringList keywords = project->values("MMP_OPTION_KEYWORDS"); + QStringList commonCxxFlags = project->values(VAR_CXXFLAGS); + QStringList commonCFlags = project->values(VAR_CFLAGS); + QStringList commonLFlags = project->values(VAR_LFLAGS); - if (0 != project->values("QMAKE_LFLAGS.CW").size()) { - cwlink.append(project->values("QMAKE_LFLAGS.CW").join(" ")); - cwlink.append(" "); - } + foreach(QString item, keywords) { + QString compilerOption; + QString linkerOption; - if (0 != project->values("QMAKE_LFLAGS.ARMCC").size()) { - armlink.append(project->values("QMAKE_LFLAGS.ARMCC").join(" ")); - armlink.append(" "); - } + appendMmpFileOptions(compilerOption, project->values(VAR_CXXFLAGS "." + item)); + appendMmpFileOptions(compilerOption, project->values(VAR_CFLAGS "." + item)); + appendMmpFileOptions(compilerOption, commonCxxFlags); + appendMmpFileOptions(compilerOption, commonCFlags); - if (0 != project->values("QMAKE_LFLAGS.GCCE").size()) { - gccelink.append(project->values("QMAKE_LFLAGS.GCCE").join(" ")); - gccelink.append(" "); - } + appendMmpFileOptions(linkerOption, project->values(VAR_LFLAGS "." + item)); + appendMmpFileOptions(linkerOption, commonLFlags); - if (0 != project->values("QMAKE_LFLAGS").size()) { - cwlink.append(project->values("QMAKE_LFLAGS").join(" ")); - cwlink.append(" "); - armlink.append(project->values("QMAKE_LFLAGS").join(" ")); - armlink.append(" "); - gccelink.append(project->values("QMAKE_LFLAGS").join(" ")); - gccelink.append(" "); - } + writeMmpFileSimpleOption(t, MMP_OPTION, item, compilerOption); + writeMmpFileSimpleOption(t, MMP_LINKEROPTION, item, linkerOption); - if (!cw.isEmpty() && cw[cw.size()-1] == ' ') - cw.chop(1); - if (!armcc.isEmpty() && armcc[armcc.size()-1] == ' ') - armcc.chop(1); - if (!gcce.isEmpty() && gcce[gcce.size()-1] == ' ') - gcce.chop(1); - if (!cwlink.isEmpty() && cwlink[cwlink.size()-1] == ' ') - cwlink.chop(1); - if (!armlink.isEmpty() && armlink[armlink.size()-1] == ' ') - armlink.chop(1); - if (!gccelink.isEmpty() && gccelink[gccelink.size()-1] == ' ') - gccelink.chop(1); - - if (!cw.isEmpty()) - t << MMP_OPTION_CW " " << cw << endl; - if (!armcc.isEmpty()) - t << MMP_OPTION_ARMCC " " << armcc << endl; - - foreach(QString armccVersion, project->values("VERSION_FLAGS.ARMCC")) { - QStringList currentValues = project->values("QMAKE_CXXFLAGS." + armccVersion); - if (currentValues.size()) { - t << "#if defined(" << armccVersion << ")" << endl; - t << MMP_OPTION_ARMCC " " << currentValues.join(" ") << endl; - t << "#endif" << endl; - } + writeMmpFileConditionalOptions(t, MMP_OPTION, item, VAR_CXXFLAGS); + writeMmpFileConditionalOptions(t, MMP_LINKEROPTION, item, VAR_LFLAGS); } - if (!gcce.isEmpty()) - t << MMP_OPTION_GCCE " " << gcce << endl; - - if (!cwlink.isEmpty()) - t << MMP_LINKEROPTION_CW " " << cwlink << endl; - if (!armlink.isEmpty()) - t << MMP_LINKEROPTION_ARMCC " " << armlink << endl; - if (!gccelink.isEmpty()) - t << MMP_LINKEROPTION_GCCE " " << gccelink << endl; - t << endl; } diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index b06ff5b..a584a9a 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -104,6 +104,15 @@ protected: void writeMmpFileIncludePart(QTextStream& t); void writeMmpFileLibraryPart(QTextStream& t); void writeMmpFileCapabilityPart(QTextStream& t); + void writeMmpFileConditionalOptions(QTextStream& t, + const QString &optionType, + const QString &optionTag, + const QString &variableBase); + void writeMmpFileSimpleOption(QTextStream& t, + const QString &optionType, + const QString &optionTag, + const QString &options); + void appendMmpFileOptions(QString &options, const QStringList &list); void writeMmpFileCompilerOptionPart(QTextStream& t); void writeMmpFileBinaryVersionPart(QTextStream& t); void writeMmpFileRulesPart(QTextStream& t); diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 72b0128..59a601e 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -110,6 +110,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QTextCodecFactoryInterface_iid, QLatin1String("/codecs"))) #endif + static char qtolower(register char c) { if (c >= 'A' && c <= 'Z') return c + 0x20; return c; } static bool qisalnum(register char c) @@ -224,6 +225,19 @@ QTextCodecCleanup::~QTextCodecCleanup() Q_GLOBAL_STATIC(QTextCodecCleanup, createQTextCodecCleanup) +bool QTextCodec::validCodecs() +{ +#ifdef Q_OS_SYMBIAN + // If we don't have a trap handler, we're outside of the main() function, + // ie. in global constructors or destructors. Don't use codecs in this + // case as it would lead to crashes because we don't have a cleanup stack on Symbian + return (User::TrapHandler() != NULL); +#else + return true; +#endif +} + + #if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) class QWindowsLocalCodec: public QTextCodec { @@ -710,6 +724,14 @@ static void setup() if (all) return; +#ifdef Q_OS_SYMBIAN + // If we don't have a trap handler, we're outside of the main() function, + // ie. in global constructors or destructors. Don't create codecs in this + // case as it would lead to crashes because of a missing cleanup stack on Symbian + if (User::TrapHandler() == NULL) + return; +#endif + #ifdef Q_DEBUG_TEXTCODEC if (destroying_is_ok) qWarning("QTextCodec: Creating new codec during codec cleanup"); @@ -1012,6 +1034,9 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name) #endif setup(); + if (!validCodecs()) + return 0; + static QHash <QByteArray, QTextCodec *> cache; if (clearCaches & 0x1) { cache.clear(); @@ -1053,6 +1078,9 @@ QTextCodec* QTextCodec::codecForMib(int mib) #endif setup(); + if (!validCodecs()) + return 0; + static QHash <int, QTextCodec *> cache; if (clearCaches & 0x2) { cache.clear(); @@ -1100,6 +1128,10 @@ QList<QByteArray> QTextCodec::availableCodecs() setup(); QList<QByteArray> codecs; + + if (!validCodecs()) + return codecs; + for (int i = 0; i < all->size(); ++i) { codecs += all->at(i)->name(); codecs += all->at(i)->aliases(); @@ -1138,6 +1170,10 @@ QList<int> QTextCodec::availableMibs() setup(); QList<int> codecs; + + if (!validCodecs()) + return codecs; + for (int i = 0; i < all->size(); ++i) codecs += all->at(i)->mibEnum(); @@ -1191,6 +1227,9 @@ void QTextCodec::setCodecForLocale(QTextCodec *c) QTextCodec* QTextCodec::codecForLocale() { + if (!validCodecs()) + return 0; + if (localeMapper) return localeMapper; diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index e37527d..4ba8b85 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -148,12 +148,13 @@ public: private: friend class QTextCodecCleanup; static QTextCodec *cftr; + static bool validCodecs(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags) -inline QTextCodec* QTextCodec::codecForTr() { return cftr; } + inline QTextCodec* QTextCodec::codecForTr() { return validCodecs() ? cftr : 0; } inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; } -inline QTextCodec* QTextCodec::codecForCStrings() { return QString::codecForCStrings; } +inline QTextCodec* QTextCodec::codecForCStrings() { return validCodecs() ? QString::codecForCStrings : 0; } inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { QString::codecForCStrings = c; } class Q_CORE_EXPORT QTextEncoder { diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 8fc3fb8..1a1f978 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -67,6 +67,7 @@ #ifdef Q_OS_SYMBIAN # include <exception> # include <f32file.h> +# include <e32ldr.h> # include "qeventdispatcher_symbian_p.h" # include "private/qcore_symbian_p.h" #elif defined(Q_OS_UNIX) @@ -579,6 +580,27 @@ void QCoreApplication::init() qt_core_eval_init(d->application_type); #endif +#if defined(Q_OS_SYMBIAN) \ + && defined(Q_CC_NOKIAX86) \ + && defined(QT_DEBUG) + /** + * Prevent the executable from being locked in the Symbian emulator. The + * code dramatically simplifies debugging on Symbian, but beyond that has + * no impact. + * + * Force the ZLazyUnloadTimer to fire and therefore unload code segments + * immediately. The code affects Symbian's file server and on the other + * hand needs only to be run once in each emulator run. + */ + { + RLoader loader; + CleanupClosePushL(loader); + User::LeaveIfError(loader.Connect()); + User::LeaveIfError(loader.CancelLazyDllUnload()); + CleanupStack::PopAndDestroy(&loader); + } +#endif + qt_startup_hook(); } diff --git a/src/gui/dialogs/qfiledialog.ui b/src/gui/dialogs/qfiledialog.ui index b52bd8a..1f35abb 100644 --- a/src/gui/dialogs/qfiledialog.ui +++ b/src/gui/dialogs/qfiledialog.ui @@ -83,6 +83,12 @@ <property name="toolTip" > <string>Back</string> </property> + <property name="accessibleName"> + <string>Back</string> + </property> + <property name="accessibleDescription"> + <string>Go back</string> + </property> </widget> </item> <item> @@ -90,6 +96,12 @@ <property name="toolTip" > <string>Forward</string> </property> + <property name="accessibleName"> + <string>Forward</string> + </property> + <property name="accessibleDescription"> + <string>Go forward</string> + </property> </widget> </item> <item> @@ -97,6 +109,12 @@ <property name="toolTip" > <string>Parent Directory</string> </property> + <property name="accessibleName"> + <string>Parent Directory</string> + </property> + <property name="accessibleDescription"> + <string>Go to the parent directory</string> + </property> </widget> </item> <item> @@ -104,6 +122,12 @@ <property name="toolTip" > <string>Create New Folder</string> </property> + <property name="accessibleName"> + <string>Create New Folder</string> + </property> + <property name="accessibleDescription"> + <string>Create a New Folder</string> + </property> </widget> </item> <item> @@ -111,6 +135,12 @@ <property name="toolTip" > <string>List View</string> </property> + <property name="accessibleName"> + <string>List View</string> + </property> + <property name="accessibleDescription"> + <string>Change to list view mode</string> + </property> </widget> </item> <item> @@ -118,6 +148,12 @@ <property name="toolTip" > <string>Detail View</string> </property> + <property name="accessibleName"> + <string>Detail View</string> + </property> + <property name="accessibleDescription"> + <string>Change to detail view mode</string> + </property> </widget> </item> </layout> diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index 483eb62..2132526 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -1435,7 +1435,7 @@ void QGraphicsProxyWidget::paint(QPainter *painter, const QStyleOptionGraphicsIt return; // Filter out repaints on the window frame. - const QRect exposedWidgetRect = (option->exposedRect & rect()).toRect(); + const QRect exposedWidgetRect = (option->exposedRect & rect()).toAlignedRect(); if (exposedWidgetRect.isEmpty()) return; diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 8e439be..bc8ccb01 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -1116,13 +1116,13 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & QApplication::sendEvent(this, &event); break; } - case ItemCursorChange: { + case ItemCursorHasChanged: { // Deliver CursorChange. QEvent event(QEvent::CursorChange); QApplication::sendEvent(this, &event); break; } - case ItemToolTipChange: { + case ItemToolTipHasChanged: { // Deliver ToolTipChange. QEvent event(QEvent::ToolTipChange); QApplication::sendEvent(this, &event); diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ce1d6d3..d226baf 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -5709,6 +5709,9 @@ void QImage::setAlphaChannel(const QImage &alphaChannel) else *this = convertToFormat(QImage::Format_ARGB32_Premultiplied); + if (isNull()) + return; + // Slight optimization since alphachannels are returned as 8-bit grays. if (alphaChannel.d->depth == 8 && alphaChannel.isGrayscale()) { const uchar *src_data = alphaChannel.d->data; diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index a5f7b31..503a1b2 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -197,6 +197,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, for (int i = 0; i < keys.size(); ++i) { QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i))); if (plugin && (plugin->capabilities(device, testFormat) & QImageIOPlugin::CanWrite)) { + delete handler; handler = plugin->create(device, testFormat); break; } diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 43445b4..31be224 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -114,15 +114,14 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height) } } else if (old_height > span->height()) { //remove the span from all the subspans lists that intersect the columns not covered anymore - Index::iterator it_y = index.lowerBound(-span->bottom()); - if (it_y == index.end()) - it_y = index.find(-span->top()); // This is the only span remaining and we are deleting it. + Index::iterator it_y = index.lowerBound(-qMax(span->bottom(), span->top())); //qMax usefull if height is 0 Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list while (-it_y.key() <= span->top() + old_height -1) { if (-it_y.key() > span->bottom()) { - (*it_y).remove(-span->left()); + int removed = (*it_y).remove(-span->left()); + Q_ASSERT(removed == 1); Q_UNUSED(removed); if (it_y->isEmpty()) { - it_y = index.erase(it_y) - 1; + it_y = index.erase(it_y); } } if(it_y == index.begin()) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 25a7bbe..c735d1f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -372,8 +372,13 @@ QSymbianControl::~QSymbianControl() { if (S60->curWin == this) S60->curWin = 0; - if (!QApplicationPrivate::is_app_closing) - setFocusSafely(false); + if (!QApplicationPrivate::is_app_closing) { + QT_TRY { + setFocusSafely(false); + } QT_CATCH(const std::exception&) { + // ignore exceptions, nothing can be done + } + } S60->appUi()->RemoveFromStack(this); delete m_longTapDetector; } @@ -989,7 +994,7 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) } #endif } else if (QApplication::activeWindow() == qwidget->window()) { - if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { + if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) { QWidget *fw = QApplication::focusWidget(); if (fw) { QFocusEvent event(QEvent::FocusOut, Qt::PopupFocusReason); @@ -1239,6 +1244,7 @@ void qt_init(QApplicationPrivate * /* priv */, int) } S60->avkonComponentsSupportTransparency = false; + S60->menuBeingConstructed = false; #ifdef Q_WS_S60 TUid KCRUidAvkon = { 0x101F876E }; diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 7d643c2..c0761f0 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -365,17 +365,30 @@ void QSoftKeyManagerPrivateS60::updateSoftKeys_sys() nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } +static void resetMenuBeingConstructed(TAny* /*aAny*/) +{ + S60->menuBeingConstructed = false; +} + +void QSoftKeyManagerPrivateS60::tryDisplayMenuBarL() +{ + CleanupStack::PushL(TCleanupItem(resetMenuBeingConstructed, NULL)); + S60->menuBeingConstructed = true; + S60->menuBar()->TryDisplayMenuBarL(); + CleanupStack::PopAndDestroy(); // Reset menuBeingConstructed to false in all cases +} + bool QSoftKeyManagerPrivateS60::handleCommand(int command) { QAction *action = realSoftKeyActions.value(command); if (action) { QVariant property = action->property(MENU_ACTION_PROPERTY); if (property.isValid() && property.toBool()) { - QT_TRAP_THROWING(S60->menuBar()->TryDisplayMenuBarL()); + QT_TRAP_THROWING(tryDisplayMenuBarL()); } else if (action->menu()) { // TODO: This is hack, in order to use exising QMenuBar implementation for Symbian // menubar needs to have widget to which it is associated. Since we want to associate - // menubar to action (which is inherited from QObejct), we create and associate QWidget + // menubar to action (which is inherited from QObject), we create and associate QWidget // to action and pass that for QMenuBar. This associates the menubar to action, and we // can have own menubar for each action. QWidget *actionContainer = action->property("_q_action_widget").value<QWidget*>(); @@ -394,15 +407,15 @@ bool QSoftKeyManagerPrivateS60::handleCommand(int command) action->setProperty("_q_action_widget", v); } qt_symbian_next_menu_from_action(actionContainer); - QT_TRAP_THROWING(S60->menuBar()->TryDisplayMenuBarL()); - } else { - Q_ASSERT(action->softKeyRole() != QAction::NoSoftKey); - QWidget *actionParent = action->parentWidget(); - Q_ASSERT_X(actionParent, Q_FUNC_INFO, "No parent set for softkey action!"); - if (actionParent->isEnabled()) { - action->activate(QAction::Trigger); - return true; - } + QT_TRAP_THROWING(tryDisplayMenuBarL()); + } + + Q_ASSERT(action->softKeyRole() != QAction::NoSoftKey); + QWidget *actionParent = action->parentWidget(); + Q_ASSERT_X(actionParent, Q_FUNC_INFO, "No parent set for softkey action!"); + if (actionParent->isEnabled()) { + action->activate(QAction::Trigger); + return true; } } return false; diff --git a/src/gui/kernel/qsoftkeymanager_s60_p.h b/src/gui/kernel/qsoftkeymanager_s60_p.h index a5e5016..d14993c 100644 --- a/src/gui/kernel/qsoftkeymanager_s60_p.h +++ b/src/gui/kernel/qsoftkeymanager_s60_p.h @@ -78,6 +78,7 @@ public: bool handleCommand(int command); private: + void tryDisplayMenuBarL(); bool skipCbaUpdate(); void ensureCbaVisibilityAndResponsiviness(CEikButtonGroupContainer &cba); void clearSoftkeys(CEikButtonGroupContainer &cba); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 7c6b754..a714221 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -122,6 +122,7 @@ public: int qtOwnsS60Environment : 1; int supportsPremultipliedAlpha : 1; int avkonComponentsSupportTransparency : 1; + int menuBeingConstructed : 1; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type static inline void updateScreenSize(); static inline RWsSession& wsSession(); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e88026c..72ffe87 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1506,8 +1506,12 @@ QWidget::~QWidget() if (QWidgetPrivate::allWidgets) // might have been deleted by ~QApplication QWidgetPrivate::allWidgets->remove(this); - QEvent e(QEvent::Destroy); - QCoreApplication::sendEvent(this, &e); + QT_TRY { + QEvent e(QEvent::Destroy); + QCoreApplication::sendEvent(this, &e); + } QT_CATCH(const std::exception&) { + // if this fails we can't do anything about it but at least we are not allowed to throw. + } } int QWidgetPrivate::instanceCounter = 0; // Current number of widget instances diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 671dfc0..3c596e5 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1201,7 +1201,8 @@ void QTextControlPrivate::keyPressEvent(QKeyEvent *e) blockFmt.setIndent(blockFmt.indent() - 1); cursor.setBlockFormat(blockFmt); } else { - cursor.deletePreviousChar(); + QTextCursor localCursor = cursor; + localCursor.deletePreviousChar(); } goto accept; } @@ -1239,7 +1240,8 @@ void QTextControlPrivate::keyPressEvent(QKeyEvent *e) } #endif else if (e == QKeySequence::Delete) { - cursor.deleteChar(); + QTextCursor localCursor = cursor; + localCursor.deleteChar(); } else if (e == QKeySequence::DeleteEndOfWord) { if (!cursor.hasSelection()) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 404d46e..9e190b7 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1398,12 +1398,14 @@ QMenu::QMenu(QMenuPrivate &dd, QWidget *parent) QMenu::~QMenu() { Q_D(QMenu); - QHash<QAction *, QWidget *>::iterator it = d->widgetItems.begin(); - for (; it != d->widgetItems.end(); ++it) { - if (QWidget *widget = it.value()) { - QWidgetAction *action = static_cast<QWidgetAction *>(it.key()); - action->releaseWidget(widget); - *it = 0; + if (!d->widgetItems.isEmpty()) { // avoid detach on shared null hash + QHash<QAction *, QWidget *>::iterator it = d->widgetItems.begin(); + for (; it != d->widgetItems.end(); ++it) { + if (QWidget *widget = it.value()) { + QWidgetAction *action = static_cast<QWidgetAction *>(it.key()); + action->releaseWidget(widget); + *it = 0; + } } } diff --git a/src/multimedia/base/qtmedianamespace.h b/src/multimedia/base/qtmedianamespace.h index fe20a05..1e04da8 100644 --- a/src/multimedia/base/qtmedianamespace.h +++ b/src/multimedia/base/qtmedianamespace.h @@ -144,7 +144,12 @@ namespace QtMultimedia Contrast, Saturation, Sharpness, - DeviceSettingDescription + DeviceSettingDescription, + + PosterImage, + CoverArtImage, + ThumbnailImage + }; enum SupportEstimate diff --git a/src/multimedia/base/qtmedianamespace.qdoc b/src/multimedia/base/qtmedianamespace.qdoc index 58e9c92..277b1a5 100644 --- a/src/multimedia/base/qtmedianamespace.qdoc +++ b/src/multimedia/base/qtmedianamespace.qdoc @@ -98,6 +98,7 @@ \value CoverArtUrlSmall The URL of a small cover art image. QUrl. \value CoverArtUrlLarge The URL of a large cover art image. QUrl. + \value CoverArtImage An embedded cover art image. QImage. Image and video attributes \value Resolution The dimensions of an image or video. QSize. @@ -109,6 +110,7 @@ \value VideoCodec The codec of the media's video stream. QString. \value PosterUrl The URL of a poster image. QUrl. + \value PosterImage An embedded poster image. QImage. Movie attributes \value ChapterNumber The chapter number of the media. int. @@ -162,6 +164,8 @@ Indicates the direction of sharpness processing applied by the camera when the image was shot. \value DeviceSettingDescription Exif tag, indicates information on the picture-taking conditions of a particular camera model. QString + + \value ThumbnailImage An embedded thumbnail image. QImage. */ /*! diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 9ed722f..0a452f3 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -191,7 +191,7 @@ void QGL2PaintEngineExPrivate::updateBrushTexture() QImage texImage = qt_imageForBrush(style, false); glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); - ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, true, QGLContext::InternalBindOption); + ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) { diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp index d952988..7eae78f 100644 --- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp +++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp @@ -144,11 +144,17 @@ void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen, co m_cos_theta = qFastCos(Q_PI / m_roundness); const qreal *endPts = pts + (count<<1); - const qreal *startPts; + const qreal *startPts = 0; Qt::PenCapStyle cap = m_cap_style; if (!types) { + // skip duplicate points + while((pts + 2) < endPts && pts[0] == pts[2] && pts[1] == pts[3]) + pts += 2; + if ((pts + 2) == endPts) + return; + startPts = pts; bool endsAtStart = startPts[0] == *(endPts-2) && startPts[1] == *(endPts-1); @@ -161,15 +167,17 @@ void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen, co lineTo(pts); pts += 2; while (pts < endPts) { - join(pts); - lineTo(pts); + if (m_cx != pts[0] || m_cy != pts[1]) { + join(pts); + lineTo(pts); + } pts += 2; } endCapOrJoinClosed(startPts, pts-2, path.hasImplicitClose(), endsAtStart); } else { - bool endsAtStart; + bool endsAtStart = false; while (pts < endPts) { switch (*types) { case QPainterPath::MoveToElement: { diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index 9b55fd2..13ae807 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -659,6 +659,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) #endif windowSurface = context->createSurface(widget, &surfaceProps); isPaintingActive = false; + needToSwap = true; } #else if (context && size != newSize) { @@ -710,20 +711,21 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) needToSwap = false; } #endif -#if !defined(QVG_NO_PRESERVED_SWAP) - // Try to force the surface back buffer to preserve its contents. - if (needToSwap) { - eglGetError(); // Clear error state first. - eglSurfaceAttrib(QEgl::display(), surface, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - if (eglGetError() != EGL_SUCCESS) { - qWarning("QVG: could not enable preserved swap"); - } - } -#endif windowSurface = surface; isPaintingActive = false; } + +#if !defined(QVG_NO_PRESERVED_SWAP) + // Try to force the surface back buffer to preserve its contents. + if (needToSwap) { + eglGetError(); // Clear error state first. + eglSurfaceAttrib(QEgl::display(), windowSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); + if (eglGetError() != EGL_SUCCESS) { + qWarning("QVG: could not enable preserved swap"); + } + } +#endif return context; } diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp index b4ca8f2..8be1560 100644 --- a/src/plugins/accessible/widgets/complexwidgets.cpp +++ b/src/plugins/accessible/widgets/complexwidgets.cpp @@ -724,7 +724,8 @@ public: if (start.isValid()) { m_current = start; } else if (m_view && m_view->model()) { - m_current = view->model()->index(0, 0); + m_current = view->rootIndex().isValid() ? + view->rootIndex().child(0,0) : view->model()->index(0, 0); } } diff --git a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp index 4433c7a..91d1a44 100644 --- a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp +++ b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp @@ -43,6 +43,7 @@ #include <QtTest/QtTest> #include <stddef.h> +#include <exception> QT_USE_NAMESPACE @@ -285,8 +286,26 @@ void tst_ExceptionSafetyObjects::safeMessageHandler(QtMsgType type, const char * allocFailer.reactivateAt(currentIndex); } +typedef void (*PVF)(); +PVF defaultTerminate; +void debugTerminate() +{ + // you can detect uncaught exceptions with a breakpoint in here + (*defaultTerminate)(); +} + +PVF defaultUnexpected; +void debugUnexpected() +{ + // you can detect unexpected exceptions with a breakpoint in here + (*defaultUnexpected)(); +} + void tst_ExceptionSafetyObjects::initTestCase() { + // set handlers for bad exception cases, you might want to step in and breakpoint the default handlers too + defaultTerminate = std::set_terminate(&debugTerminate); + defaultUnexpected = std::set_unexpected(&debugUnexpected); testMessageHandler = qInstallMsgHandler(safeMessageHandler); QVERIFY(AllocFailer::initialize()); diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro index 0a3fcc3..a534d14 100644 --- a/tests/auto/qchar/qchar.pro +++ b/tests/auto/qchar/qchar.pro @@ -8,4 +8,8 @@ deploy.sources += NormalizationTest.txt DEPLOYMENT = deploy } -DEFINES += SRCDIR=\\\"$$PWD/\\\" +symbian*: { + DEFINES += SRCDIR="" +} else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} diff --git a/tests/auto/qchar/tst_qchar.cpp b/tests/auto/qchar/tst_qchar.cpp index 6227c2e..5ca2255 100644 --- a/tests/auto/qchar/tst_qchar.cpp +++ b/tests/auto/qchar/tst_qchar.cpp @@ -513,10 +513,7 @@ void tst_QChar::normalization() } QFile f(SRCDIR "NormalizationTest.txt"); - if (!f.exists()) { - QFAIL("Couldn't find NormalizationTest.txt"); - return; - } + QVERIFY(f.exists()); f.open(QIODevice::ReadOnly); diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp index 8722a86..ee799f3 100644 --- a/tests/auto/qfile/tst_qfile.cpp +++ b/tests/auto/qfile/tst_qfile.cpp @@ -482,7 +482,7 @@ void tst_QFile::open_data() #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly) << (bool)TRUE << QFile::NoError; - QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testsharewritable/test.pri" << int(QIODevice::ReadOnly) + QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QIODevice::ReadOnly) << true << QFile::NoError; #endif } @@ -554,7 +554,7 @@ void tst_QFile::size_data() QTest::newRow( "exist01" ) << QString(SRCDIR "testfile.txt") << (qint64)245; #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) // Only test UNC on Windows./ - QTest::newRow("unc") << "//" + QString(QtNetworkSettings::winServerName() + "/testsharewritable/test.pri") << (qint64)34; + QTest::newRow("unc") << "//" + QString(QtNetworkSettings::winServerName() + "/testshare/test.pri") << (qint64)34; #endif } @@ -2475,7 +2475,7 @@ void tst_QFile::miscWithUncPathAsCurrentDir() { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) QString current = QDir::currentPath(); - QVERIFY(QDir::setCurrent("//" + QtNetworkSettings::winServerName() + "/testsharewritable")); + QVERIFY(QDir::setCurrent("//" + QtNetworkSettings::winServerName() + "/testshare")); QFile file("test.pri"); QVERIFY(file.exists()); QCOMPARE(int(file.size()), 34); diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 3313240..5a1d20b 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -168,6 +168,7 @@ private slots: void autoFillBackground(); void initialShow(); void initialShow2(); + void itemChangeEvents(); // Task fixes void task236127_bspTreeIndexFails(); @@ -2944,6 +2945,91 @@ void tst_QGraphicsWidget::initialShow2() QTRY_COMPARE(widget->repaints, expectedRepaintCount); } +void tst_QGraphicsWidget::itemChangeEvents() +{ + class TestGraphicsWidget : public QGraphicsWidget + { public: + TestGraphicsWidget() : QGraphicsWidget() {} + QHash<QEvent::Type, QVariant> valueDuringEvents; + bool event(QEvent *event) { + Q_UNUSED(event); + switch (event->type()) { + case QEvent::EnabledChange: { + valueDuringEvents.insert(QEvent::EnabledChange, isEnabled()); + break; + } + case QEvent::ParentAboutToChange: { + valueDuringEvents.insert(QEvent::ParentAboutToChange, qVariantFromValue(parentItem())); + break; + } + case QEvent::ParentChange: { + valueDuringEvents.insert(QEvent::ParentChange, qVariantFromValue(parentItem())); + break; + } + case QEvent::CursorChange: { + valueDuringEvents.insert(QEvent::CursorChange, int(cursor().shape())); + break; + } + case QEvent::ToolTipChange: { + valueDuringEvents.insert(QEvent::ToolTipChange, toolTip()); + break; + } + default: { + break; + } + } + return true; + } + void showEvent(QShowEvent *event) { + Q_UNUSED(event); + valueDuringEvents.insert(QEvent::Show, isVisible()); + } + void hideEvent(QHideEvent *event) { + Q_UNUSED(event); + valueDuringEvents.insert(QEvent::Hide, isVisible()); + } + }; + + QGraphicsScene scene; + QGraphicsView view(&scene); + QGraphicsWidget *parent = new QGraphicsWidget; + scene.addItem(parent); + view.show(); + QTest::qWaitForWindowShown(&view); + + TestGraphicsWidget *item = new TestGraphicsWidget; + item->setParentItem(parent); + // ParentAboutToChange should be triggered before the parent has changed + QTRY_COMPARE(qVariantValue<QGraphicsItem *>(item->valueDuringEvents.value(QEvent::ParentAboutToChange)), + static_cast<QGraphicsItem *>(0)); + // ParentChange should be triggered after the parent has changed + QTRY_COMPARE(qVariantValue<QGraphicsItem *>(item->valueDuringEvents.value(QEvent::ParentChange)), + static_cast<QGraphicsItem *>(parent)); + + // ShowEvent should be triggered before the item is shown + QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Show).toBool()); + + // HideEvent should be triggered after the item is hidden + QVERIFY(item->isVisible()); + item->setVisible(false); + QVERIFY(!item->isVisible()); + QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Hide).toBool()); + + // CursorChange should be triggered after the cursor has changed + item->setCursor(Qt::PointingHandCursor); + QTRY_COMPARE(item->valueDuringEvents.value(QEvent::CursorChange).toInt(), int(item->cursor().shape())); + + // ToolTipChange should be triggered after the tooltip has changed + item->setToolTip("tooltipText"); + QTRY_COMPARE(item->valueDuringEvents.value(QEvent::ToolTipChange).toString(), item->toolTip()); + + // EnabledChange should be triggered after the enabled state has changed + QVERIFY(item->isEnabled()); + item->setEnabled(false); + QVERIFY(!item->isEnabled()); + QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::EnabledChange).toBool()); +} + void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems() { QGraphicsScene scene; diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index ca12f2a..3a3ea79 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -506,7 +506,8 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() // Connect socket.connectToHost(QtNetworkSettings::serverName(), 143); - QCOMPARE(socket.state(), QTcpSocket::HostLookupState); + QVERIFY(socket.state() == QTcpSocket::HostLookupState || + socket.state() == QTcpSocket::ConnectingState); QTestEventLoop::instance().enterLoop(30); if (QTestEventLoop::instance().timeout()) { diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index c238f59..dd497b0 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -3363,7 +3363,7 @@ void tst_QNetworkReply::lastModifiedHeaderForFile() void tst_QNetworkReply::lastModifiedHeaderForHttp() { // Tue, 22 May 2007 12:04:57 GMT according to webserver - QUrl url = "http://" + QtNetworkSettings::serverName() + "/gif/fluke.gif"; + QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/fluke.gif"; QNetworkRequest request(url); QNetworkReplyPtr reply = manager.head(request); diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index 0240a0e..a679765 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -647,7 +647,8 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() // Connect socket.connectToHost(QtNetworkSettings::serverName(), 143); - QCOMPARE(socket.state(), QTcpSocket::HostLookupState); + QVERIFY(socket.state() == QTcpSocket::HostLookupState || + socket.state() == QTcpSocket::ConnectingState); QTestEventLoop::instance().enterLoop(30); if (QTestEventLoop::instance().timeout()) { diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp index 8a084bb..38e5387 100644 --- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp @@ -181,7 +181,11 @@ void tst_QSqlTableModel::createTestTables() QVERIFY_SQL( q, exec("create table " + test3 + "(id int, random varchar(20), randomtwo varchar(20))")); - QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50), column3 varchar(50))")); + if(!tst_Databases::isSqlServer(db)) + QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50), column3 varchar(50))")); + else + QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50) NULL, column3 varchar(50))")); + QVERIFY_SQL( q, exec("create table " + qTableName("emptytable", __FILE__) + "(id int)")); diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 2bfce74..0cf638b 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -1286,7 +1286,7 @@ void tst_QSslSocket::setReadBufferSize_task_250027() connect(socket, SIGNAL(readyRead()), &setReadBufferSize_task_250027_handler, SLOT(readyReadSlot())); // provoke a response by sending a request - socket->write("GET /gif/fluke.gif HTTP/1.0\n"); // this file is 27 KB + socket->write("GET /qtest/fluke.gif HTTP/1.0\n"); // this file is 27 KB socket->write("Host: "); socket->write(QtNetworkSettings::serverName().toLocal8Bit().constData()); socket->write("\n"); @@ -1535,7 +1535,6 @@ void tst_QSslSocket::verifyMode() loop.exec(); QVERIFY(clientSocket.isEncrypted()); - qDebug() << server.socket->sslErrors(); QVERIFY(server.socket->sslErrors().isEmpty()); } @@ -1751,7 +1750,7 @@ void tst_QSslSocket::readFromClosedSocket() socket->waitForConnected(); socket->waitForEncrypted(); // provoke a response by sending a request - socket->write("GET /gif/fluke.gif HTTP/1.1\n"); + socket->write("GET /qtest/fluke.gif HTTP/1.1\n"); socket->write("Host: "); socket->write(QtNetworkSettings::serverName().toLocal8Bit().constData()); socket->write("\n"); diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 54e32218..2062e8e 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -3035,6 +3035,14 @@ void tst_QTableView::spans_data() << QPoint(0, 0) << 1 << 1; + + QTest::newRow("QTBUG-9631: remove one span") + << 10 << 10 + << (SpanList() << QRect(1, 1, 2, 1) << QRect(2, 2, 2, 2) << QRect(1, 1, 1, 1)) + << false + << QPoint(1, 1) + << 1 + << 1; } void tst_QTableView::spans() |