1
Window / qt5 widgetHandle -> SFML2.0
« on: September 26, 2016, 12:51:09 pm »
Hi I am trying to setup a QTSFMLCanvas as seen in eg: http://becomingindiedev.blogspot.se/2013/10/qt-5-and-sfml-20-integration.html
Qt5-widget has a winId() method that is supposed to return the native handler for the widget. On my platform (linux Arch 64bit) it is a long long unsigned int and RenderWindow seems to want a long unsigned int.
hence,
RenderWindow::create(reinterpret_cast<sf::WindowHandle>(winId()));
fails with: invalid cast from type 'WId {aka long long unsigned int}' to type 'sf::WindowHandle {aka long unsigned int}'
Is there a workaround or a way to convert the handle? I have been giving google hard time with this one and have found nothing.
static_cast just hangs the application.
Any ideas?
Qt5-widget has a winId() method that is supposed to return the native handler for the widget. On my platform (linux Arch 64bit) it is a long long unsigned int and RenderWindow seems to want a long unsigned int.
hence,
RenderWindow::create(reinterpret_cast<sf::WindowHandle>(winId()));
fails with: invalid cast from type 'WId {aka long long unsigned int}' to type 'sf::WindowHandle {aka long unsigned int}'
Is there a workaround or a way to convert the handle? I have been giving google hard time with this one and have found nothing.
static_cast just hangs the application.
Any ideas?