From 274404a2a349b80dbfc5dcd5a2daa0b0bf5d30d6 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 14 Apr 2010 12:06:24 +0200 Subject: Remove statically allocated pixmaps through the post routine In order to avoid native pixmap object leaking remove statically allocated pixmaps through the post routine. Reviewed-by: Friedemann Kleint Task-number: QTBUG-9815 --- .../components/propertyeditor/brushpropertymanager.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/designer/src/components/propertyeditor/brushpropertymanager.cpp b/tools/designer/src/components/propertyeditor/brushpropertymanager.cpp index 6e9a698..2300b47 100644 --- a/tools/designer/src/components/propertyeditor/brushpropertymanager.cpp +++ b/tools/designer/src/components/propertyeditor/brushpropertymanager.cpp @@ -119,21 +119,31 @@ Qt::BrushStyle BrushPropertyManager::brushStyleIndexToStyle(int brushStyleIndex) return Qt::NoBrush; } + +typedef QMap EnumIndexIconMap; + +static void clearBrushIcons(); +Q_GLOBAL_STATIC_WITH_INITIALIZER(EnumIndexIconMap, brushIcons, qAddPostRoutine(clearBrushIcons)) + +static void clearBrushIcons() +{ + brushIcons()->clear(); +} + const BrushPropertyManager::EnumIndexIconMap &BrushPropertyManager::brushStyleIcons() { // Create a map of icons for the brush style editor - static EnumIndexIconMap rc; - if (rc.empty()) { + if (brushIcons()->empty()) { const int brushStyleCount = sizeof(brushStyles)/sizeof(const char *); QBrush brush(Qt::black); const QIcon solidIcon = QtPropertyBrowserUtils::brushValueIcon(brush); for (int i = 0; i < brushStyleCount; i++) { const Qt::BrushStyle style = brushStyleIndexToStyle(i); brush.setStyle(style); - rc.insert(i, QtPropertyBrowserUtils::brushValueIcon(brush)); + brushIcons()->insert(i, QtPropertyBrowserUtils::brushValueIcon(brush)); } } - return rc; + return *(brushIcons()); } QString BrushPropertyManager::brushStyleIndexToString(int brushStyleIndex) -- cgit v0.12 From fb5ddafe2e9d5b982a43e1105b2d86a58ca312ca Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 14 Apr 2010 12:29:46 +0200 Subject: Revert "Doc: Updating design files." This reverts commit d88dade723d5ddd86eea70ee4bf636c06b9f3962. --- doc/src/index.qdoc | 2 +- tools/qdoc3/test/qt-defines.qdocconf | 2 +- tools/qdoc3/test/qt-html-templates.qdocconf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index fe76435..2f23e6e 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index 06bdaae..faf3906 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -1,4 +1,4 @@ -defines = Q_QDOC \ +defines = Q_QDOC \ QT_.*_SUPPORT \ QT_.*_LIB \ QT_COMPAT \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 26bc0e7..67a25f3 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -1,4 +1,4 @@ -HTML.stylesheets = style/style.css +HTML.stylesheets = style/style.css HTML.postheader = "
\n" \ "
\n" \ " Home
\n" \ -- cgit v0.12 From 4a32242e57ac689224340077656b30894171cb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 14 Apr 2010 08:48:40 +0200 Subject: Force the bic test to compile in 32-bit mode on Mac The stored data is 32-bit, gcc on 10.6 produces 64-bit objects by default. --- tests/auto/bic/tst_bic.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index 2349afa..28129c5 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -239,6 +239,9 @@ QBic::Info tst_Bic::getCurrentInfo(const QString &libName) QStringList args; args << "-c" << "-I" + qtDir + "/include" +#ifdef Q_OS_MAC + << "-arch" << "i386" // Always use 32-bit data on Mac. +#endif #ifndef Q_OS_WIN << "-I/usr/X11R6/include/" #endif -- cgit v0.12 From 4dae6bd829e1103d0e21ce9e509d758b5af0c2c0 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 14 Apr 2010 13:31:54 +0200 Subject: Autotest failure: dialogModality test fails on cocoa (macgui) The reason is that it is using accessebility, which is not yet implemented in Qt/Cocoa. This patch just removes the test, and reimplements it using the native events test instead, which is a better solution anyway. Reviewed-by: msorvig --- tests/auto/macgui/tst_macgui.cpp | 27 ---------------------- tests/auto/macnativeevents/tst_macnativeevents.cpp | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/tests/auto/macgui/tst_macgui.cpp b/tests/auto/macgui/tst_macgui.cpp index 847ba4b..7f558a3 100644 --- a/tests/auto/macgui/tst_macgui.cpp +++ b/tests/auto/macgui/tst_macgui.cpp @@ -60,7 +60,6 @@ private slots: void dummy(); void splashScreenModality(); - void dialogModality(); void nonModalOrder(); void spinBoxArrowButtons(); @@ -157,32 +156,6 @@ void tst_MacGui::splashScreenModality() QVERIFY(QTestEventLoop::instance().timeout() == false); } - -/* - Test that a non-modal dialog created as a child of a modal dialog is - shown in front. -*/ -void tst_MacGui::dialogModality() -{ - QDialog d; - d.setModal(true); - d.show(); - - QProgressDialog progress(&d); - progress.setValue(2); - - InterfaceChildPair interface = wn.find(QAccessible::Name, "Cancel", &progress); - QVERIFY(interface.iface); - const int delay = 2000; - clickLater(interface, Qt::LeftButton, delay); - - connect(&progress, SIGNAL(canceled()), SLOT(exitLoopSlot())); - - const int timeout = 3; - QTestEventLoop::instance().enterLoop(timeout); - QVERIFY(QTestEventLoop::instance().timeout() == false); -} - class PrimaryWindowDialog : public QDialog { Q_OBJECT diff --git a/tests/auto/macnativeevents/tst_macnativeevents.cpp b/tests/auto/macnativeevents/tst_macnativeevents.cpp index 08ab9e6..70a14f5 100644 --- a/tests/auto/macnativeevents/tst_macnativeevents.cpp +++ b/tests/auto/macnativeevents/tst_macnativeevents.cpp @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -65,6 +66,7 @@ private slots: void testMouseDragToNonClientArea(); void testDragWindow(); void testMouseEnter(); + void testChildDialogInFrontOfModalParent(); }; void tst_MacNativeEvents::testMouseMoveLocation() @@ -282,6 +284,28 @@ void tst_MacNativeEvents::testMouseEnter() QVERIFY2(expected.waitForAllEvents(), "the test did not receive all expected events!"); } +void tst_MacNativeEvents::testChildDialogInFrontOfModalParent() +{ + // Test that a child dialog of a modal parent dialog is + // in front of the parent, and active: + QDialog parent; + parent.setWindowModality(Qt::ApplicationModal); + QDialog child(&parent); + QPushButton button("close", &child); + connect(&button, SIGNAL(clicked()), &child, SLOT(close())); + parent.show(); + child.show(); + QPoint inside = button.mapToGlobal(button.geometry().center()); + + // Post a click on the button to close the child dialog: + NativeEventList native; + native.append(new QNativeMouseButtonEvent(inside, Qt::LeftButton, 1, Qt::NoModifier)); + native.append(new QNativeMouseButtonEvent(inside, Qt::LeftButton, 0, Qt::NoModifier)); + + native.play(); + QTest::qWait(100); + QVERIFY(!child.isVisible()); +} #include "tst_macnativeevents.moc" -- cgit v0.12