Hello,
I was trying to compile PyQt while using Qt that is configured with a
different namespace.
The steps to do that:
1. Configure sip with: configure.py DEFINES+=QT_NAMESPACE=x
2. Apply the attached patch (tested with PyQt 4.7.7 and Qt SDK 4.6.3)
3. Configure PyQt with: configure.py --qtnamespace=x -w
Maybe I reinvented the wheel and missed some options that would allow me
to compile with a different namespace w/o having to resort to such a patch.
If this patch is correct or can be corrected and integrated in the
upcoming snapshots it would be great.
Thanks,
Elias
Left base folder: C:\Temp\PyQt-win-gpl-4.7.7
Right base folder: C:\Temp\patchPyQt-win-gpl-4.7.7
--- designer\pluginloader.h 2010-09-20 14:14:04.0 +-0200
+++ designer\pluginloader.h 2010-10-18 17:26:23.0 +-0200
@@ -36,15 +36,15 @@
#include
#include
#include
#include
-
+QT_BEGIN_NAMESPACE
class QDesignerCustomWidgetInterface;
-
+QT_END_NAMESPACE
class PyCustomWidgets
: public QObject, public QDesignerCustomWidgetCollectionInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
--- pylupdate\metatranslator.h 2010-09-20 14:14:04.0 +-0200
+++ pylupdate\metatranslator.h 2010-10-18 17:26:35.0 +-0200
@@ -39,13 +39,16 @@
#include
#include
#include
#include
#include
+
+QT_BEGIN_NAMESPACE
class QTextCodec;
+QT_END_NAMESPACE
class MetaTranslatorMessage : public TranslatorMessage
{
public:
enum Type { Unfinished, Finished, Obsolete };
--- pylupdate\translator.h 2010-09-20 14:14:04.0 +-0200
+++ pylupdate\translator.h 2010-10-18 17:26:44.0 +-0200
@@ -39,13 +39,15 @@
#include "QtCore/qbytearray.h"
#include "QtCore/qstringlist.h"
#include "QtCore/qlocale.h"
#include
class TranslatorPrivate;
+QT_BEGIN_NAMESPACE
template class QList;
+QT_END_NAMESPACE
class TranslatorMessage
{
public:
TranslatorMessage();
TranslatorMessage(const char * context, const char * sourceText,
--- qpy\QtCore\qpycore_api.h2010-09-20 14:14:04.0 +-0200
+++ qpy\QtCore\qpycore_api.h2010-10-18 12:43:23.0 +-0200
@@ -36,15 +36,15 @@
#include
#include
#include
#include "qpycore_shared.h"
-
+QT_BEGIN_NAMESPACE
class QObject;
-
+QT_END_NAMESPACE
// Support for pyqtSlot() and pyqtSignature().
PyObject *qpycore_pyqtslot(PyObject *args, PyObject *kwds);
PyObject *qpycore_pyqtsignature(PyObject *args, PyObject *kwds);
--- qpy\QtCore\qpycore_pyqtboundsignal.h2010-09-20 14:14:04.0
+-0200
+++ qpy\QtCore\qpycore_pyqtboundsignal.h2010-10-18 12:43:27.0
+-0200
@@ -34,14 +34,15 @@
#include
#include "qpycore_chimera.h"
+QT_BEGIN_NAMESPACE
class QObject;
-
+QT_END_NAMESPACE
extern "C" {
// This defines the structure of a bound PyQt signal.
typedef struct {
PyObject_HEAD
--- qpy\QtCore\qpycore_pyqtproxy.h 2010-09-20 14:14:04.0 +-0200
+++ qpy\QtCore\qpycore_pyqtproxy.h 2010-10-18 12:43:31.0 +-0200
@@ -43,13 +43,16 @@
#include "qpycore_chimera.h"
#include "qpycore_pyqtboundsignal.h"
#include "qpycore_sip.h"
#include "qpycore_types.h"
+QT_BEGIN_NAMESPACE
class QMutex;
+QT_END_NAMESPACE
+
class PyQt_PyObject;
// This class is used as a signal on behalf of Python signals and as a slot on
// behalf of Python callables. It is derived from QObject but is not run
// through moc. Instead the normal moc-generated methods are handwritten in
--- qpy\QtCore\qpycore_qobject_helpers.h2010-09-20 14:14:04.0
+-0200
+++ qpy\QtCore\qpycore_qobject_helpers.h2010-10-18 12:43:46.0
+-0200
@@ -35,15 +35,15 @@
#include
#include
#include "qpycore_sip.h"
-
+QT_BEGIN_NAMESPACE
class QObject;
-
+QT_END_NAMESPACE
const QMetaObject *qpycore_qobject_metaobject(sipSimpleWrapper *pySelf,
sipTypeDef *base);
int qpycore_qobject_qt_metacall(sipSimpleWrapper *pySelf, sipTypeDef *base,
QMetaObject::Call _c, int _id, void **_a);
int qpycore_qobject_qt_metacast(sipSimpleWrapper *pySelf, sipTypeDef *base,
--- qpy\QtCore\qpycore_sip.h2010-09-20 14:14:04.0 +-0200
+++ qpy\QtCore\qpycore_sip.h2010-10-18 16:48:28.0 +-0200
@@ -1,32 +1,32 @@
// This provides access to the SIP generated code for the QtCore module.
//
// Copyright (c) 2010 Riverbank Computing Limited
-//
+//
// This file is part of PyQt.
-//
+//
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file. Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riv