From 04830dbcb2c1b92bd949ac7fd56d293b02e91fef Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Jun 2013 14:26:03 +0200 Subject: [PATCH 1/9] Strip the -L dirs when processing GL dirs for the CMake files. The generated cmake files expect only the names of libraries, so the existence of directories causes erroneous fatal errors when attempting to use Qt5Gui, if pkg-config returns a -L entry from pkg-config --libs egl Change-Id: Iec50b4be68ab643c3c02abce2435a98e69955138 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly Reviewed-by: Iikka Eklund --- mkspecs/features/cmake_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index 08295da75f..f48ef43b88 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -54,7 +54,7 @@ defineReplace(cmakeProcessLibs) { variable = $$1 out = for(v, variable) { - if(!equals(v, -framework)) { + if(!equals(v, -framework):!equals(v, -L.*)) { v ~= s,^-l,, v ~= s,^-lib,, v ~= s,.lib$,, From 119882714f87ffeb6945fdb2d02997ae125ff50c Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Thu, 30 May 2013 08:33:25 +0200 Subject: [PATCH 2/9] Cocoa:Fixed crash when sharing QMenu between two QMenuBar instances Don't insert a NSMenuItem into a NSMenu if this one already belongs to another NSMenu, this is forbidden in the Cocoa framework and raises an Exception. The solution consists in tagging the menu as sharable and moving it from one menubar to another when the window gets focus. Task-number: QTBUG-31342 Change-Id: Ic3bfadd4704f363ac26122ae15547543a0f6d44d Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenu.h | 5 ++ src/plugins/platforms/cocoa/qcocoamenu.mm | 13 +++- src/plugins/platforms/cocoa/qcocoamenubar.h | 2 + src/plugins/platforms/cocoa/qcocoamenubar.mm | 70 ++++++++++++++------ 4 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 9100b9b15f..7224ee2ff8 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.h +++ b/src/plugins/platforms/cocoa/qcocoamenu.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE +class QCocoaMenuBar; + class QCocoaMenu : public QPlatformMenu { public: @@ -87,6 +89,8 @@ public: QList items() const; QList merged() const; + void setMenuBar(QCocoaMenuBar *menuBar); + QCocoaMenuBar *menuBar() const; private: QCocoaMenuItem *itemOrNull(int index) const; void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem); @@ -97,6 +101,7 @@ private: NSObject *m_delegate; bool m_enabled; quintptr m_tag; + QCocoaMenuBar *m_menuBar; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 25ece7349c..d4cf83a380 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -215,7 +215,8 @@ QT_BEGIN_NAMESPACE QCocoaMenu::QCocoaMenu() : m_enabled(true), - m_tag(0) + m_tag(0), + m_menuBar(0) { m_delegate = [[QT_MANGLE_NAMESPACE(QCocoaMenuDelegate) alloc] initWithMenu:this]; m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; @@ -534,4 +535,14 @@ void QCocoaMenu::syncModalState(bool modal) } } +void QCocoaMenu::setMenuBar(QCocoaMenuBar *menuBar) +{ + m_menuBar = menuBar; +} + +QCocoaMenuBar *QCocoaMenu::menuBar() const +{ + return m_menuBar; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h index 8086676cc5..7a1bda74a4 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.h +++ b/src/plugins/platforms/cocoa/qcocoamenubar.h @@ -75,6 +75,8 @@ private: static QCocoaMenuBar *findGlobalMenubar(); bool shouldDisable(QCocoaWindow *active) const; + void insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu); + void removeNativeMenu(QCocoaMenu *menu); QList m_menus; NSMenu *m_nativeMenu; diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index e280cf4581..73331db40d 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -83,9 +83,24 @@ QCocoaMenuBar::~QCocoaMenuBar() } } -void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu) { QCocoaAutoReleasePool pool; + + if (beforeMenu) { + NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; + [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; + } else { + [m_nativeMenu addItem: menu->nsMenuItem()]; + } + + menu->setMenuBar(this); + syncMenu(static_cast(menu)); + [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; +} + +void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +{ QCocoaMenu *menu = static_cast(platformMenu); QCocoaMenu *beforeMenu = static_cast(before); #ifdef QT_COCOA_ENABLE_MENU_DEBUG @@ -96,39 +111,36 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first"; return; } - if (beforeMenu) { - if (!m_menus.contains(beforeMenu)) { - qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; - return; - } - m_menus.insert(m_menus.indexOf(beforeMenu), menu); - NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; - [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; - } else { - m_menus.append(menu); - [m_nativeMenu addItem: menu->nsMenuItem()]; + + if (beforeMenu && !m_menus.contains(beforeMenu)) { + qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; + return; } - platformMenu->setParent(this); - syncMenu(platformMenu); - [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; + m_menus.insert(beforeMenu ? m_menus.indexOf(beforeMenu) : m_menus.size(), menu); + if (!menu->menuBar()) + insertNativeMenu(menu, beforeMenu); +} + +void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu) +{ + QCocoaAutoReleasePool pool; + + if (menu->menuBar() == this) + menu->setMenuBar(0); + NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; + [m_nativeMenu removeItemAtIndex: realIndex]; } void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) { - QCocoaAutoReleasePool pool; - QCocoaMenu *menu = static_cast(platformMenu); if (!m_menus.contains(menu)) { qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar"; return; } m_menus.removeOne(menu); - - if (platformMenu->parent() == this) - platformMenu->setParent(0); - NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; - [m_nativeMenu removeItemAtIndex: realIndex]; + removeNativeMenu(menu); } void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) @@ -207,6 +219,20 @@ void QCocoaMenuBar::updateMenuBarImmediately() m->syncModalState(disableForModal); } + // reparent shared menu items if necessary. + // We browse the list in reverse order to be sure that the next items are redrawn before the current ones, + // in this way we are sure that "beforeMenu" (see below) is part of the native menu before "m" is redraw + for (int i = mb->m_menus.size() - 1; i >= 0; i--) { + QCocoaMenu *m = mb->m_menus.at(i); + QCocoaMenuBar *menuBar = m->menuBar(); + if (menuBar != mb) { + QCocoaMenu *beforeMenu = i < (mb->m_menus.size() - 1) ? mb->m_menus.at(i + 1) : 0; + if (menuBar) + menuBar->removeNativeMenu(m); + mb->insertNativeMenu(m, beforeMenu); + } + } + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); [loader ensureAppMenuInMenu:mb->nsMenu()]; From 25a4405c69a032bbe817935be1f1f0929e98da63 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 4 Jun 2013 16:11:06 +0200 Subject: [PATCH 3/9] Doc: Rearranged page titles in the of HTML pages. Before: QtMultimedia 5.1: Camera After: Camera | QtMultimedia 5.1 "Camera" is page name and "QtMultimedia 5.1" is the assembled project name. -Regular page title is the same. -It's a readability issue to not see the page title right away -New arrangement conforms to Qt Project and blog name format: " | <Domain>" -Tested with the tw-parser and it looks compatible with the qt-project.org site Change-Id: Iae0eec9e66b5e21285bdad1e525923f60c72e56b Reviewed-by: Sami Makkonen <sami.makkonen@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> --- src/tools/qdoc/htmlgenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 7e1467f300..3d6f04decf 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1755,12 +1755,12 @@ void HtmlGenerator::generateHeader(const QString& title, if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!project.isEmpty()) - shortVersion = project + QLatin1Char(' ') + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + project + QLatin1Char(' ') + shortVersion; else - shortVersion = QLatin1String("Qt ") + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + QLatin1String("Qt ") + shortVersion ; // Generating page title - out() << " <title>" << shortVersion << protectEnc(title) << "\n"; + out() << " " << protectEnc(title) << shortVersion << "\n"; // Include style sheet and script links. out() << headerStyles; From c889e2848398c7beca9d31544e9cbdba88ebe5bb Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 3 Jun 2013 12:23:50 +0200 Subject: [PATCH 4/9] Doc: Fixed typo in QDialog. Task-number: QTBUG-31493 Change-Id: I7bb7b249a0336dd949f8c74bcc22c0b7c39d0885 Reviewed-by: Geir Vattekar --- src/widgets/dialogs/qdialog.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index a76c88dc5e..2cda99a269 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -150,12 +150,11 @@ void QDialogPrivate::deletePlatformHelper() provide a \l{#return}{return value}, and they can have \l{#default}{default buttons}. QDialogs can also have a QSizeGrip in their lower-right corner, using setSizeGripEnabled(). - Note that QDialog (an any other widget that has type Qt::Dialog) uses - the parent widget slightly differently from other classes in Qt. A - dialog is always a top-level widget, but if it has a parent, its - default location is centered on top of the parent's top-level widget - (if it is not top-level itself). It will also share the parent's - taskbar entry. + Note that QDialog (and any other widget that has type \c Qt::Dialog) uses + the parent widget slightly differently from other classes in Qt. A dialog is + always a top-level widget, but if it has a parent, its default location is + centered on top of the parent's top-level widget (if it is not top-level + itself). It will also share the parent's taskbar entry. Use the overload of the QWidget::setParent() function to change the ownership of a QDialog widget. This function allows you to From 476dba9a9f3842041f465da92764646976b96551 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 16:11:50 +0200 Subject: [PATCH 5/9] Use QWindow::geometry() for size when sending resize before expose. Task-number: QTBUG-30996 Change-Id: I9c3589ea67b563f6e588568ee54cc8bbd084f87c Reviewed-by: Gunnar Sletta --- src/gui/kernel/qguiapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2a1d7e3bcc..29a7e87d46 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2251,8 +2251,8 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E if (!p->receivedExpose) { if (p->resizeEventPending) { // as a convenience for plugins, send a resize event before the first expose event if they haven't done so - QSize size = p->geometry.size(); - QResizeEvent e(size, size); + // window->geometry() should have a valid size as soon as a handle exists. + QResizeEvent e(window->geometry().size(), p->geometry.size()); QGuiApplication::sendSpontaneousEvent(window, &e); p->resizeEventPending = false; From 1828ab8557e824ec22b0c425dd417df3a0794a8c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 16:14:42 +0200 Subject: [PATCH 6/9] Windows: Send a geometry change after Window creation. Task-number: QTBUG-30996 Change-Id: I03b5e1fdbbdd779f86541291c13e9eb6840ff3c6 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsintegration.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 814892b43a..fc2ba454df 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -433,6 +433,9 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons return 0; if (requested.flags != obtained.flags) window->setFlags(obtained.flags); + // Trigger geometry change signals of QWindow. + if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry) + QWindowSystemInterface::handleGeometryChange(window, obtained.geometry); return new QWindowsWindow(window, obtained); } From 21356b3ec34f4e83719389775b83825fbd8b02e6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 5 Jun 2013 11:20:07 +0200 Subject: [PATCH 7/9] RecalcAdvances and DoKerning should agree on when to use design metrics QFontEngineFT::recalcAdvances uses design metrics if hinting is disabled or slight. QFontEngine::doKerning only follows the QFontEngine::DesignMetrics flag. This means in some instances the advances will be calculated in subpixels but kerned in full pixels. This patch makes QFontEngineFT decide if it should request design metrics from QFontEngine::doKerning or not. Change-Id: Ia0236efde2d7269623f690a6074afbe26e07c458 Reviewed-by: Konstantin Ritt Reviewed-by: Pierre Rossi --- src/gui/text/qfontengine_ft.cpp | 18 +++++++++++++++--- src/gui/text/qfontengine_ft_p.h | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 10225febcb..4545645dc6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1316,6 +1316,12 @@ void QFontEngineFT::doKerning(QGlyphLayout *g, QFontEngine::ShaperFlags flags) c unlockFace(); } } + + if (shouldUseDesignMetrics(flags) && !(fontDef.styleStrategy & QFont::ForceIntegerMetrics)) + flags |= DesignMetrics; + else + flags &= ~DesignMetrics; + QFontEngine::doKerning(g, flags); } @@ -1571,12 +1577,18 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs return true; } +bool QFontEngineFT::shouldUseDesignMetrics(QFontEngine::ShaperFlags flags) const +{ + if (!FT_IS_SCALABLE(freetype->face)) + return false; + + return default_hint_style == HintNone || default_hint_style == HintLight || (flags & DesignMetrics); +} + void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const { FT_Face face = 0; - bool design = (default_hint_style == HintNone || - default_hint_style == HintLight || - (flags & DesignMetrics)) && FT_IS_SCALABLE(freetype->face); + bool design = shouldUseDesignMetrics(flags); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0; // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 434eb76c33..e09fa6f94f 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -325,6 +325,7 @@ private: friend class QFontEngineMultiFontConfig; int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; + bool shouldUseDesignMetrics(ShaperFlags flags) const; GlyphFormat defaultFormat; FT_Matrix matrix; From 9ef24ff8ed487d49cf441c65c69ea7ebfe8acfb3 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Fri, 7 Jun 2013 13:03:34 +0200 Subject: [PATCH 8/9] test: Mark tst_qopengl as insignificant on Win7 + Angle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This only marks tst_qopengl as insignificant on Windows 7 32bit with the Angle configuration. Task-number: QTBUG-31611 Change-Id: I1876b6fdc32fef93edf34c2bd61d03cc9ba11135 Reviewed-by: Friedemann Kleint Reviewed-by: Tony Sarajärvi --- tests/auto/gui/qopengl/qopengl.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index 91eeda34c3..34af962d36 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -8,3 +8,5 @@ TARGET = tst_qopengl QT += gui gui-private core-private testlib SOURCES += tst_qopengl.cpp + +win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTBUG-31611 From ebea15cb33da8063a630867e38eacf7857b0b936 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 15:52:26 -0700 Subject: [PATCH 9/9] QEventLoop: Remove the test that checked throwing from an event handler In Qt 5, we declared that throwing from event handlers is undefined behavior. So stop testing this. We will try our best to capture and pass along std::bad_alloc, but even that might not work, depending on compiler settings. In particular, after the upgrade to MinGW/GCC 4.8 with DW2, this test stopped working. Task-number: QTBUG-31615 Change-Id: Ibf5fb2ce0c48b983549096bf7aac434b6ed3ac2e Reviewed-by: Lars Knoll --- .../kernel/qeventloop/tst_qeventloop.cpp | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 2250d0bb5e..25e5f03566 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -159,23 +159,6 @@ public slots: } }; -#ifndef QT_NO_EXCEPTIONS -class QEventLoopTestException { }; - -class ExceptionThrower : public QObject -{ - Q_OBJECT -public: - ExceptionThrower() : QObject() { } -public slots: - void throwException() - { - QEventLoopTestException e; - throw e; - } -}; -#endif - class tst_QEventLoop : public QObject { Q_OBJECT @@ -183,9 +166,6 @@ private slots: // This test *must* run first. See the definition for why. void processEvents(); void exec(); -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) - void throwInExec(); -#endif void reexec(); void execAfterExit(); void wakeUp(); @@ -322,53 +302,6 @@ void tst_QEventLoop::exec() } } -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) -// Exceptions need to be enabled for this test -// Q_OS_WINCE_WM case: this platform doesn't support propagating exceptions through the event loop -// Windows Mobile cannot handle cross library exceptions -// qobject.cpp will try to rethrow the exception after handling -// which causes gwes.exe to crash -void tst_QEventLoop::throwInExec() -{ -// exceptions compiled in, runtime tests follow. -#if defined(Q_OS_LINUX) - // C++ exceptions can't be passed through glib callbacks. Skip the test if - // we're using the glib event loop. - QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className(); - if (dispatcher.contains("Glib")) { - QSKIP( - qPrintable(QString( - "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n" - "Try running with QT_NO_GLIB=1 in environment." - ).arg(QString::fromLatin1(dispatcher))) - ); - } -#endif - - { - // QEventLoop::exec() is exception safe - QEventLoop eventLoop; - int caughtExceptions = 0; - - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - QCOMPARE(caughtExceptions, 2); - } -} -#endif - void tst_QEventLoop::reexec() { QEventLoop loop;