Question

I want SFML render window to display in qt widget

I've follow the tutorial below. http://becomingindiedev.blogspot.com/2013/10/qt-5-and-sfml-20-integration.html

but It gives this error:

"error: invalid conversion from 'void*' to 'sf::WindowHandle {aka HWND__*}' [-fpermissive] RenderWindow::create((void *) winId());^"

The error line is:

RenderWindow::create((void *) winId());

I have no idea, How can I fix this?

Was it helpful?

Solution

(Converting comment to short answer)

Because types do not match in source code, you need to tell the C++ compiler that they really do match, and you know what you doing, by using explicit cast:

RenderWindow::create(reinterpret_cast<sf::WindowHandle>(winId()));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top