Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: QSFML – Nice SFML widget in Qt Window with basic events handling  (Read 4145 times)

0 Members and 2 Guests are viewing this topic.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email


Hi!

Propably everyone interested in integrating Qt & SFML read that post: (http://becomingindiedev.blogspot.com/2013/10/qt-5-and-sfml-20-integration.html). Unfortunately, it's very basic widget, that doesn't allow writing complex applications too fast.

I decided to fork it and add some useful (IMO ofc) features, at this point i've added that:
  • OnUpdate function takes length of last frame so writing much smoother applications is easier.
  • Mouse events handling.
  • Keyboard events handling (only alphabet letters, numbers, space, enter, backspace and backslash, i will add better support tomorrow).
  • Funtion that converts Qt key code to SFML key code (same limit as in keyboard events handling)

Here's GitHub repo: https://github.com/KoczurekK/QSFML

What do you guys think? Btw in my country it's 0:30 AM, so don't blame me for my bad english.  ;)

EDIT: Propably every key event is handled (almost) ok, you can check out that: https://github.com/KoczurekK/QSFML/blob/master/QSFML/keyconverter.cpp and tell me if i made some mistake.

Update (21 August 2016):
- Working universal class compatybile with sf::String and QString.
- New logo, "highly" inspired by SFML's and Qt's ones.
« Last Edit: August 21, 2016, 11:47:22 pm by korczurekk »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: QSFML – Nice SFML widget in Qt Window with basic events handling
« Reply #1 on: May 03, 2016, 10:18:54 am »
Cool! :)

What OS has you tested this on?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: QSFML – Nice SFML widget in Qt Window with basic events handling
« Reply #2 on: May 03, 2016, 11:33:45 am »
Ubuntu 16.04, i'm too lazy to install Windows, so somebody can test it on it.  ;)
Some new features:
  • Everything is in qfs namespace.
  • Support for Qt resources with QResourceStream that inherits sf::InputStream.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: QSFML – Nice SFML widget in Qt Window with basic events handling
« Reply #3 on: May 17, 2016, 03:30:12 pm »
Update:
  • Just added the class qsf::ResourceStream that inherits sf::InputStream and can read Qt resources. It allows you to hide fonts etc. in a binary file.
  • Separated .hpp & .cpp files and added .pro file so qmake is enough to compile program.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: QSFML – Nice SFML widget in Qt Window with basic events handling
« Reply #4 on: November 06, 2016, 06:23:52 pm »
It took me pretty much to draft new release on github.  ;D

A few features in v1.2.0:
  • Added 2 examples (spinning-numbers, date);
  • Refactored #includes;
  • Resize event support;
  • Rewritten qsf::String;
  • Project logo.

Debian builds ship with precompiled SFML 2.4.1 (also debian package) in both release and debug versions.

 

anything