Programmer’s Guide for QT Gui + openFrameworks (OF) in C++ (Visual Studio 2008)

I’m pleased to present the Programmer’s Guide for QT Gui + openFrameworks (OF) in C++ (Visual Studio 2008), written by me and João Valente.  We hope this guide will foster and improve the combination of these two framework.

10 Responses to Programmer’s Guide for QT Gui + openFrameworks (OF) in C++ (Visual Studio 2008)

  1. jmoraguiard says:

    Hi Diogo!

    First of all thank you for the tutorial, you just brought something many people were searching! I have a problem with your tut 😦 When I try to do the 3th step I cannot generate the make file. I mean, I run the configure.bat from the comand console and it says that it is “configured” but there is no makefile or nothing different. If I open the project qith the QT Creator and try to compile it, it gives me an error:
    Could not find make command: make in the build environment
    Error while building project qtwinmigrate (target: Desktop)
    When executing build step ‘Make’

    Would like to know if I miss something or if you could tell me more detailed (for dumb people :() directions.

    Thank you very much for your attention.

    • dncabral says:

      Hi Joan,

      Yesterday I tested the guide and made some updates that can help you. You should add the directory “C:\yourQtpath\bin” (mine is: C:\Qt\4.7.0\bin) to the environment variable PATH and try to build the buildlib project (buildlib\buildlib.pro) using the Qt Creator.

      I hope that can help you.

      Diogo

  2. jmoraguiard says:

    Thank you very much for your reply.

    Yesterday night I was able to compile it another way using QT’s command console that comes with the library installation. (maybe could be interesting to add in the guide too as another way of doing it :)).

    Even though, I just tried what you replied now in my laptop and it works like a charm.

    Thank you very much Diogo 🙂

    • dncabral says:

      Ok, I’ll test with the QT’s command console. 🙂

      Please, keep me updated about the integration Qt+OF. I would like to know if the guide can really guide someone until the end of the process. 🙂

      Diogo

  3. jmoraguiard says:

    Hi Diogo,

    quite a long since I last wrote to you. I finally managed to mount everything, I’d say it is enough clear the tutorial, but I had “problems” with some points, mainly because I’m really dumb.

    Between the 4th and 5th step I had to open oF’s project and add into it the QT project solution just created. It is something I could infer, but as it is explained in the tutorial I still don’t know if it should had been automatic when creating the new QT project… 😦

    Finally I would say that I don’t know now how to keep on, I mean, I can compile and play the example.There is the gray background with the white box (widget), but now I cannot include any element of QT. Honestly, I don’t really know how to follow to add widgets 😦

    Excuse me for bothering you so much, but could you give me a hint about how to start to add elements to the project? Should it be in the source file of the QT Project? I don’t want a QT programming tutorial now, I’ve already used it, but with this scheme I’m completely lost :S

    Thank you very much and again, I’d like to apologise for bothering you so much with my questions.

    PD: The thirth step as I did (yet another way), step by step:
    unzip wt_winmigrate
    Using QT Console:
    run configure.bat -> yes
    cd buildlib
    run nmake
    and libraries are compiled, don’t know if could be nice to add it to 🙂

    • dncabral says:

      Hi Joan,

      One of the main problems of working with OF is the non automatic creation of projects. You should always to open an OF example and add your stuff (QT or whatever) there.

      The main idea of the guide is to add an QT Lib to an OF project. This happens because both of the frameworks, normally, will have two main functions (and will create two .exe files, which is not possible). Since, OF can not be compiled as a Lib (and be used in other solution), and Qt cans, we found this was the best way to do it. Therefore, the guide explores the idea of creating a Qt lib and use it in a OF application.

      The Qt Lib project is the responsible for the widgets and forms. You can code them or create them graphically. Nonetheless, to take full advantage of Qt framework (and this was the main reason for this integration), you should use the Qt Design to create (graphically) your widgets and forms. In the Qt Lib, you should code the loading of the forms and widgets (see the footnote in page 4 of the guide).

      The OF project loads the Qt lib and adds it in your final application. The Qtwinmigrate is only needed in this part, but introduces some constraints (see the note of page 4 of the guide).

      You can make QtWidgets interact with OF functions by using Qt signals and slots, particularly using the QtObject::connect (See page 6 of the guide, including the footnote).

      I recommend you to train some Qt programming, i.e. without OF, combined with Qt Designer, and integrate both of the frameworks later.

      Due this is the “beginning” of the integration Qt+OF on Windows, it is not so easy as we would like. Nevertheless, by making this first step we hope that more people try do it and improve the process, making it faster and easier.

      Probably, in the future, me and João will improve the guide with a few examples to make it more clear.

  4. Skan Kest says:

    I’ve followed the tutorial all the way through and I’m just trying to get it to run now. It compiles and starts to run but then pops up an error stating that my computer doesn’t have qtguid4.dll. I found the dll file and even copied it over to my of project’s bin but that didn’t seem to help. Any ideas on what to try next?

    Thanks, by the way, this is a great tutorial that is saving me ages(hopefully).

  5. kazper says:

    Hey Skan,
    that .dll is called QtGuid4.dll and is located at your QTDIR/lib . Check if:
    – you have the name “QtGuid4.dll” in Properties -> Linker ‐> Input.
    – you have included the folder QTDIR/lib on Properties -> Linker ‐> Additional Library Directories.

  6. Nicanor Garcia says:

    Hello,

    I’m trying to implement Qt and I need the audio functionalities of Open Frameworks. I just found this tutorial but the link is broken and I was wondering if you could provide a new link or the tutorial to me.

    Thank you very much.

Leave a reply to Nicanor Garcia Cancel reply