tags:

views:

64

answers:

1

Hi all Im trying to embed a display from an alien application (python OCC) into (Py)Qt using the winId of the widget. But when i pass it to OCC i get an overflow error. Inspecting the winId qt returns its 4318283408 which is more than a 32bit number. Im running 64bits (osx) and both libraries are compiled for 64bit, but i have a hunch that OCC only likes 32bit numbers still. So my question is, is there any way to control the range of the winId that Qt return?

Thanks

Henrik

A: 

Looking in Qt's source code, in the file src/gui/kernel/qwindowdefs.h, you'll find that WId is typedef'd to long for 64-bits OSX (it's int for 32-bits OSX). A long on 64-bits OSX is 8 bytes long (or 64 bits), and therefore 4318283408 is a valid value.

If you want to force winId() to return a 32 bits value, you will need to link to a 32-bits version of the Qt's library.

Fred
Hmmm.. both libraries i use are 64 bit, but i suspect that 64bit port of OCC is not entirely 64bit-ready. Was hoping there might be some obscure setting in Qt that could modify the winId somehow? at least as a temporary hack
Henrik