Creating a QWinmigrate mofules for PyQt5 using SIP

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a QWinmigrate mofules for PyQt5 using SIP

Andrew Cunningham
HI,

I am trying to create a QWinMigrate module using SIP for Qt5.7 I followed the instructions on https://cbuelter.wordpress.com/2015/02/11/compiling-pyqt-and-qtwinmigrate-for-3ds-max-2015/3/

But I am stuck at the SIP step. I had to modify the .sip file for QT5
%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
%Import QtWidgets/QtWidgetsmod.sip

But I still get the error message
sip: HWND is undefined

Thanks
Andrew

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Phil Thompson-5
On 15 Jun 2018, at 9:27 pm, Andrew Cunningham <[hidden email]> wrote:

>
> HI,
>
> I am trying to create a QWinMigrate module using SIP for Qt5.7 I followed the instructions on https://cbuelter.wordpress.com/2015/02/11/compiling-pyqt-and-qtwinmigrate-for-3ds-max-2015/3/
>
> But I am stuck at the SIP step. I had to modify the .sip file for QT5
> %Import QtCore/QtCoremod.sip
> %Import QtGui/QtGuimod.sip
> %Import QtWidgets/QtWidgetsmod.sip
>
> But I still get the error message
> sip: HWND is undefined

You have to use the same -t and -x flags that were used to build the copy of PyQt5 you are building against. The only way to find these is to introspect PyQt5 using...

http://pyqt.sourceforge.net/Docs/PyQt5/extension_api.html#python-api

Phil
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Andrew Cunningham
Hi Phil,
I tried that ,

py> QtCore.PYQT_CONFIGURATION

{'sip_flags': '-t WS_WIN -t Qt_5_7_0'}


And in configure.py


sip_cmd = " ".join([
config.sip_bin,"-c", ".", "-b", build_file,
"-t", "WS_WIN", "-t", "Qt_5_7_0",
basename + ".sip"
])


I still get
sip: HWND is undefined


My .sip files looks like this, should I be adding something else?


%Module QtWinMigrate 0

%Platforms {WS_WIN}

%Import QtGui/QtGuimod.sip
%Import QtWidgets/QtWidgetsmod.sip

%Include qwinhost.sip
%Include qwinwidget.sip
%Include qmfcapp.sip



On Sat, Jun 16, 2018 at 9:38 AM, Phil Thompson <[hidden email]> wrote:
On 15 Jun 2018, at 9:27 pm, Andrew Cunningham <[hidden email]> wrote:
>
> HI,
>
> I am trying to create a QWinMigrate module using SIP for Qt5.7 I followed the instructions on https://cbuelter.wordpress.com/2015/02/11/compiling-pyqt-and-qtwinmigrate-for-3ds-max-2015/3/
>
> But I am stuck at the SIP step. I had to modify the .sip file for QT5
> %Import QtCore/QtCoremod.sip
> %Import QtGui/QtGuimod.sip
> %Import QtWidgets/QtWidgetsmod.sip
>
> But I still get the error message
> sip: HWND is undefined

You have to use the same -t and -x flags that were used to build the copy of PyQt5 you are building against. The only way to find these is to introspect PyQt5 using...

http://pyqt.sourceforge.net/Docs/PyQt5/extension_api.html#python-api

Phil


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Phil Thompson-5
On 18 Jun 2018, at 5:18 pm, Andrew Cunningham <[hidden email]> wrote:

>
> Hi Phil,
> I tried that ,
> py> QtCore.PYQT_CONFIGURATION
> {'sip_flags': '-t WS_WIN -t Qt_5_7_0'}
>
> And in configure.py
>
> sip_cmd = " ".join([
>     config.sip_bin,"-c", ".", "-b", build_file,
>     "-t", "WS_WIN", "-t", "Qt_5_7_0",
>     basename + ".sip"
> ])
>
> I still get
> sip: HWND is undefined
>
> My .sip files looks like this, should I be adding something else?
>
> %Module QtWinMigrate 0
>
> %Platforms {WS_WIN}

Remove the above line, although I'm not sure if it will make a difference.

Phil
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Andrew Cunningham
Tried that, no luck either.

On Mon, Jun 18, 2018 at 10:05 AM, Phil Thompson <[hidden email]> wrote:
On 18 Jun 2018, at 5:18 pm, Andrew Cunningham <[hidden email]> wrote:
>
> Hi Phil,
> I tried that ,
> py> QtCore.PYQT_CONFIGURATION
> {'sip_flags': '-t WS_WIN -t Qt_5_7_0'}
>
> And in configure.py
>
> sip_cmd = " ".join([
>     config.sip_bin,"-c", ".", "-b", build_file,
>     "-t", "WS_WIN", "-t", "Qt_5_7_0",
>     basename + ".sip"
> ])
>
> I still get
> sip: HWND is undefined
>
> My .sip files looks like this, should I be adding something else?
>
> %Module QtWinMigrate 0
>
> %Platforms {WS_WIN}

