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 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/widget.cpp') 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() { -- cgit v1.2.3-55-g7522