1
SFML projects / Qt 5 & SFML 2 integration with events
« on: July 26, 2015, 09:15:01 pm »
Hello everyone.
I was working on a level editor, as such I decided to use Qt for native widgets and dialogs.
Unfortunately, SFML-specific events don't work out of the box in Qt 5.
I rolled a hacky solution that translates Qt events into SFML events. Left/right control, shift, system and alt buttons are currently undifferentiated as Qt sees them as one button, but everything else seems to work well.
This is based on the Qt + SFML 1.6 tutorial and this article, I simply got rid of multiple inheritance, added signals instead of forcing the user to inherit from Canvas and added code that translates events.
https://bitbucket.org/Simonge/qsf
I was working on a level editor, as such I decided to use Qt for native widgets and dialogs.
Unfortunately, SFML-specific events don't work out of the box in Qt 5.
I rolled a hacky solution that translates Qt events into SFML events. Left/right control, shift, system and alt buttons are currently undifferentiated as Qt sees them as one button, but everything else seems to work well.
This is based on the Qt + SFML 1.6 tutorial and this article, I simply got rid of multiple inheritance, added signals instead of forcing the user to inherit from Canvas and added code that translates events.
https://bitbucket.org/Simonge/qsf