Skip to content

Zchydem's Blog

#Qt, #Linux, #Programming, #MeeGo…

Archive

Tag: Qt Creator

I like to distribute my QML application so that everything comes with a single binary executable. In practice this means that I have defined that all my QML files are compiled into binary using Qt’s resource compiler. Resource system in Qt is quite nice, but there is annoying bug in Qt creator. Sometimes it doesn’t recompile resources even though I have modified a QML file. This means that you need to select “Clean” and “Build” from Qt creator in order to get modifications compiled. This takes time.

Some time ago, I figured out a workaround for this. You can add a custom build step to your Qt Creator’s project. This build step modifies e.g. an image that is included the project and then resources are recompiled. Here’s a screenshot how you can do it.

Custom build step to make rcc run every time you compile.

I added the custom build step to the first (touch quickflickr.png) and when my project is being compiled it notices that some of the resources have changed and it runs resource compiler too. This is far from an elegant solution, but at least it works for me and I don’t need to run “Clean & Build” which takes for ever. At least, it feels so after you have recompiled your project for the 10th time.

UPDATE: I thought, that there would have been a bug about this but couldn’t find a onet from Qt’s issue tracker so I created a new one: QTCREATORBUG-5743.

I hope this trick will help some one else too. Thanks for reading my blog and thanks for Bale to encourage me to write this “tip of the day” post. Cheers!

This article has been in my mind quite a long time already, but now I finally had time to test MADDE and write something about it. MADDE stands for Maemo Application and Debugging Environment. Before going any further, I want to say that this is not a MADDE tutorial, this is about the MADDE and Qt Creator integration.

Why I am interested in about MADDE is that you can quite easily to integrate it with Qt Creator. In practice, this means that you can use Qt Creator in the same way as you would create an application for your desktop environment, but instead of running your application on a desktop, you can also run and debug it directly on N900.

I know, there are bunch of people who are screaming: “you can use Qt Creator with Scratchbox too.” This is true and there are two ways to do it: you can run it inside the scratchbox or you can make your Qt Creator to use compiler and qmake inside the scratchbox from outside. (Sounds complicated)

Both of these ways work, but they are also bit problematic. Running Qt Creator inside the scratchbox requires bit “configuring”, but is quite easy to do. Basically what you need to do, is that you install the Qt Creator to the X86 target and set the DISPLAY=:0 before launching Qt Creator. The problem with this approach is that when you need to switch the target, Qt Creator will be closed. If you want to develop your app  on ARMEL target, then it means that you need to run ARMEL version of Qt Creator in Scratchbox too. For me, this sounds not-so-nice-solution.

I have never tried to set Qt Creator to use qmake inside the Scratchbox from outside, but I know guys who have used this approach. With this way, there have been bit more problems than using Qt Creator inside the Scratchbox. Even though it’s possible to “integrate” Qt Creator with scratchbox, it is still missing an easy way to debug and run your application on a device during the development.

continue reading…