December 12, 2010

VCsala VCsala
Lab Rat
339 posts

QMessageBox::critical on Qt Simulator using maemo view

 

I am working on a small application for mobile devices which requires login to a site. When it fails I try to use QMessageBox::critical to inform the user about the failure but instead of appearing a full screen messagebox with a critical icon, the text and the Ok button (as I expected similar to the QProgressBox) only a small rectangle appears in the top-left corner which contains the icon and the text (even the OK button is not visible). If I hit Enter it works as it should be (the small rectangle disappears and the control goes back to the login screen).

The code snippet I use is the following:

  1. void LoginScreen::signInFailed()
  2. {
  3.     m_progress->reset();
  4.     QMessageBox::critical(this, tr("Failure"), tr("Sign in failed!"));
  5. }

Is it normal (the simulator should work this way) or I did something wrong?

13 replies

December 12, 2010

disperso disperso
Ant Farmer
183 posts

Some “classic” dialogs are not allowed on Maemo because are not integrated. Have you seen the Maemo 5 platform notes [doc.qt.nokia.com] ? Seems like QMaemo5InformationBox [doc.qt.nokia.com] might help. I don’t see the direct replacement, though.

December 12, 2010

QtK QtK
Lab Rat
1140 posts

Same is the case with Symbian – some are not integrated.

December 12, 2010

fcrochik fcrochik
Lab Rat
517 posts

Also before you decide for another solution make sure to test on the device. The simulator is not an emulator by any stretch of imagination – it is a completely different animal that has a “maemo” skin.

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

December 12, 2010

VCsala VCsala
Lab Rat
339 posts

Thanks, I had the feeling that the simulator is not 100% compatible with the device, so I try to run it there as well, and for sake of knowledge sharing I come back here and let you know what happened. I will also check QMaemo5InformationBox too (thanks for the information).

December 12, 2010

disperso disperso
Ant Farmer
183 posts

I’ve started a page on Qt Simulator Limitations [developer.qt.nokia.com], but I don’t know what else can be said.

December 12, 2010

QtK QtK
Lab Rat
1140 posts

In case of symbian the emulator which comes with native SDK is much better. However, its too slow. You can have a cup of tea by the time it launches in debug mode.

December 12, 2010

disperso disperso
Ant Farmer
183 posts

That’s probably because it’s an emulator isntead of simulator. The android one is also slow to load, because you even see the boot process.

December 12, 2010

QtK QtK
Lab Rat
1140 posts

Yes, thats right. Also when Symbian foundation was active they had plans to improve it and support it in Linux with QEMU support.

December 13, 2010

fcrochik fcrochik
Lab Rat
517 posts

I have to say that the simulator is of very little use to me. When developing applications for maemo you end up using a lot of “maemo” specific/linux stuff.

Running on scratchbox is pretty good (and real) but since qt creator can publish to the actual device that has been my preferred way.

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

December 13, 2010

disperso disperso
Ant Farmer
183 posts
QtK wrote:
Yes, thats right. Also when Symbian foundation was active they had plans to improve it and support it in Linux with QEMU support.

I remember that, I even have it bookmarked:

An Introduction to the Symbian Virtual Platform [blog.symbian.org]
Stepping Toward Symbian Open Source Tools on Linux and Mac [blog.symbian.org]

(these links will stop to work in just days when the Symbian foundation closes the websites [allaboutsymbian.com])

But you said “was”. Do you know if they are less interested in this now?

December 13, 2010

QtK QtK
Lab Rat
1140 posts
disperso wrote:
QtK wrote:
Yes, thats right. Also when Symbian foundation was active they had plans to improve it and support it in Linux with QEMU support.

I remember that, I even have it bookmarked:

An Introduction to the Symbian Virtual Platform [blog.symbian.org]
Stepping Toward Symbian Open Source Tools on Linux and Mac [blog.symbian.org]

(these links will stop to work in just days when the Symbian foundation closes the websites [allaboutsymbian.com])

But you said “was”. Do you know if they are less interested in this now?

Now it seems with Nokia taking back the control again – they might have lot of other things to work on. Also it was expected to hear some announcement on the future of SF and other such projects which were run under them. As of now no email with these clarifications have been issued in the groups.

But yes QEMU will be supported someday, but it seems will take some time now as compared to the plans SF had.

December 13, 2010

VCsala VCsala
Lab Rat
339 posts

Meantime I have tested the application on my N900 and it worked as it was expected. So as Crochik said the simulator is not really reliable in this case. Moreover on the device the content of the LineEdit fields was not readable (text had similar or same color as the background color was).

December 13, 2010

fcrochik fcrochik
Lab Rat
517 posts

The color issue probably deserve reporting a bug on JIRA.
I don’t think you should count on having it fixed before you deploy your application but …

 Signature 

Certified Specialist & Qt Ambassador Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop… Qt everywhere!

 
  ‹‹ How to change language in QMenu in QMainWindow class      How to create an Image viewer for Qt Simulator ??? ››

You must log in to post a reply. Not a member yet? Register here!