From be7f32353d736ff1dc1f74ae80e301ce72044dee Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 25 Mar 2017 09:01:41 +0100 Subject: Show Popup-Window on various occasions When we play a new song, get paused, continue and change volume. The hardest part was to display the QWidget on the current desktop. Turns out KWindowSystem and Qt::ToolWindow don't work together well... I should post that on my blog, I guess... --- toolwindow.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 toolwindow.h (limited to 'toolwindow.h') diff --git a/toolwindow.h b/toolwindow.h new file mode 100644 index 0000000..7f8e621 --- /dev/null +++ b/toolwindow.h @@ -0,0 +1,24 @@ +#ifndef TOOLWINDOW_H +#define TOOLWINDOW_H + +#include + +class QLabel; +class QTimer; + +class ToolWindow : public QWidget { + Q_OBJECT + public: + explicit ToolWindow(QWidget *parent = 0, Qt::WindowFlags f = Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus); + + public slots: + void setText(const QString &text); + void toHTML(const QString &text); + void showMe(); + + private: + QLabel *mLabel; + QTimer *mHideTimer; +}; + +#endif // TOOLWINDOW_H -- cgit v1.2.3-70-g09d2