• May 01, 2024, 11:47:13 pm

Author Topic: CAknDiscreetpopup from Qt/QML  (Read 2955 times)

0 Members and 1 Guest are viewing this topic.

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
CAknDiscreetpopup from Qt/QML
« 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:
Code: [Select]
LIBS += -lavkon\

to your class:
Code: [Select]
#include <akndiscreetpopup.h>
and also if you want a long popup
Code: [Select]
#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:
Code: [Select]
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL((_L("title")), (_L("message")),KAknsIIDNone, KNullDesC));


2.) for 3.0 seconds:
Code: [Select]
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:
Code: [Select]
TRAP_IGNORE(CAknDiscreetPopup::ShowGlobalPopupL((_L("title")), (_L("message")),KAknsIIDNone, KNullDesC, 0, 0, KAknDiscreetPopupDurationLong, 0, NULL, {0xXXXXXXX}));


4)for 1.5 seconds popup:
Code: [Select]
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:
Code: [Select]
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 :)
« Last Edit: September 02, 2013, 08:33:53 pm by huellif »

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
Re: CAknDiscreetpopup from Qt/QML
« Reply #1 on: August 31, 2013, 04:38:52 pm »
Any chance of a little built example ?
Left me with a billion errors ::)

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: CAknDiscreetpopup from Qt/QML
« Reply #2 on: September 01, 2013, 12:16:14 am »
sure wait a bit :)

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: CAknDiscreetpopup from Qt/QML
« Reply #3 on: September 02, 2013, 08:21:45 pm »
an easy example is attached:

[attachment deleted by admin]

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: CAknDiscreetpopup from Qt/QML
« Reply #4 on: September 03, 2013, 02:21:58 am »
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]

Offline yeatse

  • Developer
  • Viewer
  • ****
  • Posts: 8
  • Reputation: 6
  • Symbian Power User
  • Current Phone: : 808
Re: CAknDiscreetpopup from Qt/QML
« Reply #5 on: November 25, 2013, 11:27:56 am »
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 ?

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: CAknDiscreetpopup from Qt/QML
« Reply #6 on: November 29, 2013, 01:52:18 am »
yes it's possible :)
But I never tried to, maybe you could have a look at the header file: http://pastebin.com/zfXGWfeF