Build a Symbian Qt app¶
examples/qt_app_classic displays a full-screen Qt card. Run QtCore check
shows a QByteArray result, and Close exits through the Qt event loop and
runs the normal application destructors. It uses guest Symbian Qt 4.8.1; the Qt 6 desktop libraries bundled
with the emulator serve its host interface and cannot provide guest widgets.
Install the SDK and emulator¶
Follow Getting started to install symbian-platform
into a Python environment. Install the native SDK archive
for your host, then install and check the compatible emulator:
Import your firmware and select its local alias. This example requires EKA2 firmware with guest QtCore and QtGui 4.8.1 installed. The SDK and emulator distributions include neither firmware nor guest Qt DLLs. Do not replace the Qt DLLs in another device's firmware with this example's imports.
Prepare the example¶
The native SDK supplies the original QtCore/QtGui headers, complete import
libraries, compatibility settings and allocator hook. It also includes the
example source. After installing the SDK at ~/dev/symbian-sdk, build it:
qt_project="$HOME/dev/symbian-sdk/examples/qt_app_classic"
symbian build --project "$qt_project" --output .symbian/qt-app
symbian inspect --format e32 .symbian/qt-app/qt_app_classic.exe
The application build is an ordinary CMake target:
include(SymbianApp)
symbian_add_executable(qt_app_classic app.cc)
target_link_libraries(qt_app_classic PRIVATE Symbian::Runtime Symbian::QtGui)
Symbian::QtGui brings in QtCore. The SDK generates the needed E32 imports
from the libraries actually linked; applications need no symbol list or
startup files. sdk-location.json can select another installed native SDK.
If Symbian::QtGui is unavailable, install a native SDK containing guest Qt
support. Older SDK distributions do not provide this target.
The native SDK supplies Clang, LLD, CMake and Ninja on both hosts. From a
source checkout, set qt_project="$PWD/examples/qt_app_classic" to use the repository
copy instead.
Run the button¶
Select your imported firmware and launch the application:
The SDK stages the executable and its application resources. Tap Run QtCore
check to show the byte-array result, then tap Close to exit the guest
application and close the emulator. --backend dyncom
selects the other CPU backend.
To browse the firmware's application list instead, use
symbian emu run --project "$qt_project" --firmware my-phone, open
Symbian Qt, and close the emulator window when finished.
The application constructs its widgets after QApplication. A Qt signal mapper connects the Run button to the result label, while Close connects to the application's quit slot:
QByteArray payload;
payload.append("808");
QSignalMapper mapper(&panel);
mapper.setMapping(&run, QString::fromUtf8("QByteArray contains 808 (3 bytes)"));
QObject::connect(&run, SIGNAL(clicked()), &mapper, SLOT(map()));
QObject::connect(&mapper, SIGNAL(mapped(QString)), &result,
SLOT(setText(QString)));
if (!QObject::connect(&close, SIGNAL(clicked()), &application, SLOT(quit()))) {
return 4;
}
panel.showFullScreen();
return application.exec();
The complete app.cc also selects raster graphics and Plastique, and disables
the S60 exit-animation signal. The emulator does not implement the Window
Server graphics plugins used by those animations. Keep those settings when
adapting this example for the emulator. This is an EKA2 widget example;
EKA1, other guest Qt versions, general Qt modules and physical-device operation
are outside its tested configuration.
Package the application¶
The supplied symbian.toml declares the executable, menu caption and package:
symbian package --project "$qt_project" \
--artifact .symbian/qt-app/qt_app_classic.exe --output .symbian/qt-package
symbian inspect --format sis .symbian/qt-package/qt_app_classic.sis
The package contains your executable and registration resources. It requires the device's existing Qt installation. For signing and transfer, follow the application packaging and device guide.