IDE wars: the battle for Qt

In my search for the best open source Qt-compatible IDE (for Windows, as for Linux, you don’t have to search ;)), I eventually settled with Code::Blocks. Don’t ask me why anymore, it’s been too long. 🙂 (I do remember testing QDevelop and Qtclipse). But if you have a look at CB, you will see it for yourself: a very stable, clean and versatile IDE. Qt support comes in the form of an (unofficial) plugin: QtWorkbench.

First of all, getting this plugin to work was REALLY a PITA (It involved compiling CB from SVN which was a challenge on it own), but very recently the author seems to provide some binaries which should make the experience all the more pleasant. 🙂 I was so happy when I first got it running, that I really didn’t care about half a dozen plugins being lost in the build process. 😉 (I never took it up again, who needs plugins? 😛 ;)) What’s more, code completion just worked and QtWorkbench created my .pro file all by itself.

After the honeymoon moment was over, I really got some nasty trouble though. Compiling debug simply did not work because apparently I don’t have the Qtdesignerd.dll and QtW insists on including it in the project file. So let’s remove it outside the autogenerated block like this:

CONFIG -= designer

Okay, first hurdle taken. Another hurdle was unfortunately a whole less obvious.

I was creating an ftp client application using QFtp and somehow the application would freeze, EVERYTIME I started to do ftp operations. I thought, fair enough, I am probably doing something wrong with threading, message loops, signal/slots connection etc. So after digging deep into Qt, reading about queued connections, running modal dialogs with the parent message loop, analyzing my threads and mutexes that can only be used on QThread started threads, I finally found out who was the culprit: QtWorkbench! 🙂 I really pulled my hair out as I had been losing a lot of time on this problem (luckily I have plenty of hair).
I discovered this by making a small test application for which I didn’t need a fancy IDE and that turned to run just fine. The problem seems to be related to some compiler flags that QtW was adding to my project file. I thought maybe they somehow got in there by my specifying some things in CB but I didn’t find it. Anyway, if you get some errors like

QObject::startTimer: QTimer can only be used with threads started with QThread

just throw out those weird compiler flags 😉

So in fact, I’m just using CB on itself now, since I switched to the DIY way for my project file. 🙂 Since CB has quite some weird shortcuts (ctrl+shift+c to comment!) and I can’t reconfigure them (I lost some plugins during the build process, remember ;)), I even switched back to good old MSVC today. Although Visual studio is one of the most rigid and dated IDE’s around when it comes to standard C++ coding, it does work (but I only use it as a text editor ;)) most of the time (auto completion is a bit flaky). Also, I’m quite used to it due to my dayjob coding (I’d never have thought ctrl+k+c would become a reflex when commenting out ;)). MSVC is kinda like the Internet Explorer of IDE’s. 🙂 It does not evolve much over the years and there are open source alternatives with much more/better features, yet everyone still uses it (be it forced or not) 😉

3 thoughts on “IDE wars: the battle for Qt”

  1. Hello,

    using QFtp i got the same message about the QTimer. Which compiler settings will fix this problem?
    I would appreciate to get a reply, also your posting was some time ago.
    Thanks
    kind regards
    Martin

  2. it is indeed a bit long ago to remember those flags.. Are you also using mingw / gcc ? Are you using an IDE? I would suggest to just try without all flags 🙂 if that works, add the ones you deem necessary

Leave a Reply

Your email address will not be published. Required fields are marked *