========================================================================
The NotificationBox is extended to take the QRect in global coordinates. Then
it will try to dimension the label within this area. If a fixed width is provided, that
is enforced (take precedence).
The NotificationArea passes the QRect of the main window to the NotificationBox.
This is intended to fix:
https://github.com/FreeCAD/FreeCAD/issues/8940
======================
QToolTip removed the Windows specific behaviour of passing a screen widget as parent for QLabel
in 44fb925f50471ebc23dcccfaa4e9d9873b05d205. NotificationBox code is simplified not to use a
parent widget at all.
A inappropriate review fix actually causing a bug is fixed.
https://github.com/FreeCAD/FreeCAD/pull/8352#discussion_r1111342024
=====================================
Changes consquence of the review by OpenBrain:
- Use smart pointer for NotificationLabel (QT deleteLater compatible)
- Consistent use of measurement units in parameter naming.
- Consistent wording of code documentation.
- Improvements in branching of QTootTip based code.
- Remove redundant stop on singleshot qtimer.
- Improved filtering of click events.
======================================================================
In short, a "tooltip" alike notification, where the user can continue working without having
to interact with the notification. If the user is interested in the notification, he or she can
stop to read it. If not interested, the user can ignore it and continue working. The notification
will automatically disappear when the timer lapses or before that time, as described below.
A new widget similar to QToolTip, to have a similar look and feel
and interface, while avoiding early closing on user action.
QToolTip is not intended for notifications, but to provide contextual help. While
QToolTip could have been used for part of the functionality (by filtering out events),
other parts required additional changes to the interface
Gui::NotificationBox is a reimplementation intended to provide user notifications. It
relies on the proven code of QToolTip for the wanted behaviour.
Additional functionality:
- A notification box has a minimum time for which it won't close, unless popped out (click inside
the notification).
- After the minimum time, if left mouse button is clicked (anywhere) it auto-closes, as it is
understood the user has continued working.
- After a maximum time, it will automatically close (even in nothing is clicked).