From 454e18b91eddc422607cddd683baac30bdc89513 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 21 Aug 2009 17:38:54 +0200 Subject: Added missing Q_ENUM/Q_FLAGS declarations for input methods. Reviewed-by: axis --- src/corelib/global/qnamespace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index ab9a3ca..97026ad 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -91,7 +91,8 @@ Qt { Q_FLAGS(MatchFlags) Q_FLAGS(KeyboardModifiers MouseButtons) Q_ENUMS(WindowType WindowState WindowModality WidgetAttribute ApplicationAttribute) - Q_FLAGS(WindowFlags WindowStates) + Q_ENUMS(InputMethodHint) + Q_FLAGS(WindowFlags WindowStates InputMethodHints) Q_ENUMS(ConnectionType) #endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN)) -- cgit v0.12 From 2590135cd8542aa780141b67ab8fa4227ee4fde0 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 21 Aug 2009 15:24:17 +0200 Subject: make moc, qregion and qsharedpointer autotest compile with namespaces --- tests/auto/moc/testproject/Plugin/Plugin.h | 2 ++ tests/auto/qregion/tst_qregion.cpp | 7 ++++++- tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 2 ++ tests/auto/qsharedpointer/wrapper.h | 3 +++ .../qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/auto/moc/testproject/Plugin/Plugin.h b/tests/auto/moc/testproject/Plugin/Plugin.h index da3fa16..90fd985 100644 --- a/tests/auto/moc/testproject/Plugin/Plugin.h +++ b/tests/auto/moc/testproject/Plugin/Plugin.h @@ -45,6 +45,8 @@ struct MyInterface virtual void blah() = 0; }; +QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(MyInterface, "MyInterface") +QT_END_NAMESPACE diff --git a/tests/auto/qregion/tst_qregion.cpp b/tests/auto/qregion/tst_qregion.cpp index 8c49146..063b024 100644 --- a/tests/auto/qregion/tst_qregion.cpp +++ b/tests/auto/qregion/tst_qregion.cpp @@ -965,10 +965,15 @@ void tst_QRegion::regionToPath_data() } } +#ifdef QT_BUILD_INTERNAL +QT_BEGIN_NAMESPACE +extern QPainterPath qt_regionToPath(const QRegion ®ion); +QT_END_NAMESPACE +#endif + void tst_QRegion::regionToPath() { #ifdef QT_BUILD_INTERNAL - extern QPainterPath qt_regionToPath(const QRegion ®ion); QFETCH(QPainterPath, path); diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index 50818fe..93f5b6e 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -51,9 +51,11 @@ #include #include +QT_BEGIN_NAMESPACE namespace QtSharedPointer { Q_CORE_EXPORT void internalSafetyCheckCleanCheck(); } +QT_END_NAMESPACE #ifdef Q_OS_SYMBIAN #define SRCDIR "." diff --git a/tests/auto/qsharedpointer/wrapper.h b/tests/auto/qsharedpointer/wrapper.h index c006686..4445860 100644 --- a/tests/auto/qsharedpointer/wrapper.h +++ b/tests/auto/qsharedpointer/wrapper.h @@ -41,7 +41,10 @@ #ifndef WRAPPER_H #define WRAPPER_H +QT_BEGIN_NAMESPACE template class QSharedPointer; +QT_END_NAMESPACE + class Wrapper { public: diff --git a/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp b/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp index d03b999..744e86a 100644 --- a/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp +++ b/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp @@ -43,9 +43,11 @@ #include #include +QT_BEGIN_NAMESPACE namespace QtSharedPointer { Q_CORE_EXPORT void internalSafetyCheckCleanCheck(); } +QT_END_NAMESPACE class tst_QSharedPointer_and_QWidget: public QObject { -- cgit v0.12 From 646da79a07166d7d1ec76983d38ad2270db76754 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 21 Aug 2009 18:00:36 +0200 Subject: compile fix with namespaces in QGLCustomShaderStagePrivate --- src/opengl/gl2paintengineex/qglcustomshaderstage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp index a82caa0..9a5cd10 100644 --- a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp +++ b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp @@ -44,6 +44,8 @@ #include "qpaintengineex_opengl2_p.h" #include +QT_BEGIN_NAMESPACE + class QGLCustomShaderStagePrivate { public: @@ -121,3 +123,5 @@ void QGLCustomShaderStage::setSource(const QByteArray& s) Q_D(QGLCustomShaderStage); d->m_source = s; } + +QT_END_NAMESPACE -- cgit v0.12 From fdc159ad6fd03d0e179e7dde7fe47e592936573c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 Aug 2009 18:00:10 +0200 Subject: Revert "Remove a global destructor from QtDBus." This reverts commit 3ed5b5ebf5b360dedbba14c03f6ca5701b3b9290. That was a well-intentioned commit and technically correct, but it breaks when there are static QDBusConnection objects in something that is loaded before QtDBus (like libraries that depend on QtDBus or applications like qdbus) Since QDBusConnection is ref-counted, the last instance is supposed to disconnect. However, if we have already unloaded libdbus-1, we can't do that. Q_GLOBAL_STATICs are destroyed too soon. --- src/dbus/qdbus_symbols.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dbus/qdbus_symbols.cpp b/src/dbus/qdbus_symbols.cpp index 356b14c..ca0147a 100644 --- a/src/dbus/qdbus_symbols.cpp +++ b/src/dbus/qdbus_symbols.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include "qdbus_symbols_p.h" #include #include #include @@ -53,7 +52,7 @@ void *qdbus_resolve_me(const char *name); static QLibrary *qdbus_libdbus = 0; -static void qdbus_unloadLibDBus() +void qdbus_unloadLibDBus() { delete qdbus_libdbus; qdbus_libdbus = 0; @@ -77,11 +76,8 @@ bool qdbus_loadLibDBus() lib->setFileName(QLatin1String("dbus-1")); for (uint i = 0; i < sizeof(majorversions) / sizeof(majorversions[0]); ++i) { lib->setFileNameAndVersion(lib->fileName(), majorversions[i]); - if (lib->load() && lib->resolve("dbus_connection_open_private")) { - struct Unloader { ~Unloader() { qdbus_unloadLibDBus(); } }; - static Unloader unloader; + if (lib->load() && lib->resolve("dbus_connection_open_private")) return true; - } lib->unload(); } @@ -111,6 +107,8 @@ void *qdbus_resolve_me(const char *name) return ptr; } +Q_DESTRUCTOR_FUNCTION(qdbus_unloadLibDBus) + QT_END_NAMESPACE #endif -- cgit v0.12