summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-03-08 16:18:35 +0100
committerSimon Rettberg2017-03-08 16:18:35 +0100
commit4f5c8beacf96885e6623ab8cd23e55d559ce57c3 (patch)
tree78e51fdc602931b95b99d72d700cee5c945aac9b
parentStupid mistake in formula for diagonal calculation... (diff)
downloadbeamergui-4f5c8beacf96885e6623ab8cd23e55d559ce57c3.tar.gz
beamergui-4f5c8beacf96885e6623ab8cd23e55d559ce57c3.tar.xz
beamergui-4f5c8beacf96885e6623ab8cd23e55d559ce57c3.zip
Bring window to top periodically
-rw-r--r--src/widget.cpp11
-rw-r--r--src/widget.h1
2 files changed, 11 insertions, 1 deletions
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();