Symbian-Developers
The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Qt Application Development => Topic started by: huellif on August 26, 2013, 11:15:02 pm
-
You don't like the QML info banner?
Well what about a native CAknDiscreetpopup?
It's visible in all other apps, not only in your app.
Add to your .pro:
LIBS += -lavkon\
to your class:
#include <akndiscreetpopup.h>
and also if you want a long popup
#include <aknnotewrappers.h>
so now everything is read for the 4 possible methods:
1.)use this simple method to call the popup for 1.5 seconds:
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL((_L("title")), (_L("message")),KAknsIIDNone, KNullDesC));
2.) for 3.0 seconds:
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL((_L("title")), (_L("message")),KAknsIIDNone, KNullDesC, 0, 0, KAknDiscreetPopupDurationLong, 0, NULL));
If you touch this popup nothing happen, but I guess you want to bring your app in forgound when the user does touch it.
3) for 3 seconds popup:
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL((_L("title")), (_L("message")),KAknsIIDNone, KNullDesC, 0, 0, KAknDiscreetPopupDurationLong, 0, NULL, {0xXXXXXXX}));
4)for 1.5 seconds popup:
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL((_L("title")), (_L("message")),KAknsIIDNone, KNullDesC, 0, 0, 0, 0, NULL, {0xXXXXXXX}));
for 0xXXXXXXX set the UID of your app.
of course you can use QStrings instead of native _L
convert them via:
QString qtitle = "Title";
TPtrC16 stitle(reinterpret_cast<const TUint16*>(qtitle.utf16()));
QString qmessage = "Message";
TPtrC16 smessage(reinterpret_cast<const TUint16*>(qmessage.utf16()));
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL(stitle, smessage,KAknsIIDNone, KNullDesC));
thanks Il.Socio for your help :)
-
Any chance of a little built example ?
Left me with a billion errors ::)
-
sure wait a bit :)
-
an easy example is attached:
[attachment deleted by admin]
-
I got a request, here's a new example.
Changelog:
- you can enter title and content from QtQuick
- you can directly set both from QtQuick
[attachment deleted by admin]
-
Thanks for your nice share. It really helped me a lot.
What's more, can I add a icon, my app's desktop icon for example, into this popup ?
-
yes it's possible :)
But I never tried to, maybe you could have a look at the header file: http://pastebin.com/zfXGWfeF