-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverlaywidgetclass.h
46 lines (38 loc) · 1.13 KB
/
overlaywidgetclass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef OVERLAYWIDGETCLASS_H
#define OVERLAYWIDGETCLASS_H
/* This overlay class does not work because of a known limitation whereby the graphics window is always on top of the stack. May work later in the future.
*
* */
#include <QtGui>
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QtWidgets>
#endif
class OverlayWidget : public QWidget {
void newParent();
public:
explicit OverlayWidget(QWidget *parent = {});
protected:
//! Catches resize and child events from the parent widget
bool eventFilter(QObject *obj, QEvent *ev) override;
//! Tracks parent widget changes
bool event(QEvent *ev) override;
};
class ContainerWidget : public QWidget
{
public:
explicit ContainerWidget(QWidget *parent = {});
void setSize(QObject *obj) ;
protected:
//! Resizes children to fill the extent of this widget
bool event(QEvent *ev) override;
//! Keeps the children appropriately sized
void resizeEvent(QResizeEvent *) override;
};
class CrossHairOverlay : public OverlayWidget
{
public:
CrossHairOverlay(QWidget *parent = {});
protected:
void paintEvent(QPaintEvent *) override;
};
#endif // OVERLAYWIDGETCLASS_H