From 6a72f2f15c9f39b2a851b955b9b87abede8d0257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 9 Nov 2020 22:12:41 +0100 Subject: initial work --- labb4/qresetbutton.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 labb4/qresetbutton.cpp (limited to 'labb4/qresetbutton.cpp') diff --git a/labb4/qresetbutton.cpp b/labb4/qresetbutton.cpp new file mode 100644 index 0000000..8eef506 --- /dev/null +++ b/labb4/qresetbutton.cpp @@ -0,0 +1,18 @@ +/** + * TDDD86 Robots + * This file contains the implementation of the QResetButton class. + */ + +#include "qresetbutton.h" + +QResetButton::QResetButton( QWidget* parent) : QLabel(parent) { + setText("Try again!"); + setAlignment(Qt::AlignCenter); + setStyleSheet("QResetButton { background-color: rgb(143,122,102); border-radius: 10px; font: bold; color: white; }"); +} + +void QResetButton::mousePressEvent(QMouseEvent* event) { + if (event) { + emit clicked(); + } +} -- cgit v1.2.1