Symbian-Developers

The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Symbian Java/C++ Application Development => Topic started by: huellif on November 16, 2013, 09:44:31 pm

Title: writing a native app with QtSDK
Post by: huellif on November 16, 2013, 09:44:31 pm
Qt makes coding easier, but for little tools (shortcuts etc.) you don't need any Qt functions and smartinstaller.
Instead of this you can write a native app, it also works fine with QtSDK. You don't need classic Symbian SDK and Carbide C++

a little example:

.pro content:
Code: [Select]
SOURCES += main.cpp
CONFIG -= qt

INCLUDEPATH = C:\QtSDK\Symbian\SDKs\SymbianSR1Qt474\epoc32\include\
INCLUDEPATH = C:\QtSDK\Symbian\SDKs\SymbianSR1Qt474\epoc32\include\platform\

"CONFIG -= qt" disables all Qt specific stuff (macros, imports, includes etc.)

QtSDK usually searches all headers in QtSDK by itself, but not with "CONFIG -= qt" this feature doesn't work. you have to add all the include pathes by yourself.
If you build a project and get an error about missing header, you have to include the related paths to your .pro.

main.cpp code:
Code: [Select]
#include <mw/apgtask.h>

TInt E32Main()
{
    RProcess proc;
    User::LeaveIfError(proc.Create(_L("clock.exe"),KNullDesC));
    proc.Resume();
    proc.Close();
    return 0;
}

as you can see the include starts with "mw/", this means compiler will seach it in all "mw" subfolders from INLUCDEPATH of the .pro file.

Also you see there's no classic "int main", instead of this a "TInt E32Main()"
that's simply the Symbian specific name of the main method, I guess with open C macros also int main could work.
Title: Re: writing a native app with QtSDK
Post by: matthew on November 16, 2013, 10:23:08 pm
One day, when i understand all these tutorials of yours, i will appreciate this even more.
Thanks, mate ;)