Prevent crash when moving elements of a ListView's ListModel.

QDeclarativeListView::itemsMoved wasn't checking if its list of visible
items was empty before accessing its first element.

Task-number: QTBUG-26836
Change-Id: I5ed42889a55026f19e44e44d14080a61fff63b59
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Prevent recursions when triggering menus in QToolButton

With a global shortcut set it would be possible
to let the button re-open the menu again and again,
each time spinning an event loop.

Backport of f5ea183cc6a6cd66fb3f804041fc112687e0a060 from qtbase

Task-number: QTBUG-30399
Change-Id: If7eddc115c77fef3df3e751fd72e7414cedaf272
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>