User avatar
stevo_300
Posts: 33
Joined: Thu Jan 26, 2012 9:38 am
Contact: Website

Python QT (4 or 5)

Tue Oct 02, 2012 8:48 pm

Hi,

I have no real idea what I'm doing really.

I have had an idea to try and create a new desktop environment for myself. The idea I had was a Python/Qt foundation and just build from there. Unfortunately I just don't know where to start.

I have the latest Raspbian distro, a "which qt" reveals nothing and after looking through the app list using aptitude I wasn't sure what to install. I have found that people have compiled qt5 from source but I don't know how to do this.

I do know some Python and have a basic understanding of GUI programming from using VB.NET in visual studio.

If anyone can point me to a good starting point and possibly a few good simple examples I would greatly appreciate it.

Thanks Steve

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Python QT (4 or 5)

Tue Oct 02, 2012 9:09 pm

Would
Qt 5 on the Raspberry Pi (BCM2835)

Installing Qt 5 nightlies from the repo
We are generating Qt 5 nightlies for the Raspberry PI reference Raspbian image, and these are available here:

http://archive.qmh-project.org/rpi-wheezy/debian

this is not currently shipped as part of the Raspbian reference image, and hence

you have to add:

deb http://archive.qmh-project.org/rpi-wheezy/debian unstable main

to your source list and then you need to do to get piping hot Qt 5 action in your life is:

apt-get update
apt-get install qt50-snapshot
help at all?

I found it while googling, it seemed like it would be easy enough to miss... I must admit though, I tried to get python and Qt working together on my windows box a while ago, and gigabytes of downloads and tutorials later I was just as clueless...

Knowing Qt does seem like it'd be a good skill to have in terms of possible paid employment though.
note: I may or may not know what I'm talking about...

User avatar
stevo_300
Posts: 33
Joined: Thu Jan 26, 2012 9:38 am
Contact: Website

Re: Python QT (4 or 5)

Tue Oct 02, 2012 10:07 pm

I found that and tried it too but couldn't get it working

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Python QT (4 or 5)

Wed Oct 03, 2012 12:38 am

Haven't a clue then, sorry.
note: I may or may not know what I'm talking about...

DuncanKennedy
Posts: 44
Joined: Sun Apr 22, 2012 3:35 am

Re: Python QT (4 or 5)

Wed Oct 03, 2012 12:58 am

Hi

Take a look at the instructions here http://qt-project.org/wiki/RaspberryPi_Beginners_guide. These instructions will walk you through setting up a cross compiler environment, compiling Qt5 base and other modules, then installing it yourself. The bakeqtpi.bash file is very helpful!

Once you have Qt5 built and installed, try building some of the sample programs provided in the Qt5 source.

Once installed on your Pi, don't forget to export LD_LIBRARY_PATH to point to the directory that Qt5 is installed in - if you follow the instructions, this will be /usr/local/qt5pi - without this export your programs won't be able to find your Qt5 resources when you try to run them.

By the way, the daily build of Qt5 that were mentioned earlier are no longer being maintained, so you are better off trying to compile your own first

Good luck
Duncan
The mind is an infinite resource, provided you don't waste it!

DuncanKennedy
Posts: 44
Joined: Sun Apr 22, 2012 3:35 am

Re: Python QT (4 or 5)

Wed Oct 03, 2012 1:06 am

Also meant to add that you should check out the QTonPi mailing list as well http://lists.qt-project.org/mailman/listinfo/qtonpi. Great place to ask questions since everyone there is just starting to face the same issues of getting Qt5 running on the Pi, but there is a lot of general Qt experience as well.
Duncan
The mind is an infinite resource, provided you don't waste it!

User avatar
stevo_300
Posts: 33
Joined: Thu Jan 26, 2012 9:38 am
Contact: Website

Re: Python QT (4 or 5)

Wed Oct 03, 2012 1:03 pm

Thanks Duncan,

I have started going through the process, but have hit a stumbling block on the line:

./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/pi/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-relocations -reduce-exports -release -make libs -prefix /usr/local/qt5pi


I get the error

/home/pi/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++: 1: /home/pi/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++: Syntax error: "(" unexpected
-reduce-exports was requested but this compiler does not support it
Re-run configure with -v for more information


is there a dependancy i am missing?

DuncanKennedy
Posts: 44
Joined: Sun Apr 22, 2012 3:35 am

Re: Python QT (4 or 5)

Fri Oct 05, 2012 1:57 pm

I've seen that error a couple of times. You can safely remove that flag from the configure statement. There is another similar one it will complain about as well, but you can remove that without impacting the results.
Duncan
The mind is an infinite resource, provided you don't waste it!

DuncanKennedy
Posts: 44
Joined: Sun Apr 22, 2012 3:35 am

Re: Python QT (4 or 5)

Fri Oct 05, 2012 1:58 pm

Also, make sure you're running this in a 32 bit environment - it can be made to work in a 64 bit setup, but it's more complicated to do.
Duncan
The mind is an infinite resource, provided you don't waste it!

User avatar
stevo_300
Posts: 33
Joined: Thu Jan 26, 2012 9:38 am
Contact: Website

Re: Python QT (4 or 5)

Fri Oct 05, 2012 2:00 pm

Hi,

I think I have gotten around the problem. I am doing this on a VM linux mint 32bit box and is doing that stage right now. Before I was doing it actually on the pi

BlackJack
Posts: 288
Joined: Sat Aug 04, 2012 8:28 am
Contact: Website

Re: Python QT (4 or 5)

Fri Oct 05, 2012 7:09 pm

@stevo_300: Why don't you just install the Qt bindings for Python that are available as packages in the Linux distribution you are using?

Code: Select all

while not self.asleep():
    sheep += 1

User avatar
stevo_300
Posts: 33
Joined: Thu Jan 26, 2012 9:38 am
Contact: Website

Re: Python QT (4 or 5)

Sun Oct 07, 2012 7:48 pm

i would like to develop on the Pi, also I don't yet have a physical linux box which isn't ideal for development.

I will keep plugging away and see how things get on

PhilThompson
Posts: 6
Joined: Fri Jun 08, 2012 8:59 am

Re: Python QT (4 or 5)

Tue Oct 16, 2012 3:49 am

Just to keep people up to date...

I'm just about to start the process of porting PyQt4 to the Pi. It already runs under Qt5 built for X11 but I want to produce binary packages built against a non-X11 Qt5.

I anticipate that this will take a couple of weeks.

Return to “Python”