Specifications

SHARP CORPORATION
Sharp SL-series Zaurus “Qtopia” Development Start-up Guide
Ver 1.11, February 28, 2003, 27/63
2.4. Qtopia Development Tutorial
Now that you know how to build the development environment, overall workflow, useful tools, and special
conditions for the SL-series Zaurus, you may want to develop your application. The following is a brief tutorial on
actually developing a Qtopia application following the overall workflow mentioned above.
Note that following tutorial assumes that you are working in
/home/user1/work-dir
.
2.4.1. Hello World!!
The following is the source that only shows “Hello World!!” on the display. Once you complete editing, save this
file as
main.cpp
in the
/home/user1/work-dir
.
#include <qpe/qpeapplication.h>
#include <qlabel.h>
int main( int argc, char *argv[] )
{
QPEApplication app( argc, argv );
QLabel *label = new QLabel( “Hello World!!” ,
(Qwidget*)0 );
label->resize( 100, 50 );
2.4.2. Creating the Project File
Use the “progen” tool to create a .pro file. In order to establish a PATH to the “tmake” directory, execute the
following commands. Note that following example assumes that you have the
dev-x86-qpe.sh
file in
/home/user1
directory.
$ . ../dev-x86-qpe.sh
$ progen –o qpe-test.pro
Once you execute the above commands, you have your environment configured to compile for x86, and have the
files listed in
qpe-test.pro
file. However, you have to add following the information to the the created
qpe-test.pro
file so that you can actually use this file for further process.