[PySide] Compiling PySide with a custom namespace

72 views
Skip to first unread message

Elias Bachaalany

unread,
Nov 11, 2010, 6:30:48 AM11/11/10
to pys...@lists.openbossa.org
Hello

I could not find a way to compile PySide with a custom workspace (aka
QT_NAMESPACE) so I submit this patch.

If there is a way please let me know how, otherwise I hope you can
incorporate this.


Changes summary:

1. I injected the FromCObject() method to QWidget(). This allows passing
widgets wrapped in a CObject from a C++ program.

If there is a an existing way to do that without this patch please let
me know.

2. To specify the namespace just set QT_NAMESPACE environment variable
to the desired value before calling CMake.

Now that is not optimal but I am a newbie at CMake

3. In shiboken, this:

[quote]
//only cause namespace confusion
enum SampleNamespace

[/quote]

Is not compiling with VC 9, I commented it out. You can ignore this
patch nonetheless can you verify that VC 9 fails to build during its
presence?


All feedback is appreciated.

Thanks,
Elias

pyside-qtnamespace.zip

Elias Bachaalany

unread,
Nov 15, 2010, 9:58:10 AM11/15/10
to pys...@lists.openbossa.org
Anyone can help?

_______________________________________________
PySide mailing list
PyS...@lists.openbossa.org
http://lists.openbossa.org/listinfo/pyside

Renato Araujo Oliveira Filho

unread,
Nov 16, 2010, 9:07:22 AM11/16/10
to Elias Bachaalany, pys...@lists.openbossa.org
Hi Elias,

Thanks for your patch I will check this ASAP, now I working to get
some critical bugs fixes before the next release.

On Mon, Nov 15, 2010 at 11:58 AM, Elias Bachaalany
<lallous...@yahoo.com> wrote:
> Anyone can help?
>
> On 11/11/2010 12:30 PM, Elias Bachaalany wrote:
>>
>> Hello
>>
>> I could not find a way to compile PySide with a custom workspace (aka
>> QT_NAMESPACE) so I submit this patch.
>>
>> If there is a way please let me know how, otherwise I hope you can
>> incorporate this.
>>
>>
>> Changes summary:
>>
>> 1. I injected the FromCObject() method to QWidget(). This allows passing
>> widgets wrapped in a CObject from a C++ program.

I think this is a good functionality but this should be more generic
and create a global function to works with any PySide type, will be
strange have this only for QWidget.

>>
>> If there is a an existing way to do that without this patch please let
>> me know.
>>
>> 2. To specify the namespace just set QT_NAMESPACE environment variable
>> to the desired value before calling CMake.
>>
>> Now that is not optimal but I am a newbie at CMake

I will check this and verify if we have a best solution for that

>>
>> 3. In shiboken, this:
>>
>> [quote]
>> //only cause namespace confusion
>> enum SampleNamespace
>>
>> [/quote]
>>
>> Is not compiling with VC 9, I commented it out. You can ignore this
>> patch nonetheless can you verify that VC 9 fails to build during its
>> presence?

Yes I know that, and we have already fixed that to windows on git head.


Thanks


--
Renato Araujo Oliveira Filho
Instituto Nokia de Tecnologia - INdT
Mobile: +55 (81) 8704-2144

Elias Bachaalany

unread,
Nov 16, 2010, 9:24:15 AM11/16/10
to pys...@lists.openbossa.org
Hello Renato,

>
> Thanks for your patch I will check this ASAP, now I working to get
> some critical bugs fixes before the next release.
>
>

Thanks for considering the patch.

Take your time. I will watch this thread for updates from the PySide team.

>>>
>>> I could not find a way to compile PySide with a custom workspace (aka
>>> QT_NAMESPACE) so I submit this patch.
>>>
>>> If there is a way please let me know how, otherwise I hope you can
>>> incorporate this.
>>>
>>>
>>> Changes summary:
>>>
>>> 1. I injected the FromCObject() method to QWidget(). This allows passing
>>> widgets wrapped in a CObject from a C++ program.
>
> I think this is a good functionality but this should be more generic
> and create a global function to works with any PySide type, will be
> strange have this only for QWidget.
>

Yes you are right. Perhaps the Shiboken API allows passing C++ objects
wrapped PyCObjects to PySide, perhaps not, no idea.

In PyQt, sip module allows that:

py_qwidget = sip.wrapinstance(sip.voidptr(pycobj_cpp_qwidget).__int__(),
QtGui.QWidget)

>>>
>>> 2. To specify the namespace just set QT_NAMESPACE environment variable
>>> to the desired value before calling CMake.
>>>
>>> Now that is not optimal but I am a newbie at CMake
> I will check this and verify if we have a best solution for that
>

Thanks.

>>>
>>> 3. In shiboken, this:
>>>
>>> [quote]
>>> //only cause namespace confusion
>>> enum SampleNamespace
>>>
>>> [/quote]
>>>
>>> Is not compiling with VC 9, I commented it out. You can ignore this
>>> patch nonetheless can you verify that VC 9 fails to build during its
>>> presence?
>
> Yes I know that, and we have already fixed that to windows on git head.
>

Excellent.

Btw, is there is a way to exclude building the tests, phonon and other
select stuff while configuring / building PySide? Currently I comment
out the targets from the cmake files.

Regards,
Elias

Hugo Parente Lima

unread,
Nov 16, 2010, 10:21:25 AM11/16/10
to pys...@lists.openbossa.org, Elias Bachaalany
On Tuesday 16 November 2010 12:24:15 Elias Bachaalany wrote:
> Btw, is there is a way to exclude building the tests, phonon and other
> select stuff while configuring / building PySide? Currently I comment
> out the targets from the cmake files.

You can disable or enable all tests, not selected tests. As additional note,
tests from modules not built, I mean not detected or disabled, wont run.

Btw you can disable all tests using -DBUILD_TESTS=FALSE when running cmake.

Regards

--
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia

signature.asc
Reply all
Reply to author
Forward
0 new messages