In my previous articles about Qtopia application development I showed the directory structure for a Qtopia project, the contents of basic Qtopia project file (helloworld.pro) and how to create the application interface with user interface files (helloworld.ui), in this article I’ll talk about the classes to be used in our helloworld application and how we can integrate the user interface files in our applications.
Every Qtopia application requires a initialization code like we have in the code block below:
We must include the header file below since it contains
the HelloWorld class definition.
#include <qtopia /qtopiaapplication.h>
//Set the HelloWorld class as the main class of helloworld application.
//Add initialization code to this application
In the example above we are using to macros QTOPIA_ADD_APPLICATION and QTOPIA_MAIN, both are only available if qtopia_main is set in CONFIG variable of application project file (helloworld.pro) as described in this article.
The majority of applications requires a user interface to allow user interaction with application functionalities, this third part of our article will talk about the user interface files that are xml files used to define the contents of Qtopia graphical elements like dialog boxes and windows.
In the example below we are defining a QWidget called HelloWorldBase, this widget is the main window of helloworld application, it contains a QLineEdit (input box), a QLabel and a QPushButton each of then can be declared in xml using the <widget> tag where the class attribute indicate the widget type and name attribute holds the object instance name. Each widget may have default values for its properties, you can define the widget properties using <property> tag, a property requires a name that must be supplied on name attribute of this tag.
In my previous article we had a short introduction to Qtopia development, I also showed how to use the example project that comes with SDK to start a new one.
This article will talk a little about one of the most important files of any Qtopia project the applicationname.pro file, this file contains very important configuration parameters for every Qtopia application, please open your preferred text editor and put the code below (look the comments):
Today I’m working with four mobile platforms:
- Windows Mobile
After some years without touch in Visual Studio .NET and a little far away from Windows Mobile development, I’m finally back, now working on a small project for use in restaurants using a wi-fi connection.
I’ll post some of my challenges in this project when possible.