Editing User:Henkka
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
- | |||
Orginal | Orginal | ||
http://talk.maemo.org/showthread.php?t=43663 | http://talk.maemo.org/showthread.php?t=43663 | ||
Line 16: | Line 15: | ||
==Qt Designer/Python for Windows XP in 30 Mins== | ==Qt Designer/Python for Windows XP in 30 Mins== | ||
- | This is guide for noobs who would like to get started in Qt development using Python on Windows XP. | + | This is guide for noobs who would like to get started in Qt development using Python on Windows XP. For Linux users I have created a separate thread Link |
+ | The great news about using Python is there is no need to install the Maemo SDK. Python runs on Windows, MAC and Linux as is, and it's just a matter of copying your Python Scripts to your N900 and run. | ||
===Install the Tools=== | ===Install the Tools=== | ||
- | * Get Python 2.6 from Python.org http://python.org/download/releases/2.6.4/ | + | * Get Python 2.6 from Python.org [http://python.org/download/releases/2.6.4/ here]. This will install the Python interpreter and associated tools. Access from your start menu: |
:[[Image:Pic01_python_install.jpg]] | :[[Image:Pic01_python_install.jpg]] | ||
- | * Get the Binary Packages for PyQt from Riverbank computing http://www.riverbankcomputing.co.uk/software/pyqt/download | + | * Get the Binary Packages for PyQt from Riverbank computing [http://www.riverbankcomputing.co.uk/software/pyqt/download Here]. Select the Python 2.6 version which is the latest version compatible with Python on the N900. This will install a number of tools, but in particular the ones we are interested in for this Tutorial. |
:* '''PyQt''' 4.7 The Python Qt bindings (note 4.7 is not the Qt Release version). | :* '''PyQt''' 4.7 The Python Qt bindings (note 4.7 is not the Qt Release version). | ||
Line 34: | Line 34: | ||
Let's do a quick hello world that uses the above tools and links it all together. | Let's do a quick hello world that uses the above tools and links it all together. | ||
- | |||
===Create UI with Qt Designer=== | ===Create UI with Qt Designer=== | ||
Line 41: | Line 40: | ||
* Qt Designer from your start Menu. | * Qt Designer from your start Menu. | ||
- | * Create a Main Window Form | + | * Create a Main Window Form ,set its size to '''800x400''' |
* Add a Label Widget, set the font to a 24 point, resize as needed. | * Add a Label Widget, set the font to a 24 point, resize as needed. | ||
* Double click on the Label Widget to change its name to Hello World ! Use Control R to see how it will look. | * Double click on the Label Widget to change its name to Hello World ! Use Control R to see how it will look. | ||
Line 49: | Line 48: | ||
:[[Image:Qt_designer_winxp.jpg]] | :[[Image:Qt_designer_winxp.jpg]] | ||
- | + | ===Generate your Python code.=== | |
- | ===Generate your Python code=== | + | |
Open a command window from your start menu->accessories (also winkey+r type '''cmd''') and cd into the directory where you stored the ui file, and type in the following. | Open a command window from your start menu->accessories (also winkey+r type '''cmd''') and cd into the directory where you stored the ui file, and type in the following. | ||
Line 61: | Line 59: | ||
Just double Click your helloworld.py file in the file manager and presto you have your first PtQt app up and running. | Just double Click your helloworld.py file in the file manager and presto you have your first PtQt app up and running. | ||
- | |||
===Deploy to your N900=== | ===Deploy to your N900=== | ||
- | Make sure you have installed Python and PyQt on your n900. Easiest way of doing this is to install the | + | Make sure you have installed Python and PyQt on your n900. Easiest way of doing this is to install the PyQt documentation (package name and repository here) package from the application manager. This will pull in all the dependencies that you will need. Don't forget you will need to enable extras development repository (link here). |
To get full file system access follow guide [http://talk.maemo.org/showpost.php?p=482844&postcount=1 Here]. ( this method uses WinSCP to do a secure copy to N900) | To get full file system access follow guide [http://talk.maemo.org/showpost.php?p=482844&postcount=1 Here]. ( this method uses WinSCP to do a secure copy to N900) | ||
Line 71: | Line 68: | ||
After setting up your N900 and Windows run WinSCp and enter your ip address and root login details. | After setting up your N900 and Windows run WinSCp and enter your ip address and root login details. | ||
- | To query your N900's ip address run in terminal | + | To query your N900's ip address run in terminal: |
$ sudo gainroot | $ sudo gainroot | ||
Line 95: | Line 92: | ||
http://talk.maemo.org/showpost.php?p=515218&postcount=59 | http://talk.maemo.org/showpost.php?p=515218&postcount=59 | ||
- | |||
===Integrating into a Main Program=== | ===Integrating into a Main Program=== | ||
Line 135: | Line 131: | ||
Pyside is not quit ready for Windows yet | Pyside is not quit ready for Windows yet | ||
- | |||
'''Bringing it all together into a Graphical IDE''' | '''Bringing it all together into a Graphical IDE''' | ||
- | Now you have your helloworld working | + | Now you have your helloworld working its time to dive into a full-blown IDE(Integrated development environment) (Wiki) and do a serious example. |
First we need to install an IDE that will pull all of our tools together. '''Eric4''' works really well with Qt Designer. Install from here | First we need to install an IDE that will pull all of our tools together. '''Eric4''' works really well with Qt Designer. Install from here | ||
Line 157: | Line 152: | ||
http://lateral.netmanagers.com.ar/stories/BBS47.html | http://lateral.netmanagers.com.ar/stories/BBS47.html | ||
- | And the Qt4 Design | + | And the Qt4 Design manualhttp://doc.trolltech.com/4.0/designe...component.html |
- | + | ||
The Maemo Python Wiki Pages | The Maemo Python Wiki Pages | ||
http://wiki.maemo.org/PyMaemo | http://wiki.maemo.org/PyMaemo |
Learn more about Contributing to the wiki.