-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example 10.2 not working with soqt #18
Comments
looooo@246b859
|
I found the following bug in Does this already fix this issue for you on linux64? There is at least one additional bug specific two win64, though, a 32->64 bit address overflow problem with I'm going to retry whether this fixes my remaining issue(s) with a correspondingly patched version of Shiboken. |
Thanks for the information. I tested only with python2 because only there I have a shiboken available. The But the problem with returning the correct subclass of QEvent is still remaining. Yesterday I figuered out, that the typemaps(out) for QEvent are not placed inside the wrapper-cpp-file. The only function which has potential to be the root of the problem for 10.2 can be found here |
mottosso/Qt.py#53 (comment) there is a difference in wrapping with shiboken and sip. We have to wrap first to a baseobject and then get the classname of the subclass and wrap again. |
Yes, I had already tried this suggested solution yesterday evening from the python side (using your example renderAreaCallback.py extended with |
I don't think relying on c++ shiboken library will simplify our lives. As the remaining issue here should be quite solveable, I will try to do so for linux. Maybe I have time to look at windows afterwards. |
Solveable, yes, definitely (either on the python [application] side using Nathan's function or much nicer transparently in SoQt.i). Correctness including thread safety first, i.e. also wrapping the reentrant calls to the python interpreter |
the solution of Nathan still doesn't work for us. The problem is that a QEvent is not a QObject and therefor has no method to get it's subclass name. So somehow we have to get the subclass-name from the pure QEvent object. This not necessarily have to be done in python. I would simple call the corresponding python functions with the python-capi...
9.1 uses a SoEventCallback. I do not have insights in how the coin-callback-mechanism works, but example 10.2 could be simple solved by using also a coin.SoEventCallback. For me the absence of the possibility to set the callback directly is not a big problem.
This is true for python callbacks anyway. But simple interactions are quite possible. eg: https://forum.freecadweb.org/viewtopic.php?f=22&t=21808#p169625 |
maybe it's also interesting how quarter translates the events to pivy/coin: |
it's actually listed as a bug for shiboken: so I would say, we should use SoEventCallbacks for example 10.2 to workaround and make a note that QEvents are not handled properly with pyside. |
on linux 10.2 works now. I also added a option to run the example with SoCallBack workaround: |
What an amazing contribution! Excellent work, well done! I reckon I still have to patch shiboken on win64, however, since I still receive the known address overflow problem testing example 10.2. Could you please fix just one minor issue specific to compilation with msvc14: in line 107 and 112 of |
Could you please commit a win64 specific modification to PS: The compiler warning that is going to be fixed by this is |
To this end, I had no success with running example 10.2 in just fixing the 64-bit addressing problem in shiboken's 1.2.2 Here is what I tried to this end in a more detailed description: Following the discussion in and applying the fix suggested in by adding a line for a missing type declaration: and changing signature of wrapInstance to: this didn't fix the ... cloning PySide from: ... building it with: (required some minor adjustments to setup.py for python 3.6) ... successfully built me a PySide wheel with the patched shiboken after its pip-installation to I had to copy the following three files |
Running
raised in line 393 in file Callstack: I receive the same exception now when trying to run all other SoQt examples. |
With trying
|
pyside for python3.5 is not really released. It works for linux, but needs some patching on windows. As far as I can tell, the conda version is working quite fine on windows. Maybe you can have a look at there recipe: If we could setup a conda-recipe for soqt we could also build pivy with soqt on conda. Currently I only build coin for conda. This would allow to use pyside from conda... |
I have successfully setup a conda-recipe for soqt on linux. On windows this doesn't work. Do you know how to compile soqt on windows? |
Yes, I do, employing a msvc14 solution for python 3.6 that should also work with python 3.5 after some minor tweaks. I have also created a working msvc10 solution for python 3.4. Would this be good enough for you? Otherwise I could prepare a qmake project file or a corresponding CMakeList.txt if this would be of any help. To this end I have no experience with conda, yet. N.B.: CPython versions on windows (and custom packages built for them) unfortunately depend on specific versions of the msvc runtime as documented here: https://wiki.python.org/moin/WindowsCompilers - msvc is available as a free community edition (requiring a shocking 8 gb of disk space) but at least it ships with the x64 compiler included by default. The (commercial) msvc10 pro also ships with an x64 compiler, however, the free msvc10 community edition doesn't / ships with a 32-bit x86 compiler only. Neverthless, there is a corrsponding freely available platform sdk available with x64 compiler support for msvc10. However,, I got the impression the sdk's C runtime was slightly different from CPython's 3.4 one which would lead to unexpectedruntime problems with custom build packes. Anyhow, welcome to the brave new windows world. I'm still shocked about their decision to make It would be great if conda was hiding all these unnecessary build complexities for building CPython packages on windows ... |
conda is quite a nice tool. It simplifies the build process. (At least it's my impression) We have already setup all dependencies of freecad as conda recipes... There are also very good documentation of conda out there. If you want I can give you some references.... Today I also tried the pivy binding of soqt with python3. (Previously I always used python2 to test the pyqt->pyside port) And there are still problem with 10.2.
it would be nice if you could give me some instructions how to build soqt on windows. There is a cmake-branch available https://bitbucket.org/roboticslibrary/soqt/src, but there were some problems with the building. So the options are:
|
ok I know now how to run the ./configure in windows:
|
Thanks for the information and that I may assist with your roadmap. Just out of my memory, configure relies on autotools and therefore on windows is only supported by the mingw compiler (already shipping with the WinPython distribution for example). Mingw has the advantage on windows that its build outputs do not depend on python version / msvc depended compiler runtimes but are self-contained executables and dlls in this respect. However, I'm unsure whether using it would be a good idea and I haven't done so on windows, since it does not seem to be the default way for building cpython packages on windows that depend on external shared libaries / dlls (cf. e.g. the well known python package repository for windows maintained by Chris Gohlke @ uci). Neverthless, some people manage to build dll-depended cpython packages for windows using mingw that are not specific to a particular cpython version. Therefore, I suggest that I transfer my current msvc14 solution to a qmake pro file (since soqt is for usage with qt anyhow) or modify the existing cmake-branch. It might become Saturday though before I will find enough time for that ... |
with a minimal change soqt compiles for me on linux with cmake: but compiling the version I uploaded to github reports missing files. This is quite strange. Also creating a compressed file doesn't work. No idea whats wrong there.
|
building directly from the source doesn't show any
|
The editor widgets for material properties and setting up a directional light were never ported to SoQt 1.5 and are not needed by most people, anyway, these days, since e.g. Qt includes now a very nice default widget for selecting colors (QRGBColorChooser if I remember correctly). Therefore, these legacy editors are also not part of linux packages of SoQt. You may want to just comment these out of the CMakeList ... (they are legacy from SoQt 1.2 and are based on Qt3 or even Qt2 and nobody saw a need to port them to Qt4. Once an SoQt-based ExaminerEmbed example will work with PySide the functionality of these legacy editors could very easily be replaced from the application side using QWidgets if needed.) |
I've decided to derive a qmake .pro file from my current msvc14 solution for SoQt-1.6.0a. Slowly, I'm getting there. It compiles fine now using nmake makefiles, however, I still get some linker errors. While porting the build system to qmake, I've found and fixed a win64 address trunctation problem in template file PS: The same fix needs to be applied in |
The following qmake .pro successfully built me both soqt1.dll and soqt1.lib calling
|
Your workaround for 10.2 with option |
import shiboken works for:
actually I made some mistakes previously on windows10. Quarter does work for me. Only 10.2 without
So maybe again some problems with pyside. |
some further observation in win10:
|
On 64-bit win10, example 10.2 only works as expected for me with option
On 64-bit win10, with
In random cases, when example 10.2 does not start up at all with shiboken and crashes directly on startup for me, then the attached post-mortem debugger halted at an exception in this constructor call
however, then the pointers like PS: Since under 64-bit win10 example 10.2 with option |
just came across these two warnings:
|
Test case: running failing example 10.2 on 64-bit win10 with available
|
so this is again a problem with the pointer-size? Allthough it is now set to size_t. |
|
Working backwards from line 43 in SoQrarenderArea.i, I'll have to insert printf statements to see what is going on and maybe to test assumptions and spot differences against a working scenario on win7 or eventually linux64, since I do not have a debug build of py3, pivy, qt, ... you name it .... therefore, the good old printf debugger should be my best bet ... some Maya folks apparently had a very similar OverflowError: need a shiboken based type ... and recommend as a solution to import shiboken only as |
FWIW, I have updated my PySide wheels with the shiboken 64-bit address patch. The OverflowError should be fixed. |
Dear Chris Gohlke, thank you very much indeed, I'll be most happy to try this. I can confirm that the issue for me on win10 was
However, a bit surprisingly, a slightly smaller 32-bit address Now I can test this against your wheel .... I reckon you made my day :-) |
Works for me:
|
finally, this minimal test case above also works for me, too :-) Thank you very much indeed! ... now, I'm looking forward to test example 10.2 and examinerEmbed4.py (testing the embedding of a Coin3D / OpenInventor examiner viewer into a PySide application that also failed on 64-bit win10 to this end) |
Unfortunately, running example 10.2 still fails for me with an |
after recompiling pivy, I interestingly receive now a different error message than before: |
@looooo you may want to try and add the following script to
|
added your test. just a side note:
I think shiboken should be importable directly. At least that was my conclusion from reporting it to conda: the test fails for win10 and ubuntu at:
ps.: same is also true for win7. does this work for you? |
Yes, it works for me, but I don't know why. It should have worked with the patch for PySide-103, however, it didn't ... both my patched build based on krrr's PySide and according to your PySide recipe failed for me regarding shiboken PS: I've also found the bug :-) example 10.2 and examinerEmbed4 now happily work for me on 64-bit win10 ... I still have to investigate things a bit further and need to tidy up ... |
btw ... the bug was a type downcast error from a 64-bit address (of a |
wow, that are very good news. thanks for all the work! |
Sorry for my late reply. I needed to take a little break away from pivy after diving deep into this issue. Please find my patched versions of I feel it would be really good if we knew how the build these patched wheels ourselves just in case we need to fix more issues in PySide. Also, please note that I've not patched the python2 version |
thanks for your collaboration. |
the pyside problem was patched in the conda-package: conda-forge/pyside-feedstock@bd60246 I think I will try to create pivy-packages for win and linux this weekend and look if the problems on win10 is still there. @cgohlke do you have a list of patches you use for your pyside-package? |
Source code is at http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyside in PySide-1.2.4-vc14-x64.zip. |
thanks a lot @cgohlke . The diff of these files can be found here: https://github.com/looooo/pyside-feedstock/blob/master/recipe/win_pointer_conversation_fix.patch |
finally this solves 10.2 on windows 10 and conda. That is a big step forward :-)
|
@InventorMentor I can add you as author of the mentioned commit later anyway. Just tell me how ou would like to handle this. |
PySide.QtCore.Qevent is not properly wrapped:
<pivy.gui.soqt.QEvent; proxy of <Swig Object of type 'QEvent *' at 0x00000187BBBAA8D0> >
The text was updated successfully, but these errors were encountered: