16 #include "Base/Util/Assert.h"
18 #include <QAbstractScrollArea>
25 const int xpos_offset = 40;
26 const int ypos_offset = 40;
32 , m_caution_header(
"Houston, we have a problem.")
33 , m_cautionWidget(nullptr)
35 , m_clear_just_had_happened(false)
82 m_area->installEventFilter(
this);
92 if (event->type() == QEvent::Resize)
95 return QObject::eventFilter(obj, event);
111 int x =
m_area->width() - xpos_offset;
112 int y =
m_area->height() - ypos_offset;
114 if (
auto* scrollArea =
dynamic_cast<QAbstractScrollArea*
>(
m_area)) {
115 if (QScrollBar* horizontal = scrollArea->horizontalScrollBar()) {
116 if (horizontal->isVisible())
117 y -= horizontal->height();
120 if (QScrollBar* vertical = scrollArea->verticalScrollBar()) {
121 if (vertical->isVisible())
122 x -= vertical->width();
Defines class CautionSign.
bool eventFilter(QObject *obj, QEvent *event) override
void updateLabelGeometry()
CautionSign(QWidget *parent)
void setCautionHeader(const QString &cautionHeader)
QString m_caution_message
CautionSignWidget * m_cautionWidget
void setArea(QWidget *area)
void clear()
Clears caution message;.
QPoint positionForCautionSign() const
bool m_clear_just_had_happened
void setCautionMessage(const QString &cautionMessage)
Shows caution sign on the screen. If clear of previous caution sign had happened just few msec ago,...