in SDL,SFML you need to implement your own main loop.However in Qt it is predefined as QApplication::exec()
. But I want to declare my own main loop in Qt for some other APIs t works. I tried QTimer
which works great but I don't want it for some reason . what is minimal code I require to overwrite QApplication::exec()
.
Asked
Active
Viewed 507 times
1

RAM
- 2,257
- 2
- 19
- 41
-
2What are you really trying to do? – selbie Aug 12 '18 at 07:32
-
1Mixing Qt and SDL,SFML is a strange requirement. Why? – Marek R Aug 12 '18 at 07:43
-
@selbie I am trying to integrate Qt main loop with my SDL2 main loop. – Aug 12 '18 at 07:45
-
@MarekR I am trying to go down deep in rabbit hole – Aug 12 '18 at 07:47
-
1What about inheriting from _QApplication_ and reimplementing _exec()_? – scopchanov Aug 12 '18 at 10:34
-
Why don't you want to use `QTimer`? – G.M. Aug 12 '18 at 14:20
-
@scopchanov yes I am asking for that.How can I do that ? what is minimal code for that ? – Aug 13 '18 at 02:34
-
2@user10168069, exactly the way one inherits from any class in C++: `class myApplication : public QApplication { ... int exec() override; ... };` – scopchanov Aug 13 '18 at 09:17
-
1Related: https://stackoverflow.com/questions/27607825/how-to-override-qapplicationnotify-in-qt – alseether Aug 17 '18 at 10:03