QSignalBlocker: (new) RAII class for QObject::blockSignals()

I don't think I ever worked on a project of non-trivial
size that didn't at some point add a QSignalBlocker.

This commit adds code, tests and documentation. Later
commits will convert naked blockSignals() calls to use
QSignalBlocker.

The implementation is purely inline to avoid the heavy
overhead of cross-dll function calls for this miniscule
task. This should not be a problem because QSignalBlocker
only uses public API and a pattern that we anyway need
to keep working until Qt 6, at least, so even changing
the implementation later will be no problem as the old
implementation lurking in non-recompiled code will be
acceptable, too.

This implementation is an evolution from KDTools'
KDSignalBlocker, with the following changes:
- Implements unblock() and reblock()
- Uses the return value of blockSignals() instead of a
  separate signalsBlocked() call.

Change-Id: I1933dfd72a0f5190324be377cfca3c54cf3d6828
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QItemSelectionModel: use QSignalBlocker

Change-Id: Ib88db7516fd7dd8f10a86444c506f3294948e79b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QColorDialog: use QSignalBlocker

Change-Id: Id680d9b934760cdd6a20579518199bd388b56e5d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QFileDialog: use QSignalBlocker

Change-Id: I32a631493138a777458557232da084f497adc526
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QFontDialog: use QSignalBlocker

Change-Id: I7be3ac4a7e6988d768e1db68f10a6920aa825a76
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QAbstractSpinBox: use QSignalBlocker

This change changes the point where signals are unblocked again in
QAbstractSpinBoxPrivate::updateEdit() to include the final update()
call. This should not be a problem, as update() merely posts an
event and shouldn't emit any signals.

Change-Id: I4b2ae109f057792b573ad6ea168ca77c18c773d0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QDateTimeEdit: use QSignalBlocker

Change-Id: I4983e96a51220f40644d202d76e92a889ae9431a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QDockAreaLayout: use QSignalBlocker

This change changes the point where signals are unblocked again in
QDockAreaLayoutInfo::updateTabBar() to include the final tabBar->count()
call. This should not be a problem, as count() is a const function and
thus shouldn't emit any signals.

Change-Id: I6f3dc5696a9c31db51fbe4cdee4b9d83ddeaf61f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QMdiArea: use QSignalBlocker

Change-Id: I54bb64531b1b9639bec163a96baae67b9cabd16b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QTabWidget: use QSignalBlocker

Change-Id: I4621e6b504c531903210242cf0f1cf12e7538784
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QPrintPreviewWidget: use QSignalBlocker

Change-Id: Ic2d48c8e2c9c3c6f06e67ebf7e12bd4899b421aa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QInputDialog: use QSignalBlocker

Change-Id: I711dbc0c35bc51ad3149e3d7b41e716bc9ab94b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QTreeWidget: use QSignalBlocker

Change-Id: I0b69cd5680dfae6349bd4a952f358fe0b4acb2ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QFontComboBox: use QSignalBlocker

Change-Id: I6a9eab39088275427e4282ee590fda439b2f2901
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QMenu: use QSignalBlocker

Change-Id: I41006d2b6f1454382b8c0bede20999d882b66f26
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QPlainTextEdit: use QSignalBlocker

Change-Id: I581e60c4efd985fb909614459229806185f9501c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>