jump to navigation

Running PySide applications on Qt Simulator August 26, 2010

Posted by lizardo in General.
Tags: , , ,
trackback

Some may have noticed that the Nokia Qt SDK contains a simulator for Qt applications on Nokia devices. It consists of the simulator application, plus Qt libraries built for its platform (Q_WS_SIMULATOR), which basically “wraps” the target application on the simulator window (and allows to simulate various events of the target device).

It has been asked on the Maemo.org Talk whether it would be possible to run PySide applications on the simulator. Technically, it would be as simple as building PySide against the simulator libraries… and indeed it was! Well, at least after a couple of patches, I managed to make it work, as can be seen on the screenshot below (for the curious the application running on it is the “hyperui” demo from pyside-examples repository):

Qt Simulator running PySide

For anyone willing to try, you just need to download the latest PySide code, apply the patches not yet upstream (to the pyside.git tree), and build everything as per official instructions, with these notes:

  • When building PySide, add the directory which contains the Qt tools for the Simulator platform (usually “<SDK_installation_dir>/Simulator/Qt/gcc/bin”) to your PATH (taking care to add it before other directories which contain Qt tools).
  • When building PySide, add -DQ_WS_SIMULATOR=yes to the cmake command. This is necessary because currently CMake does not detect the Simulator platform, thus requiring us to force it.
  • When running applications, remember to set LD_LIBRARY_PATH to point to the Simulator libraries, otherwise the application might try to be run with your system Qt libraries, which will probably fail.

To make testing easier, I built PySide binaries (from git snapshots) for the Simulator libraries shipped in Nokia Qt SDK 1.0. You can download them here. They were built on Ubuntu 10.04 (32-bit), but will probably work on other (32-bit) distributions. Also note it was build for Python 2.6. To use these binaries, unpack the tarball and modify the “qt_sdk_dir” in run_with_simulator.sh to point to your Nokia Qt SDK installation directory. Next, run:

./run_with_simulator.sh /path/to/app.py

And your application should run under the simulator (the simulator opens automatically if not already running).

TODO

  • Apply required PySide patches upstream (they are currently under review).
  • Attempt to build PySide Mobility as well.
About these ads

Comments»

1. PySide applications on Qt Simulator - Home to PyS60 Developers - August 26, 2010

[...] get along well. Anderson Lizardo explains how PySide applications can be run on the Qt Simulator in his blog post. Very interesting [...]

2. Marcelo Barros - August 26, 2010

Fantastic work, Anderson ! I will give it a try ASAP.

3. m2c - October 4, 2011

Looks promising, but the instructions are for a Linux environment. Any method to achieve the same for Windows 7?

4. AHeiner - October 4, 2011

Hi,

installed most of it but got stuck at the command

./run_with_simulator.sh /path/to/app.py

what is meant with this (I’m a new one on installing my own SW)

thanks

5. Работа с PySide - December 15, 2011

[...] PySide Mobility v0.2.2 documentation New-style signal/slot PySide на Developer Network Running PySide applications on Qt Simulator PySide Binding Generator PySide Binding Generation Tutorial n9_contest, Nokia, pyside, Python, [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: