From 2296397643b3c16f2775943e1d710245fa408f5d Mon Sep 17 00:00:00 2001 From: Jari Jarvi Date: Wed, 19 May 2010 16:14:29 +0300 Subject: [PATCH] Transparent background. --- src/mainwidget.cpp | 13 ++++++++++++- src/mainwidget.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp index a1e9fbc..f445f3f 100644 --- a/src/mainwidget.cpp +++ b/src/mainwidget.cpp @@ -1,6 +1,7 @@ #include "mainwidget.h" -#include +#include +#include #include #include @@ -24,8 +25,18 @@ MainWidget::MainWidget (QWidget *parent) connect(buttons[5], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd5(bool))); this->setLayout(layout); + this->setAttribute(Qt::WA_TranslucentBackground); } + void MainWidget::paintEvent(QPaintEvent *event) + { + QPainter p(this); + p.setBrush(QColor(0, 0, 0, 128)); + p.setPen(Qt::NoPen); + p.drawRoundRect(rect(), 10, 20); + p.end(); + } + void MainWidget::showSettingsDialog() { bool isOk; diff --git a/src/mainwidget.h b/src/mainwidget.h index d52cde0..526299d 100644 --- a/src/mainwidget.h +++ b/src/mainwidget.h @@ -16,6 +16,9 @@ public: public slots: void showSettingsDialog(); + +protected: + void paintEvent(QPaintEvent *event); private: static const int BUTTON_COUNT = 6; -- 1.7.9.5