I’m currently trying to figure out how to integrate OpenFrameworks in a QT Gui. Preferably what I’m trying to achieve is to have OpenFrameworks in a QTWidget surrounded by QT Gui Elements. The OpenFrameworks stuff shall then render my 3D Content and with Buttons and Sliders from QT I’d like to interact with it.
I had a look at the latest code available on Github regarding the OpenFrameworks integration in QT and I get an error.
RangeError: cpp.includePaths: of.cpp.includePaths.concat(Helpers.listDirsRecursive(project.sourceDirectory + ‘/src’)) Maximum Call Stack Size exceeded in ofApp.QBS
after digging arround here in the Forum I found a working solution concerning a loose integration (2 Windows Side by Side whileas the QT Gui is in its own window so as the OpenFrameworks window is)
First of all: I don’t want a loose coupling. I’d like to have OpenFrameworks in a Widget.
Why do I get the error mentioned above? What is QBS anyway and how does it differ from any other common QT Gui? How do I implement a full integration so that I can use OpenFrameworks in a Widget?
It would be nice if somebody here could provide a HelloWorld example so that I can extend the code from this and walk on my own…
qbs is just the project file, that error is because the OF project file is not compatible with the newest qt creator, if you are using OF 0.9.3 you need qt creator 3.6.1. If you use the nightly builds then it should work with the latest qtcreator, we added a message in the setup docs recently about this.
in any case, this is by no means integration with qt, it’s just a project file to use qtcreator as an IDE but there’s no integration with qt by default in the official OF download.
i think some people have tried it in the past and you might find some addons or examples on how to do it but it’s not officially supported.
the first thing to look at in order to fully integrate OF as a Qt widget would be to create a new OF window class that substitutes ofAppGLFWWindow with something that creates the OF openGL context inside a Qt widget. i think once you have that working everything else should be pretty straight forward