Remove the above line, although I'm not sure if it will make a difference.

Phil


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Andrew Cunningham
I eventually solved the issue by just replacing HWND with long

On Tue, Jun 19, 2018 at 2:31 PM, Andrew Cunningham <[hidden email]> wrote:
Tried that, no luck either.

On Mon, Jun 18, 2018 at 10:05 AM, Phil Thompson <[hidden email]> wrote:
On 18 Jun 2018, at 5:18 pm, Andrew Cunningham <[hidden email]> wrote:
>
> Hi Phil,
> I tried that ,
> py> QtCore.PYQT_CONFIGURATION
> {'sip_flags': '-t WS_WIN -t Qt_5_7_0'}
>
> And in configure.py
>
> sip_cmd = " ".join([
>     config.sip_bin,"-c", ".", "-b", build_file,
>     "-t", "WS_WIN", "-t", "Qt_5_7_0",
>     basename + ".sip"
> ])
>
> I still get
> sip: HWND is undefined
>
> My .sip files looks like this, should I be adding something else?
>
> %Module QtWinMigrate 0
>
> %Platforms {WS_WIN}

Remove the above line, although I'm not sure if it will make a difference.

Phil



_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Barry Scott
Given hwnd is defined in a windows header file, shouldn’t you include that header file?

Barry


On 20 Jun 2018, at 17:58, Andrew Cunningham <[hidden email]> wrote:

I eventually solved the issue by just replacing HWND with long

On Tue, Jun 19, 2018 at 2:31 PM, Andrew Cunningham <[hidden email]> wrote:
Tried that, no luck either.

On Mon, Jun 18, 2018 at 10:05 AM, Phil Thompson <[hidden email]> wrote:
On 18 Jun 2018, at 5:18 pm, Andrew Cunningham <[hidden email]> wrote:
>
> Hi Phil,
> I tried that ,
> py> QtCore.PYQT_CONFIGURATION
> {'sip_flags': '-t WS_WIN -t Qt_5_7_0'}
>
> And in configure.py
>
> sip_cmd = " ".join([
>     config.sip_bin,"-c", ".", "-b", build_file,
>     "-t", "WS_WIN", "-t", "Qt_5_7_0",
>     basename + ".sip"
> ])
>
> I still get
> sip: HWND is undefined
>
> My .sip files looks like this, should I be adding something else?
>
> %Module QtWinMigrate 0
>
> %Platforms {WS_WIN}

Remove the above line, although I'm not sure if it will make a difference.

Phil


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Phil Thompson-5
On 20 Jun 2018, at 8:38 pm, Barry <[hidden email]> wrote:
>
> Given hwnd is defined in a windows header file, shouldn’t you include that header file?
>
> Barry

The problem occurs before you get to the compiler.

Phil

> On 20 Jun 2018, at 17:58, Andrew Cunningham <[hidden email]> wrote:
>
>> I eventually solved the issue by just replacing HWND with long
>>
>> On Tue, Jun 19, 2018 at 2:31 PM, Andrew Cunningham <[hidden email]> wrote:
>> Tried that, no luck either.
>>
>> On Mon, Jun 18, 2018 at 10:05 AM, Phil Thompson <[hidden email]> wrote:
>> On 18 Jun 2018, at 5:18 pm, Andrew Cunningham <[hidden email]> wrote:
>> >
>> > Hi Phil,
>> > I tried that ,
>> > py> QtCore.PYQT_CONFIGURATION
>> > {'sip_flags': '-t WS_WIN -t Qt_5_7_0'}
>> >
>> > And in configure.py
>> >
>> > sip_cmd = " ".join([
>> >     config.sip_bin,"-c", ".", "-b", build_file,
>> >     "-t", "WS_WIN", "-t", "Qt_5_7_0",
>> >     basename + ".sip"
>> > ])
>> >
>> > I still get
>> > sip: HWND is undefined
>> >
>> > My .sip files looks like this, should I be adding something else?
>> >
>> > %Module QtWinMigrate 0
>> >
>> > %Platforms {WS_WIN}
>>
>> Remove the above line, although I'm not sure if it will make a difference.
>>
>> Phil
>>
>>
>> _______________________________________________
>> PyQt mailing list    [hidden email]
>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Creating a QWinmigrate mofules for PyQt5 using SIP

Phil Thompson-5
In reply to this post by Andrew Cunningham
On 20 Jun 2018, at 5:58 pm, Andrew Cunningham <[hidden email]> wrote:
>
> I eventually solved the issue by just replacing HWND with long

My previous suggestions were based on the (incorrect) assumption that PyQt5 defined HWND. PyQt4 does, but PyQt5 doesn't.

The correct answer is the add something like...

typedef struct HWND__ *HWND;

...to the .sip file.

Phil
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt