LMMS
Loading...
Searching...
No Matches
SimpleTextFloat.h
Go to the documentation of this file.
1/*
2 * TextFloat.h - class textFloat, a floating text-label
3 *
4 * Copyright (c) 2023 LMMS team
5*
6* This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23*/
24
25
26#ifndef LMMS_GUI_SIMPLE_TEXT_FLOAT_H
27#define LMMS_GUI_SIMPLE_TEXT_FLOAT_H
28
29#include <QWidget>
30
31#include "lmms_export.h"
32
33class QLabel;
34class QTimer;
35
36namespace lmms::gui
37{
38
39class LMMS_EXPORT SimpleTextFloat : public QWidget
40{
41 Q_OBJECT
42public:
44 ~SimpleTextFloat() override = default;
45
46 void setText(const QString & text);
47
48 void showWithDelay(int msecBeforeDisplay, int msecDisplayTime);
49
50 void showWithTimeout(int msec)
51 {
52 showWithDelay(0, msec);
53 }
54
55 void moveGlobal(QWidget * w, const QPoint & offset)
56 {
57 move(w->mapToGlobal(QPoint(0, 0)) + offset);
58 }
59
60 void hide();
61
62private:
63 QLabel * m_textLabel;
64 QTimer * m_showTimer;
65 QTimer * m_hideTimer;
66};
67
68} // namespace lmms::gui
69
70#endif // LMMS_GUI_SIMPLE_TEXT_FLOAT_H
void setText(const QString &text)
Definition SimpleTextFloat.cpp:57
QTimer * m_hideTimer
Definition SimpleTextFloat.h:65
~SimpleTextFloat() override=default
SimpleTextFloat()
Definition SimpleTextFloat.cpp:38
void showWithDelay(int msecBeforeDisplay, int msecDisplayTime)
Definition SimpleTextFloat.cpp:62
void moveGlobal(QWidget *w, const QPoint &offset)
Definition SimpleTextFloat.h:55
void showWithTimeout(int msec)
Definition SimpleTextFloat.h:50
QLabel * m_textLabel
Definition SimpleTextFloat.h:63
QTimer * m_showTimer
Definition SimpleTextFloat.h:64
UINT_D64 w
Definition inflate.c:942
Definition AudioPortAudio.cpp:223
const char * text
Definition swell-functions.h:167