Dialogs: if implicitHeight becomes smaller, ensure the minimum does too

Initial implicitHeight of the content can be wrong, but after showing
the window, there's still a chance to get it right, for example to
avoid showing MessageDialog larger than it needs to be.

Task-number: QTBUG-41734
Change-Id: Ib6db8d0ebe4a3d29bfc6bc36c46caba6955a2294
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Dialogs: added private maximumDimension property for initial size

The Screen.attached property does not know which screen will be used
until the dialog is shown, but we need to know how big the desktop is
before it is shown in order to constrain a reasonable dialog size,
before the Flow lays out the buttons.  Otherwise it will be too tall.

Task-number: QTBUG-41734
Change-Id: I44349fab4ad0254d2c6faf30c759fb9e52eebf03
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Custom filled dialog example: handle back button to close

On Android, it should prefer to close the dialog rather than get stuck
or exit the application.  (It was already possible to close the dialog
by tapping outside, though.)  The back button can also be used on
other platforms which have them (e.g. multimedia keyboards on desktop).

Change-Id: I19d2ad62ff370fa467d80d51d73cb95fd5830bed
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
qquickrangemodel: don't emit signals before component is completed

Otherwise, when the app handles the signal, it might try to access
other items that has not yet been constructed.

Change-Id: I63e212e8dd10798d8c9c4c6b974eb903e564ffca
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>