Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Browse files Browse the repository at this point in the history
Conflicts:
	examples/declarative/positioners/layoutdirection/layoutdirection.qml
	src/corelib/global/qglobal.h
	src/plugins/qpluginbase.pri
	src/qbase.pri
	src/s60installs/bwins/QtOpenGLu.def
	src/s60installs/eabi/QtOpenGLu.def
	tests/auto/selftests/expected_cmptest.txt
	tests/auto/selftests/expected_crashes_3.txt
	tests/auto/selftests/expected_longstring.txt
	tests/auto/selftests/expected_maxwarnings.txt
	tests/auto/selftests/expected_skip.txt
	tools/assistant/tools/assistant/doc/assistant.qdocconf
	tools/qdoc3/test/assistant.qdocconf
	tools/qdoc3/test/designer.qdocconf
	tools/qdoc3/test/linguist.qdocconf
	tools/qdoc3/test/qdeclarative.qdocconf
	tools/qdoc3/test/qmake.qdocconf
	tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
	tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
  • Loading branch information
ogoffart committed Mar 22, 2011
2 parents 9e85af3 + 011c6d0 commit 13d4be0
Show file tree
Hide file tree
Showing 44 changed files with 1,755 additions and 402 deletions.
8 changes: 4 additions & 4 deletions config.tests/unix/endian/endiantest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ short lsb_littleendian[] = { 0x0000, 0x654c, 0x7361, 0x5374, 0x6769, 0x696e, 0x6
int main(int, char **)
{
// make sure the linker doesn't throw away the arrays
char *msb_bigendian_string = (char *) msb_bigendian;
char *lsb_littleendian_string = (char *) lsb_littleendian;
(void) msb_bigendian_string;
(void) lsb_littleendian_string;
void (*msb_bigendian_string)() = (void (*)())msb_bigendian;
void (*lsb_littleendian_string)() = (void (*)())lsb_littleendian;
(void)msb_bigendian_string();
(void)lsb_littleendian_string();
return msb_bigendian[1] == lsb_littleendian[1];
}
31 changes: 31 additions & 0 deletions dist/changes-4.7.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Qt 4.7.4 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 4.7.0. For more details,
refer to the online documentation included in this distribution. The
documentation is also available online:

http://qt.nokia.com/doc/4.7

The Qt version 4.7 series is binary compatible with the 4.6.x series.
Applications compiled for 4.6 will continue to run with 4.7.

Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker or the Merge Request queue
of the public source repository.

Qt Bug Tracker: http://bugreports.qt.nokia.com
Merge Request: http://qt.gitorious.org

****************************************************************************
* Library *
****************************************************************************


****************************************************************************
* Platform Specific Changes *
****************************************************************************


****************************************************************************
* Tools *
****************************************************************************

1 change: 1 addition & 0 deletions doc/src/declarative/declarativeui.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Module.
\o \l{QML Basic Types}
\o \l{QML Global Object}
\o \l{QML Internationalization}
\o \l{QML Right-to-left User Interfaces}
\o \l{QML Security}
\o \l{Qt Declarative Module}
\o \l{Debugging QML}
Expand Down
12 changes: 9 additions & 3 deletions doc/src/declarative/examples.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ The examples can be found in Qt's \c examples/declarative directory.

\section2 Positioners
\list
\o \l{declarative/positioners/addandremove}{Adding and Removing Items}
\o \l{declarative/positioners/layoutdirection}{Layout Direction}
\o \l{declarative/positioners}{Example}
\endlist

\section2 Key Interaction
Expand Down Expand Up @@ -198,13 +197,20 @@ The examples can be found in Qt's \c examples/declarative directory.
\o \l{declarative/i18n}{Example}
\endlist

\section2 Right-to-left User Interfaces
\list
\o \l{declarative/righttoleft/layoutmirroring}{Layout mirroring}
\o \l{declarative/righttoleft/layoutdirection}{Layout direction}
\o \l{declarative/righttoleft/textalignment}{Text alignment}
\endlist

\section2 Threading
\list
\o \l{declarative/threading/threadedlistmodel}{Threaded ListModel}
\o \l{declarative/threading/workerscript}{WorkerScript}
\endlist

\section2 Screen orientation
\section2 Screen Orientation
\list
\o \l{declarative/screenorientation}{Example}
\endlist
Expand Down
Binary file added doc/src/declarative/pics/layoutmirroring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
195 changes: 195 additions & 0 deletions doc/src/declarative/righttoleft.qdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\page qml-righttoleft.html
\title QML Right-to-left User Interfaces

\section1 Overview

This chapter discusses different approaches and options available for implementing right-to-left
language support for Qt Quick applications. Some common right-to-left languages include Arabic, Hebrew,
Persian and Urdu. Most changes include making sure that text translated to right-to-left languages
is properly aligned to the right, and horizontally ordered content in views, lists and grids flows
correctly from the right to left.

In right-to-left language speaking cultures, people naturally scan and read graphic elements and text
from the right to left. The general rule of thumb is that content (like photos, videos and maps) is not
mirrored, but positioning of the content (like application layouts and the flow of visual elements) is
mirrored. For example, photos shown in chronological order should flow from right to left, the
low end range of the horizontal sliders should be located at the right side of the slider, and
text lines should should be aligned to the right side of the available text area. The location of visual
elements should not be mirrored when the position is related to a content; for example, when a
position marker is shown to indicate a location on a map. Also, there are some special cases you may
need to take into account where right-to-left language speakers are used to left-to-right
positioning, for example when using number dialers in phones and media play, pause, rewind and
forward buttons in music players.

\section1 Text Alignment

(This applies to the \l Text, \l TextInput and \l TextEdit elements.)

When the horizontal alignment of a text item is not explicitly set, the text element is
automatically aligned to the natural reading direction of the text. By default left-to-right text
like English is aligned to the left side of the text area, and right-to-left text like Arabic is
aligned to the right side of the text area. The alignment of a text element with empty text takes
its alignment cue from \l QApplication::keyboardInputDirection(), which is based on the active
system locale.

This default locale-based alignment can be overriden by setting the \c horizontalAlignment
property for the text element, or by enabling layout mirroring using the \l LayoutMirroring attached
property, which causes any explicit left and right horizontal alignments to be mirrored.
Note that when \l LayoutMirroring is set, the \c horizontalAlignment property value remains unchanged;
the effective alignment of the text element that takes the mirroring into account can be read from the
\c effectiveHorizontalAlignment property.

\snippet doc/src/snippets/declarative/righttoleft.qml 0

\section1 Layout direction of positioners and views

(This applies to the \l Row, \l Grid, \l Flow, \l ListView and \l GridView elements.)

From Qt Quick 1.1 onwards, elements used for horizontal positioning and model views have gained a \c layoutDirection
property for controlling the horizontal direction of the layouts. Setting \c layoutDirection to
\c Qt.RightToLeft causes items to be laid out from the right to left. By default Qt Quick follows
the left-to-right layout direction.

The horizontal layout direction can also be reversed through the \l LayoutMirroring attached property.
This causes the effective \c layoutDirection of positioners and views to be mirrored. Note the actual value
of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and
views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property.

\snippet doc/src/snippets/declarative/righttoleft.qml 1

\section1 Layout mirroring

The attached property \l LayoutMirroring is provided as a convenience for easily implementing right-to-left
support for existing left-to-right Qt Quick applications. It mirrors the behavior of \l {anchor-layout}
{Item anchors}, the layout direction of \l{Using QML Positioner and Repeater Items}{positioners} and
model views, and the explicit text alignment of QML text elements.

You can enable layout mirroring for a particular \l Item:

\snippet doc/src/snippets/declarative/righttoleft.qml 2

Or set all child elements to also inherit the layout direction:

\snippet doc/src/snippets/declarative/righttoleft.qml 3

Applying mirroring in this manner does not change the actual value of the relevant anchor,
\c layoutDirection or \c horizontalAlignment properties. The separate read-only property
\c effectiveLayoutDirection can be used to query the effective layout
direction of positioners and model views that takes the mirroring into account. Similarly the \l Text,
\l TextInput and \l TextEdit elements have gained the read-only property \c effectiveHorizontalAlignment
for querying the effective visual alignment of text. For anchors, the read only
\l {Item::anchors}{anchors.mirrored} property reflects whether anchors have been mirrored.

Note that application layouts and animations that are defined using \l {Item::}{x} property values (as
opposed to anchors or positioner elements) are not affected by the \l LayoutMirroring attached property.
Therefore, adding right-to-left support to these types of layouts may require some code changes to your application,
especially in views that rely on both the anchors and x coordinate-based positioning. Here is one way to use
the \l LayoutMirroring attached property to apply mirroring to an item that is positioned using \l {Item::}{x}
coordinates:

\snippet doc/src/snippets/declarative/righttoleft.qml 4

Not all layouts should necessarily be mirrored. There are cases where a visual element is positioned to
the right side of the screen for improved one-handed use, because most people are right-handed, and not
because of the reading direction. In the case that a child element should not be affected by mirroring,
set the \l {LayoutMirroring::enabled}{LayoutMirroring.enabled} property for that element to false.

Qt Quick is designed for developing animated, fluid user interfaces. When mirroring your application, remember to test that
the animations and transitions continue to work as expected. If you do not have the resources to add
right-to-left support for your application, it may be better to just keep the application layouts left
aligned and just make sure that text is translated and aligned properly.

\section1 Mirroring icons

(This applies to \l Image, \l BorderImage and \l AnimatedImage elements.)

Most images do not need to be mirrored, but some directional icons, such as arrows, may need to be mirrored.
The painting of these icons can be mirrored with a dedicated \c mirror property introduced in Qt Quick 1.1:

\snippet doc/src/snippets/declarative/righttoleft.qml 5

\section1 Default layout direction

The \l {QML:Qt::application}{Qt.application.layoutDirection} property can be used to query the active layout direction of the
application. It is based on QApplication::layoutDirection(), which most commonly determines the layout
direction from the active language translation file.

To define the layout direction for a particular locale, declare the dedicated string literal
\c QT_LAYOUT_DIRECTION in context \c QApplication as either "LTR" or "RTL".

You can do this by first introducing this line

\code
QT_TRANSLATE_NOOP("QApplication", "QT_LAYOUT_DIRECTION");
\endcode

somewhere in your QML source code and calling \c lupdate to generate the translation source file.

\code
lupdate myapp.qml -ts myapp.ts
\endcode

This will append the following declaration to the translation file, where you can fill in either "LTR" or
"RTL" as the translation for the locale.

\code
<context>
<name>QApplication</name>
<message>
<location filename="myapp.qml" line="33"/>
<source>QT_LAYOUT_DIRECTION</source>
<translation type="unfinished">RTL</translation>
</message>
</context>
\endcode

You can test that the layout direction works as expected by running your Qt Quick application with
the compiled translation file:

\code
qmlviewer myapp.qml -translation myapp.qm
\endcode

You can test your application in right-to-left layout direction simply by executing qmlviewer with a
command-line parameter "-reverse":

\code
qmlviewer myapp.qml -reverse
\endcode

The layout direction can also be set from C++ by calling the static function \l QApplication::setLayoutDirection():

\code
QApplication app(argc, argv);
app.setLayoutDirection(Qt::RightToLeft);
\endcode

*/
4 changes: 2 additions & 2 deletions doc/src/declarative/whatsnew.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
\title What's new in Qt Quick
\page qtquick-whatsnew.html

\section1 Qt 4.7.3 includes QtQuick 1.1
\section1 Qt 4.7.4 includes QtQuick 1.1

QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new features.

\section2 PinchArea

PinchArea provides support for the common two finger pinch gesture.

\section2 LayoutMirroring
\section2 LayoutMirroring attached property

\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas.

Expand Down
52 changes: 42 additions & 10 deletions doc/src/examples/qml-examples.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -270,23 +270,55 @@
*/

/*!
\title Positioners: Adding and Removing Items Example
\example declarative/positioners/addandremove
\title Right-to-left User Interfaces: Text Alignment Example
\example declarative/righttoleft/textalignment

This example shows how to use the positioner elements such as \l Row, \l Column,
\l Grid and \l Flow, in particular how to add and remove items with appropriate transitions.
This example shows how the horizontal alignment of \l Text,
\l TextInput and \l TextEdit is affected by the reading direction
of the text and by the layout mirrroring. Click on the gray buttons
shown at the bottom of the example to toggle between different
horizontal alignment options.

\image qml-positioners-example.png
\sa {QML Right-to-left User Interfaces}
*/

/*!
\title Positioners: Layout Direction Example
\example declarative/positioners/layoutdirection
\title Right-to-left User Interfaces: Layout Direction Example
\example declarative/righttoleft/layoutdirection

This example shows how to control the horizontal layout direction of
\l Row, \l Grid and \l Flow positioners.
\l Row, \l Grid and \l Flow positioners, and \l ListView and \l GridView
model views. Click on the gray buttons shown at the bottom of the example
to toggle the layout direction of the shown elements.

\image qml-righttoleft-layoutdirection-example.png

\sa {QML Right-to-left User Interfaces}
*/


/*!
\title Right-to-left User Interfaces: Layout Mirroring Example
\example declarative/righttoleft/layoutmirroring

This example shows how to mirror the application layouts
using \l LayoutMirroring attached property. Click on the grey button
shown at the bottom of the example to enable or disable the
layout mirroring.

\image qml-positioners-layoutdirection-example.png
\image qml-righttoleft-layoutmirroring-example.png

\sa {QML Right-to-left User Interfaces}
*/

/*!
\title Positioners Example
\example declarative/positioners

This example shows how to use the positioner elements such as \l Row, \l Column,
\l Grid and \l Flow.

\image qml-positioners-example.png
*/

/*!
Expand Down Expand Up @@ -456,7 +488,7 @@


/*!
\title Screen orientation
\title Screen Orientation
\example declarative/screenorientation

This example shows how to implement screen orientation support for your application.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/src/snippets/declarative/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 13d4be0

Please sign in to comment.