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
No edit summary |
AutoSpider (talk | contribs) (Remove inaccurate statement about Maemo/MeeGo successor. See Talk:Support for Maemo) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Outdated|reason=The MeeGo/Harmattan platform is no longer supported.}} | |||
{{Cleanup | reason=Auto-imported from ExpressionEngine.}} | |||
Using the ''Qt Quick Application'' wizard in the current edition of Qt Creator creates Harmattan apps with a few graphical bugs and artifacts: | = 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. | 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. | ||
Line 7: | Line 12: | ||
== Workaround == | == Workaround == | ||
# Open your project, expand the ''qmlapplicationviewer'' sub-project, expand ''sources'' and then open ''qmlapplicationviewer.c''. | # Open your project, expand the ''qmlapplicationviewer'' sub-project, expand ''sources'' and then open ''qmlapplicationviewer.c''. | ||
# Find the ''QmlApplicationViewer::showExpanded()'' function: | |||
<code> | |||
void QmlApplicationViewer::showExpanded() | |||
{ | |||
#ifdef Q_OS_SYMBIAN | |||
showFullScreen(); | |||
#elif defined(Q_WS_MAEMO_5) | |||
showMaximized(); | |||
#else | |||
show(); | |||
#endif | |||
} | |||
</code> | |||
# Change it to match the below version: | |||
<code> | |||
void QmlApplicationViewer::showExpanded() | |||
{ | |||
#if defined(Q_WS_MAEMO_5) | |||
showMaximized(); | |||
#else | |||
showFullScreen(); | |||
#endif | |||
} | |||
</code> | |||
# Save and rebuild your project | |||
=== What does this do? === | === What does this do? === |
Latest revision as of 15:06, 27 April 2015
IMPORTANT: The content of this page is outdated. Reason: The MeeGo/Harmattan platform is no longer supported. If you have checked or updated this page and found the content to be suitable, please remove this notice. |
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
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
- Open your project, expand the qmlapplicationviewer sub-project, expand sources and then open qmlapplicationviewer.c.
- Find the QmlApplicationViewer::showExpanded() function:
void QmlApplicationViewer::showExpanded()
{
#ifdef Q_OS_SYMBIAN
showFullScreen();
#elif defined(Q_WS_MAEMO_5)
showMaximized();
#else
show();
#endif
}
- Change it to match the below version:
void QmlApplicationViewer::showExpanded()
{
#if defined(Q_WS_MAEMO_5)
showMaximized();
#else
showFullScreen();
#endif
}
- 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.