QtQuick.Dialogs FileDialog: default mode is ExistingFile

Previously did not sync the mode with the state of the selectExisting
property on construction.
(cherry-picked from qtdeclarative/fa5db4201945565bd2c5ff42ab233f497666003f)

Task-number: QTBUG-35877
Change-Id: Ifb630fb51c463025ec2f6a1932714f354552c234
Reviewed-by: Liang Qi <liang.qi@digia.com>
Dialog: do not emit signals twice when a button is clicked

buttonClicked() is public API, whereas click(button, role) is called
when a button is clicked.  So there is no need to have buttonClicked()
connect to anything internally.

Task-number: QTBUG-40613
Change-Id: I25872d532ba77b4d708a2c25b31b6064fd5da599
Reviewed-by: Liang Qi <liang.qi@digia.com>
Dialogs: buttonless fully-filled dialog example

The default property "contentItem" is normally the parent of the
added content, but you can set the content directly into the property
to avoid having any buttons or margins.

Task-number: QTBUG-38056
Change-Id: Ie0e96969b3e35f079b29a9f3f57eaaf16236d4c1
Reviewed-by: Liang Qi <liang.qi@digia.com>
Dialog: initialize enabled and clicked buttons

When the dialog becomes visible, no button has been clicked yet: we
are waiting for the user to do that.  Failure to initialize
m_clickedButton made the logic in accept() and reject() unreliable:
accept() does not imply OK unless we are sure the user did not click
any other button, and the same with reject() implying Cancel.

Change-Id: I340c18bd0fca6cc9a7274c1063882de425444326
Reviewed-by: Liang Qi <liang.qi@digia.com>
Update license headers and add new license files

- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I470909ba0980db33ab551790d619c59a35978590
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Dialogs must know when they are closed by the operating system

The dialog cannot be opened again if it does not know that it was
closed.  So whenever there is a native window, the visibleChanged signal
must be connected.

Task-number: QTBUG-40855
Change-Id: I0726b7568937a19deba067d43ce72b0579f7c4c5
Reviewed-by: Liang Qi <liang.qi@digia.com>
Merge remote-tracking branch 'origin/5.3' into 5.4

Change-Id: I4aa5c960a03616d95f9e1d10b4c8ba222997a24d
Bump version

Change-Id: I8c96a7ae4ade4be6e230a8e542d68644d4c945d1
FileDialog: add documentation about the use of Settings

Since the introduction of the sidebar, DefaultFileDialog.qml has used
Qt.labs.settings to store user-adjustable state.  It's important to
note that applications should control the location of these settings
by setting the name, organization and domain.

Change-Id: Ia5dd5ce5d172c345738b48b41e945d834cc143a5
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Do not crash when removing children from hidden layouts

The problem was that the proxy items (QQuickGridLayoutItem) that was
added to the layout was not removed when a child item got deleted from
a hidden layout. The proxy item therefore ended up having a dangling
pointer to the deleted item.

The solution is to also update the layout with a new list of items
even when the layout is hidden. This will also fix a problem with that
size hints was not correct when layouts were hidden.

Note that the test included has an expected failure. This is because
the case it tests is not very common and the problem is shared with
positioners. The problem stems from the fact that a layouts implicit
size should change when a child item is changed from implicitly hidden
to explicitly hidden. Unfortuntately, QQuickItem does not notify about
such changes.

This is a problem independent of this crash patch fix, and I would like
to address that in a separate commit.

Change-Id: I67ac28b9d08208432559622c9cd412e24b197b32
Task-number: QTBUG-39045
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Dialogs: correct C++ warnings

Initialization order, and mistaken use of comparison instead of
assignment.

Change-Id: Ic9fbcac1085d84294386311f967209a6b33f2297
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
FileDialog: tweak initial splitter positions

In Component.onCompleted, shortcutsView.model.count is undefined, so
the height of the shortcuts area was dictated by its minimum.  Further,
the ListView removes delegates before they are completely "below the
fold", so at a height of 2.5 rows, you see only two rows.  The
intention is to have the lowest item that you initially see
be visually cut off, as a hint that there are more items.
The sidebar was also too narrow by default on screens that have space
for it, so the default width is increased (but as before, the user's
preferred location for the splitter is saved to settings and restored
each time).

Change-Id: I74dc924254f0c87e6200c3fff6af900ff28b5b6a
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
FileDialog: add sidebarVisible property and button

The sidebar takes up too much space on some devices, so now it is
possible for the application author to hide it by default.  The user
can also toggle it with a button similar to that used for the
Qt Creator sidebar, and this state is stored as a setting; however
if the application sets sidebarVisible: false, that overrides the setting.

[ChangeLog][QtQuick.Dialogs] FileDialog: added sidebarVisible property
and button

Task-number: QTBUG-39231
Change-Id: Ie8b379da02f4b12764732b2c01b79039722778ab
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
FileDialog: use icon font instead of PNG images

The purpose is to make all icons scaleable so that there is no need
for multiple resolutions.

Change-Id: I535c569a10e0f97a81763fa334ed103ba7745907
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Revert "TextField/Area: soft dependency to inputMethodHints"

This broke the input method hints handling altogether. We will
fix this properly in QtQuickTextInput and QQuickTextEdit instead.
Nobody has even complained about QT_NO_IM, it was a hypothetical
problem brought up in code reviews.

This reverts commit c185d6cd67653b34f04a7999a84634de1f1063b0.

Change-Id: Ib81adba1ee899dd2a384bd83eea82d629eacb333
Reviewed-by: Samuel Nevala <samuel.nevala@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Generate .tags file

Task-number: QTBUG-40551
Change-Id: I79c5aa34e2125d44bb33499580441bddaa266817
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Dialogs: add qsTr() wrappers to all QML strings for translation

Change-Id: If5304902f7167df56266542969723481477a7ba9
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Fix menu/combobox popup positioning

Task-number: QTBUG-41113
Change-Id: Ic55657d42b44950356b176334d826b0a8d16e3cd
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Doc: .*Style attachment correction

The .*Style is attached to the control not the other way around.

Change-Id: Ia9158463d86881997e917c26427cb62beb8e5edc
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
TextHandle: fix mapping of touch position to handle position

Regardless of where the user drags on the mouse area (which
can be big for the user to hit it), you should continue dragging
on the selection where it is, not jump the location under the finger.

This patch will change offset to be the distance from the text position
under the handle to the touch point, so regardless where the user
touches the handle, the selection will not jump when the drag starts.

Change-Id: I849e42c5e94f44aec355224a9db146bcdf22d43f
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>