Results 1 to 5 of 5

Thread: "Extra" buttons in Symbian emulator

  1. #1
    Join Date
    Aug 2011
    Location
    Denmark
    Posts
    11
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default "Extra" buttons in Symbian emulator

    I am developing my first Qt application which is targeted for Symbian and Harmattan platforms. I code it in QML with the default QMLApplicationViewer C++ code to start the app.

    When I test the app in Symbian Emulator, two extra buttons are showed in the bottom of the screen, one without function and the other with an exit function. When I test on a physical device these buttons are not present. Why do they appear in the emulator, and can I somehow turn them off?

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: "Extra" buttons in Symbian emulator

    Quote Originally Posted by finngruwier View Post
    Why do they appear in the emulator, and can I somehow turn them off?
    I would suggest:
    1) A bug.
    2) Just forget them. There probably is nothing you can do about them, and nobody else probably will, or if they will, it will be in the next SDK -- after all, QML is a new thing so bugs are a natural thing, unfortunately.

  3. The following user says thank you to mvuori for this useful post:

    finngruwier (20th August 2011)

  4. #3
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: "Extra" buttons in Symbian emulator

    The main code that is automatically generated is usually something like:

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4.  
    5. QmlApplicationViewer viewer;
    6. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    7. viewer.setMainQmlFile(QLatin1String("qml/testapp/main.qml"));
    8. viewer.showExpanded();
    9.  
    10. return app.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 
    and the implementation for showExpanded() is:

    Qt Code:
    1. void QmlApplicationViewer::showExpanded()
    2. {
    3. #ifdef Q_OS_SYMBIAN
    4. showFullScreen();
    5. #elif defined(Q_WS_MAEMO_5)
    6. showMaximized();
    7. #else
    8. show();
    9. #endif
    10. }
    To copy to clipboard, switch view to plain text mode 
    Which means that in the simulator you are calling show() method to show the UI. Instead of doing that you should call showFullScreen() for the simulator as well, for example by changing the implementation of main (because that file is not updated automatically when QtCreator is updated!):

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4.  
    5. QmlApplicationViewer viewer;
    6. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    7. viewer.setMainQmlFile(QLatin1String("qml/testapp/main.qml"));
    8.  
    9. #if defined QT_SIMULATOR
    10. viewer.showFullScreen();
    11. #else
    12. viewer.showExpanded();
    13. #endif
    14.  
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 
    That should do the work.

  5. The following user says thank you to tsp for this useful post:

    finngruwier (20th August 2011)

  6. #4
    Join Date
    Aug 2011
    Location
    Denmark
    Posts
    11
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: "Extra" buttons in Symbian emulator

    It did - thanks. Another way to do the same thing is to change the last bit of qmlapplicationviewer.cpp to:

    Qt Code:
    1. void QmlApplicationViewer::showExpanded()
    2. {
    3. #ifdef Q_OS_SYMBIAN
    4. showFullScreen();
    5. #elif defined(QT_SIMULATOR)
    6. showFullScreen();
    7. #elif defined(Q_WS_MAEMO_5)
    8. showMaximized();
    9. #else
    10. show();
    11. #endif
    12. }
    To copy to clipboard, switch view to plain text mode 

    I could be seen as a bug in Qt Creator that it doesn't do this automatically.

  7. #5
    Join Date
    Aug 2011
    Location
    Denmark
    Posts
    11
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: "Extra" buttons in Symbian emulator

    On the other hand: after having implemented the above, every time I now open the project Qt Creator tells me that qmlapplicationview.cpp is "modified" and asks me if I want to "update" it (i. e. reverse it to the original version). This is a bit annoying, so the solution proposed by tsp is better.

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 22:46
  2. Replies: 0
    Last Post: 26th February 2010, 13:16
  3. How to create "extra" soft keys
    By jasper_ferrer in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th September 2009, 04:00
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. Replies: 7
    Last Post: 20th November 2007, 13:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.