Revision as of 04:19, 11 October 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:Porting iPhone native (Objective-C) applications to Qt for Symbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

This article or its primary content has now been incorporated to the Porting to Qt Library

Article Metadata
Created: jaaura (07 Apr 2009)
Last edited: hamishwillee (11 Oct 2012)



When someone familiar with developing for iPhone (Mac Os) Os moves to developing for Symbian OS, there is a period of uncertainty about where to start. Objective-c is used for the native application development in iPhone while in Symbian OS Symbian c++ is used for this purpose. Qt is now becoming a popular among the mobile

developer because of its easy syntax and cross platform capability. Application development using Qt is capable of running on various platform like Windows, Mac-OS, Linux, Symbian. While objective-c application can not provide such a liberty.

This article is meant to provide beginning and intermediate objective-c developers with an introduction to porting applications from objective-c to Qt.


Overview of Objective-c and Qt architecture

iPhone objective-c application based on the architecture given below.

IPhone Arc.jpg

Qt Architecture Overview



Languages Used for Native Development

iPhone OS: Objective-C

Symbian OS: Symbian C++,Qt


Qt Objective-C
IDE Carbide C++,Qt creator XCode

Organization Of Source Code

Extension Objective-c Extension Qt
.h Header file .h Header file
.m Source file .cpp/.c Source file
.mm Source files(if actually refer to C++ classes or features from your Objective-C code) .cpp Source file

main() function comparison

Objective-C main() function

#import <UIKit/UIKit.h>
int main(int argc, char *argv[])
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;

Here actual user code is written in the UIApplicationMain function which is called as soon as application loading is completed.

Qt main() function

#include <QApplication>
#include "digitalclock.h"
int main(int argc, char *argv[])
QApplication app(argc, argv);
DigitalClock clock;
return app.exec();

Here user code is written in a separate .cpp file or can be written in the main file also.

Main difference : Qt uses a #include while objective-c uses a #import.

This page was last modified on 11 October 2012, at 04:19.
154 page views in the last 30 days.