From 4f5c8beacf96885e6623ab8cd23e55d559ce57c3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 8 Mar 2017 16:18:35 +0100 Subject: Bring window to top periodically --- src/widget.cpp | 11 ++++++++++- src/widget.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/widget.cpp b/src/widget.cpp index 02e3b20..3e23385 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -204,12 +204,16 @@ Widget::Widget(QWidget *parent) : _ui->comboBox->setCurrentIndex(index); // Remove borders and stuff - setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); + setWindowFlags(Qt::Widget | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); //setStyleSheet("background:transparent;"); //setAttribute(Qt::WA_TranslucentBackground); // Resize widget to its content resize(sizeHint()); + show(); + QTimer *timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(bringToTopTimer())); + timer->start(1000); // Center dialog on screenbottom const QRect desktopRect = QApplication::desktop()->screenGeometry(); @@ -238,6 +242,11 @@ Widget::Widget(QWidget *parent) : /*************************************************************************/ } +void Widget::bringToTopTimer() +{ + raise(); +} + //______________________________________________________________________________ void Widget::updateScreenResources() { diff --git a/src/widget.h b/src/widget.h index 31b9a95..4d0df14 100644 --- a/src/widget.h +++ b/src/widget.h @@ -39,6 +39,7 @@ public: private slots: void handleButton(); + void bringToTopTimer(); private: void timeout(); -- cgit v1.2.3-55-g7522