#include "alarmwidget.h" AlarmWidget::AlarmWidget(QWidget *parent) : QDialog(parent) { mainLayout = new QVBoxLayout; mainLayout->addWidget(new QLabel(tr("TEST"))); setLayout(mainLayout); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_TranslucentBackground, true); timer.start(500, this); } AlarmWidget::~AlarmWidget() { } void AlarmWidget::addAlarmMessage(QString &message, uint seconds) { uint time = QDateTime::currentDateTime().toTime_t(); AlarmItem item = { seconds = time + seconds, message = message }; items.append(item); } void AlarmWidget::timerEvent(QTimerEvent *) { repaint(); } void AlarmWidget::paintEvent(QPaintEvent *) { QPainter painter(this); painter.drawText(10, 10, "TEST String"); }