WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-03-2011, 08:02 PM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
THANK YOU VERY MUCH!!!

This is impressive!!!! We are going to port our code to QT. Thanks!
Reply With Quote
  #2  
Old 10-20-2011, 09:47 AM
kovitch kovitch is offline
Member
 
Join Date: Sep 2010
Posts: 30
Hi,

I'm using the same code provided and i'm trying to accomplish something similar to this but for PySide. However, i'm having a small problem. The following line:

Code:
viz.go(viz.EMBEDDED,window=int(self.widget.winId()))
Leads to the following error:

Code:
Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "F:\Docs\Vizard Scripts\PyQTMenu.py", line 107, in <module>
    mainWin = MainWindow()
  File "F:\Docs\Vizard Scripts\PyQTMenu.py", line 26, in __init__
    viz.go(viz.EMBEDDED,window=int(self.widget.winId()))
TypeError: int() argument must be a string or a number, not 'PyCObject
Is there a way to solve it?

Best regards,

Alex.
Reply With Quote
  #3  
Old 10-20-2011, 09:55 AM
kovitch kovitch is offline
Member
 
Join Date: Sep 2010
Posts: 30
Solved.

For the record:

Code:
# Additional imports
from ctypes import pythonapi, c_void_pointer, py_object

# Setup arguments and return types
pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
pythonapi.PyCObject_AsVoidPtr.argtypes = [ py_object ]

# Convert PyCObject to a void pointer
hWnd = pythonapi.PyCObject_AsVoidPtr( view.winId() )

# Then use hWnd
viz.go( viz.EMBEDDED, window=int( hWnd ) )
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC