Re: [PyQt] Help with PyQt licensing question

2010-10-22 Thread Elias Bachaalany

On 10/22/2010 4:12 AM, Kyle Covington wrote:


Also thinking about Elias's question.  Windows is closed sourced and
commercial.  Windows is used to open and run Python and Windows is able
to execute Python scripts which can run PyQt.  So by extension GPL
should not be allowed on a Windows computer???



Interesting observation! :)


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Passing a QWidget* wrapped in a PyCObject from a C++ program?

2010-10-21 Thread Elias Bachaalany

Hi Phil,

Using Python 2.6, I could make it work with:

sip.wrapinstance(sip.voidptr(the_widget).__int__(), QtGui.QWidget)

But only after figuring out that I also had to recompile SIP with 
SIP_SUPPORT_PYCOBJECT


Thanks a lot.

--
Elias
On 10/18/2010 2:04 PM, Phil Thompson wrote:

On Mon, 18 Oct 2010 11:45:07 +0200, Elias Bachaalany
  wrote:

Hello

I have a C++ program that creates a QWidget* and can return that to

Python.


I want to pass that QWidget * to PyQt so that the newly created widgets
have this widget as their parent. How to do that?

In C++:

QWidget *theWidget;
PyObject *get_widget()
{
return PyCObject_FromVoidPtr(theWidget, NULL)
}

Now is it possible to get this QWidget* and give to PyQt / QWidget

class?

If your PyCObject is accessible from Python then you should be able to
do...

import sip
from PyQt4.QtGui import QWidget

widget = sip.wrapinstance(sip.voidptr(pycobj, QWidget))

Phil



___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Help with PyQt licensing question

2010-10-21 Thread Elias Bachaalany

Hello,

I have the following situation and need some help regarding licensing of 
PyQt.


There is a main program (main.exe) that is extensible via plugins.
main.exe does not know about the nature of its plugins.

The plugins are general purpose, they can do many things to change the 
behavior of main.exe.


main.exe is closed source.

One plugin could be hosting LUA scripting language.
Another plugin can be not related to scripting.

There is yet another plugin (plgpython.dll) that hosts Python and is 
open source (with New BSD License). Since plgpython.dll hosts Python, it 
can also host PyQt.


Now my question is: do we need a commercial license of PyQt if we own 
main.exe (paid for it) and use the open source / free plgpython.dll 
program to run PyQt scripts?


Thanks,
Elias

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Compiling PyQt 4 with QT_NAMESPACE=x

2010-10-19 Thread Elias Bachaalany

Thank you Phil.

For the plugin I am developing (which links to a different namespace set 
of QT dlls) can I provide precompiled PyQt (*.pyd) files for download 
meanwhile?


Regards,
Elias

On 10/18/2010 6:39 PM, Phil Thompson wrote:

On Mon, 18 Oct 2010 17:36:51 +0200, Elias Bachaalany
  wrote:

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.


It won't make it to the next release, but I'll look at it after that.

Thanks,
Phil



___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Compiling PyQt 4 with QT_NAMESPACE=x

2010-10-18 Thread Elias Bachaalany

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

[PyQt] Passing a QWidget* wrapped in a PyCObject from a C++ program?

2010-10-18 Thread Elias Bachaalany

Hello

I have a C++ program that creates a QWidget* and can return that to Python.

I want to pass that QWidget * to PyQt so that the newly created widgets 
have this widget as their parent. How to do that?


In C++:

QWidget *theWidget;
PyObject *get_widget()
{
  return PyCObject_FromVoidPtr(theWidget, NULL)
}

Now is it possible to get this QWidget* and give to PyQt / QWidget class?

Thank you,
Elias

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt