• April 27, 2024, 05:59:31 pm

Author Topic: writing a native app with QtSDK  (Read 1873 times)

0 Members and 1 Guest are viewing this topic.

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
writing a native app with QtSDK
« 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.
« Last Edit: November 16, 2013, 10:17:10 pm by huellif »

Offline matthew

  • Mass Poster
  • ****
  • Posts: 1,315
  • Reputation: 13
  • SymphonyOS
  • Current Phone: :
    N8-00 (25.007)
    808 (113.010.1508)
    Retired E72, E6-00
Re: writing a native app with QtSDK
« Reply #1 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 ;)