-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.cpp
41 lines (31 loc) · 919 Bytes
/
circle.cpp
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
#include "circle.h"
Circle::Circle(QWidget *parent)
: QDialog{parent}
{
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlag(Qt::WindowTransparentForInput);
setAttribute(Qt::WA_TransparentForMouseEvents);
// setWindowFlag(Qt::FramelessWindowHint);
QTimer::singleShot(5000, this, SLOT(close()));
adjustSize();
}
void Circle::paintEvent(QPaintEvent* e)
{
int x = 40;
int y = 30;
int radius = 20;
QPainter circlePainter(this);
circlePainter.setRenderHint(QPainter::Antialiasing, true);
QPen circlePen;
circlePen.setColor(Qt::green);
circlePen.setWidth(3);
circlePainter.setPen(circlePen);
circlePainter.drawEllipse(QPointF(x,y), radius, radius);
Q_UNUSED(e);
}
void Circle::closeEvent(QCloseEvent *e)
{ qDebug() << "closing circular marker" ;
QWidget::setWindowState(Qt::WindowMinimized);
QWidget::close();
Q_UNUSED(e);
}