tags:

views:

436

answers:

2

I'm building a an application using Qt on the Symbian/S60 platform and I was wondering if there was a standard notification window that I could use to pass messages to users. Using other platforms as examples, I'm looking for something equivalent to Javascript's alert() method or Cocoa's NSRunAlert* methods.

If there is not a native Symbian/S60 equivalent, is there something in the Qt space that I should be looking at? QMessageBox didn't seem to work as I might expect.

+2  A: 

Apparently there is not a way to access the native notification windows from Qt proper. I did find the following:

//Create warning message box
QMessageBox::warning(0,"Warning", "Warning message text");
//Create information message box
QMessageBox::information(0, "Information", "Information message text");
//Create critical message box
QMessageBox::critical(0, "Critical", "Critical message text");

Still not what I'm looking for, but it will have to do.

Source: Nokia

Chris K.
+1  A: 

You can use RNotifier class from any Symbian code (and from Qt too). This class can show notifications even from window-less programs, like Symbian servers. It is simple to use:

    RNotifier notifier;
    User::LeaveIfError(notifier.Connect());
    TInt buttonVal;
    TRequestStatus lStatus;
    notifier.Notify(_L("First line of notification"), _L("Second line of notification"), _L("Left button text"), _L("Right button text"), buttonVal, lStatus);
    User::WaitForRequest(lStatus);
    notifier.Close();

After User::WaitForRequest(lStatus) completes you can inspect value of buttonVal to know which button was pressed. It is set to: 0, if the left button is selected; 1, if the right button is selected.

Hope this helps.

Haspemulator
I ended up using a variation of this approach, but thanks for the answer nonetheless. :-)
Chris K.