![]() |
Qt5 development on Harmattan
EDIT: Forget all about this below. Better solution is to use community repos which is under work
I'm starting this topic now, like I threatened. Personally I'd like to keep my current workflow, using QtCreator, instead of scratchbox. Here's a great resource for setting up qt5 development for QtCreator: http://trac.webkit.org/wiki/SettingU...vironmentForN9 Big thanks from me to the WebKit folks for this work - figuring out all that stuff by myself would have not been possible with the time I have. Here's my notes using this guide, hopefully it will save some time from others tackling this (for reference I'm developing on Ubuntu 10.04, some details might differ depending on your OS of choice): In my notes I'm going to use the following variables as shortcuts: $QTSDK = Path to QtSDK installation directory $QT5SETUP = Path to the directory where you set-up Qt5 (in the web-page it's ~/sfworks) 1.1) Prepare your environment - I could without problem use another directory than the ~/swork directory mentioned in the guide. The scripts included seem to be pretty smart in that regard. 1.4) Set up custom MADDE target. This didn't initially work for me, even as by documentation QtSDK installation is supposed to set it up. But if you set QTSDK environment variable to point to your QtSDK installation directory, then there is no problems. Example Code:
export QTSDK=/home/users/ajalkane/QtSDK - In the web-page there is a comment "Qt5 r26 and later versions messing up some include path". This is still a valid, you need to do the symbolic link. If you use some other path than the default ~/sfworks you need to adjust the link accordingly. Analyzing the include paths in the build errors will quite easily give you idea what kind of symbolic link to create. - I got weird errors about missing headers. It seems that downloading some of the sources can fail, and it does not give any errors so it's easy to miss among all the output. If that happens run again 1.6) to get again the sources : Code:
browser-scripts/clone-sources.sh --no-ssh Now you should have Qt5 target usable in QtCreator. To add it to your project, go to: Settings -> Build & Run -> Qt Versions. Add new qmake location Add there $QT5SETUP/qt5/qtbase/bin/qmake (of course replacing $QT5SETUP with the directory you downloaded the scripts into). With these instructions I was able to compile a simple hello world application. Does not tell much of course... But since I've not received my device yet, I'm trying to resist the urge to mess-up with my day-to-day device. I might fail during the weekend, though the abortion of the next billion somewhat helps restricting my geek urges. Some final notes: I think the scripts are the minimal that's needed for webkit. Some qt5 modules are not compiled. If you need some other modules for qt5, go to $QT5SETUP/qt5 and use the "init-repository" script to add more modules. No practical examples from me yet, as I'm in the hello world stage. I hope other people post here their own experiences, especially stuff that got them stuck for a while. No matter how trivial it might seem when looking back, it can substantially reduce the time each of us use on getting things rolling. Personally I'd like to see some experiences and practical instructions how to create qmake scripts that can automatically use Qt5 on device if it was installed. And also how to automatically transform the qml's to use QtQuick 2 - Qt Components QtQuick2 branch does something like that, but I haven't had time to dig into how similar technique could easiest be applied on QtCreator based project. |
Re: Qt5 development on Harmattan
how bout add this to the wiki instead ? :)
|
Re: Qt5 development on Harmattan
Quote:
|
Re: Qt5 development on Harmattan
Quote:
|
Re: Qt5 development on Harmattan
Another source that might be useful is http://qt-project.org/wiki/Create (setting app SDK for QtonPI)
The path needs to be tamed by actual app developers, yes. Any help improving the documentation is welcomed. Thanks for the notes! |
Re: Qt5 development on Harmattan
Quote:
The QtonPi page seems like a good one for some ideas too. |
Re: Qt5 development on Harmattan
I have put up a simple Qt project to github/harmattan that is probably the easiest way to show the changes needed to a project to get it compiling both on qt4 and qt5:
https://github.com/harmattan/helloqt5 It's based on the QtQuick project template created by QtCreator. The only thing missing is that *.qml files imports have to be modified manually when you switch between versions. I'm running out of time so I'll be progressing more slowly from now on. Probably I'll start doing stuff on this again when device arrives. |
Re: Qt5 development on Harmattan
I had time to do some more on this.
For putting the Qt5 libraries on device I didn't want to use the instructions on the URL in the first post, as the script does all kinds of stuff to the device I don't want. But all went well using this: http://qt-project.org/wiki/Qt-5-on-Nokia-N9 Basically I did: Code:
mkdir /home/developer/qt5build && cd /home/developer/qt5build I tried to remedy it with all kinds of nasty stuff, like modifying QtCreator/share/qtcreator/Nokia/qtversion.xml. That didn't work as then QtCreator complained it was wrong Qt version. Apparently it requires Qt4. I also tried some beta version of QtCreator 2.5.0, but didn't have any luck with that one either. I will personally wait now a bit if the next QtSDK/QtCreator would have Qt5 support for Maemo targets. If that doesn't happen soonish, I will look into using scratchbox (something I've tried to avoid, but apparently can't :)). But if anyone gets QtSDK to build Qt5 harmattan debs, please share. |
Re: Qt5 development on Harmattan
I have been trying to get my Qt5 environment up for my N9 following the instructions above from ajalkane and the link. Thanks ajalkane as I would not have got far without these.
I have not got there yet but thought I would document some of the problems I had. When making the custom MADDE environment using Code:
browser-scripts/setup-madde-toolchain.sh A quick Code:
apt-get install curl Having fixed this I have succeeded in building Qt5. I have tried then using this from within QtCreator by trying the helloqt5 example from ajalkane. The first issue was it did not like Code:
QT += declaritive Code:
QT += quick1 I have not got much further as when I try to compile I get this error Code:
make: arm-linux-gnueabi-g++: Command not found Anyone know how to get passed this? |
Re: Qt5 development on Harmattan
Quote:
In my case Code:
/opt/QtSDK/Madde/targets/harmattan_10.2011.34-1_rt1.2_qt5/bin/ |
All times are GMT. The time now is 12:02. |
vBulletin® Version 3.8.8