Creating an application using both Qt and Symbian C++
Most mobile technologies are covered by standard Qt modules
but there are some technologies where you will need to use Symbian
C++ APIs. When you use the Symbian C++ APIs, you need will need to
translate between Symbian data types and mechanisms and the corresponding
Qt data types and mechanisms.
- Mixing Qt and Symbian C++ in your application
Using Qt and Symbian C++ code together in an application
requires the use of good object-oriented software design principles.
- Converting active objects to Qt signals and slots
Qt and Symbian C++ have different asynchronous signalling
mechanisms, so you need to convert between them if you are using a
Symbian C++ component.
- Coding standards and conventions
Symbian and Qt both have extensive coding standards to
ensure code safety and ease of maintainance. A convention also exists
for filenames to show which files include public or private content.
- Exceptions and error handling
Symbian C++ uses its own exception mechanism consisting
of TRAPs, Leaves, and the Cleanup Stack, which must be handled correctly
for use with the standard C++ mechanism of try, catch and exceptions
used by Qt. Symbian and Qt also make extensive use of error codes
which require handling or translation when code from both APIs is
used.
- Converting strings and buffers between Symbian and Qt
Symbian's strings are called descriptors and in most cases
are easily converted to Qt strings. Binary data buffers work in a
similar way. Both Symbian and Qt have different strengths for character
conversion.
- Converting input/output, binary and geometry data
Streams are used for serializing object data, saving it
to files, and transferring it between devices and threads. In most
cases there is no need to convert stream data between Symbian and
Qt. Geometry conversion involves converting points, sizes, rectangles
and x and y coordinates and in most cases is straight-forward.
- Converting containers and lists
Symbian and Qt both provide an extensive set of array types
for purposes such as containers, lists and hash maps. In some cases
conversion can be avoided but in other cases the conversion is only
possible using item-by-item iteration.
- Multitasking for Symbian and Qt
Symbian and Qt both provide typical multitasking functionality
in the form of threads, processes, synchronization and inter-thread
communication. The Qt Mobility API provides limited access to Symbian's
inter-process communication API but otherwise the two approaches are
separate. Both also provide different in-thread cooperative multitasking
systems.
- Case study
This section provides the implementation details of the
telephony example to show certain use cases of telephony.
Related concepts