Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Solving Qt Quick Harmattan Graphics Bugs: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Qt Quick Harmattan Graphics Bugs=
h1. Qt Quick Harmattan Graphics Bugs


Using the ''Qt Quick Application'' wizard in the current edition of Qt Creator creates Harmattan apps with a few graphical bugs and artifacts:
Using the ''Qt Quick Application'' wizard in the current edition of Qt Creator creates Harmattan apps with a few graphical bugs and artifacts:<br /># When loading the application only fills part of the screen while sliding into view<br /># If loading or bringing the application to foreground while the screen is locked or the device is in landscape a dummy toolbar and statusbar get locked in landscape mode<br /># If loading or bringing the application to foreground while the application is in portrait, the left-hand part of the statusbar gets stuck in the corner when you rotate the device to landscape


# When loading the application only fills part of the screen while sliding into view
This is due to a single line in the ''qmlapplicationviewer'' code which is created by the Qt Creator wizard, and fortunately it's easy to fix.
# If loading or bringing the application to foreground while the screen is locked or the device is in landscape a dummy toolbar and statusbar get locked in landscape mode
# If loading or bringing the application to foreground while the application is in portrait, the left-hand part of the statusbar gets stuck in the corner when you rotate the device to landscape


This is due to a single line in the ''qmlapplicationviewer'' code which is created by the Qt Creator wizard, and fortunately it’s easy to fix.
== Workaround ==


==Workaround==
# Open your project, expand the ''qmlapplicationviewer'' sub-project, expand ''sources'' and then open ''qmlapplicationviewer.c''.<br /># Find the ''QmlApplicationViewer::showExpanded()'' function:<br /><code><br />void QmlApplicationViewer::showExpanded()<br />{<br />#ifdef Q_OS_SYMBIAN<br /> showFullScreen();<br />#elif defined(Q_WS_MAEMO_5)<br /> showMaximized();<br />#else<br /> show();<br />#endif<br />}<br /></code><br /># Change it to match the below version:<br /><code><br />void QmlApplicationViewer::showExpanded()<br />{<br />#if defined(Q_WS_MAEMO_5)<br /> showMaximized();<br />#else<br /> showFullScreen();<br />#endif<br />}<br /></code><br /># Save and rebuild your project


# Open your project, expand the ''qmlapplicationviewer'' sub-project, expand ''sources'' and then open ''qmlapplicationviewer.c''.
=== What does this do? ===
# Find the ''QmlApplicationViewer::showExpanded()'' function:<br />
# Change it to match the below version:<br />
# Save and rebuild your project
 
===What does this do?===


It simply maximises the application before Harmattan begins to slide it into view. The original code would skip past the ''#ifdef'' to reach the ''show();'' command, meaning it would open with no size definitions; then Harmattan would slide it into view and then resize it as per the UX guidelines.
It simply maximises the application before Harmattan begins to slide it into view. The original code would skip past the ''#ifdef'' to reach the ''show();'' command, meaning it would open with no size definitions; then Harmattan would slide it into view and then resize it as per the UX guidelines.


Additionally the landscape artifacts seem to be created because the application has not been properly maximised — the above fix also fixes this issue.
Additionally the landscape artifacts seem to be created because the application has not been properly maximised — the above fix also fixes this issue.
Is this a bug in the ''qmlapplicationviewer'' code or in Harmattan itself? Whatever the case this is a fix until it is officially changed in one area or another.

Revision as of 06:24, 24 February 2015

h1. Qt Quick Harmattan Graphics Bugs

Using the Qt Quick Application wizard in the current edition of Qt Creator creates Harmattan apps with a few graphical bugs and artifacts:
# When loading the application only fills part of the screen while sliding into view
# If loading or bringing the application to foreground while the screen is locked or the device is in landscape a dummy toolbar and statusbar get locked in landscape mode
# If loading or bringing the application to foreground while the application is in portrait, the left-hand part of the statusbar gets stuck in the corner when you rotate the device to landscape

This is due to a single line in the qmlapplicationviewer code which is created by the Qt Creator wizard, and fortunately it's easy to fix.

Workaround

  1. Open your project, expand the qmlapplicationviewer sub-project, expand sources and then open qmlapplicationviewer.c.
    # Find the QmlApplicationViewer::showExpanded() function:
    <br />void QmlApplicationViewer::showExpanded()<br />{<br />#ifdef Q_OS_SYMBIAN<br /> showFullScreen();<br />#elif defined(Q_WS_MAEMO_5)<br /> showMaximized();<br />#else<br /> show();<br />#endif<br />}<br />
    

    # Change it to match the below version:
    <br />void QmlApplicationViewer::showExpanded()<br />{<br />#if defined(Q_WS_MAEMO_5)<br /> showMaximized();<br />#else<br /> showFullScreen();<br />#endif<br />}<br />
    

    # Save and rebuild your project

What does this do?

It simply maximises the application before Harmattan begins to slide it into view. The original code would skip past the #ifdef to reach the show(); command, meaning it would open with no size definitions; then Harmattan would slide it into view and then resize it as per the UX guidelines.

Additionally the landscape artifacts seem to be created because the application has not been properly maximised — the above fix also fixes this issue.