Customising Qt look and feel and Python in 30 Mins

(Setup)
(Setup)
Line 15: Line 15:
-
===Setup===
 
Download the mobile tarball demos from [[http://qt.gitorious.org/qt-labs/mobile-demos/trees/master Here]]
Download the mobile tarball demos from [[http://qt.gitorious.org/qt-labs/mobile-demos/trees/master Here]]
Line 39: Line 38:
You should now see all your images in the resource browser. Note that some images will appear blank as they are white foreground and you will need to mouse over them in the reosurce Browser to see them.
You should now see all your images in the resource browser. Note that some images will appear blank as they are white foreground and you will need to mouse over them in the reosurce Browser to see them.
 +
 +
Thats it our images are now ready to b incorporated into our application.
 +
 +
 +
===Designing using resources and CSS===

Revision as of 14:47, 12 February 2010

Introduction

This is a simple tutorial to show how to use Python and Qt-Designer to create your own look and feel for your applications using custom images, the Qt Resource system, and Cascading Style Sheets (CSS).

We are going to show you how you can create a look similar to the [Qt Mobile Demos]


Image:qtmobile-calc.jpg

Assumptions

This tutorial assumes that you have a working Python ,Pyqt and Qt-Designer environment up and working. If you have not then do this first tutorial

Qt Designer/Python for Windows XP in 30 Mins


Download the mobile tarball demos from [Here]

1.Create a folder in you home directory called customui

2.Extract the tarball and then copy the folder from qt-labs-mobile-demos/mybudget/images/calculator into your home directory and call this folder images.

3.Now Open Qt-Designer and create a Mainwindow object.

4.Next we are going to create a Qt Resource file from the images that we just downloaded so that we can use them in our UI. Click on the pencil on the Resource Browser


Image:Qt-ResourceManager.png


5. Now Create a new resource file called customui.rc, add a blank prefix and then add all the images from our image directory using the add files icon. Save this.


image: Qt-Edit-Resources.png

You should now see all your images in the resource browser. Note that some images will appear blank as they are white foreground and you will need to mouse over them in the reosurce Browser to see them.

Thats it our images are now ready to b incorporated into our application.


Designing using resources and CSS