example: Added --blocks-close-event

Makes dock widget #0 reject the close event, meaning it won't close.

(cherry-picked from commit 21765efbac)
This commit is contained in:
Sergio Martins
2022-06-19 11:18:02 +01:00
parent f8b1745c68
commit 198bd60565
5 changed files with 36 additions and 4 deletions

View File

@@ -26,10 +26,16 @@ class MyWidget : public QWidget
public:
explicit MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget *parent = nullptr);
~MyWidget();
// These two are just for demonstrating how to block the close event, if desired
void blockCloseEvent();
void closeEvent(QCloseEvent *) override;
protected:
void drawLogo(QPainter &);
QImage m_background;
QImage m_logo;
bool m_blocksCloseEvent = false;
};
class MyWidget1 : public MyWidget