lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
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
#ifndef LMMS_GUI_SIMPLE_TEXT_FLOAT_H
26
#define LMMS_GUI_SIMPLE_TEXT_FLOAT_H
27
28
#include <QWidget>
29
30
#include "lmms_export.h"
31
32
class
QLabel;
33
class
QTimer;
34
35
namespace
lmms::gui
36
{
37
38
class
LMMS_EXPORT
SimpleTextFloat
:
public
QWidget
39
{
40
Q_OBJECT
41
public
:
42
SimpleTextFloat
();
43
~SimpleTextFloat
()
override
=
default
;
44
45
void
setText
(
const
QString & text);
46
47
void
showWithDelay
(
int
msecBeforeDisplay,
int
msecDisplayTime);
48
49
void
showWithTimeout
(
int
msec)
50
{
51
showWithDelay
(0, msec);
52
}
53
54
void
moveGlobal
(QWidget * w,
const
QPoint & offset)
55
{
56
move(w->mapToGlobal(QPoint(0, 0)) + offset);
57
}
58
59
void
show();
60
void
hide();
61
63
const
QObject*
source
()
const
{
return
m_source
; }
64
66
void
setSource
(
const
QObject*
source
) {
m_source
=
source
; }
67
68
private
:
69
QLabel *
m_textLabel
;
70
QTimer *
m_showTimer
;
71
QTimer *
m_hideTimer
;
72
74
const
QObject*
m_source
=
nullptr
;
75
};
76
77
}
// namespace lmms::gui
78
79
#endif
// LMMS_GUI_SIMPLE_TEXT_FLOAT_H
lmms::gui::SimpleTextFloat::setText
void setText(const QString &text)
Definition
SimpleTextFloat.cpp:57
lmms::gui::SimpleTextFloat::m_hideTimer
QTimer * m_hideTimer
Definition
SimpleTextFloat.h:71
lmms::gui::SimpleTextFloat::setSource
void setSource(const QObject *source)
Sets which object is currently controlling this text float.
Definition
SimpleTextFloat.h:66
lmms::gui::SimpleTextFloat::source
const QObject * source() const
Definition
SimpleTextFloat.h:63
lmms::gui::SimpleTextFloat::~SimpleTextFloat
~SimpleTextFloat() override=default
lmms::gui::SimpleTextFloat::SimpleTextFloat
SimpleTextFloat()
Definition
SimpleTextFloat.cpp:38
lmms::gui::SimpleTextFloat::m_source
const QObject * m_source
Which object is currently controlling this text float.
Definition
SimpleTextFloat.h:74
lmms::gui::SimpleTextFloat::showWithDelay
void showWithDelay(int msecBeforeDisplay, int msecDisplayTime)
Definition
SimpleTextFloat.cpp:62
lmms::gui::SimpleTextFloat::moveGlobal
void moveGlobal(QWidget *w, const QPoint &offset)
Definition
SimpleTextFloat.h:54
lmms::gui::SimpleTextFloat::showWithTimeout
void showWithTimeout(int msec)
Definition
SimpleTextFloat.h:49
lmms::gui::SimpleTextFloat::m_textLabel
QLabel * m_textLabel
Definition
SimpleTextFloat.h:69
lmms::gui::SimpleTextFloat::m_showTimer
QTimer * m_showTimer
Definition
SimpleTextFloat.h:70
lmms::gui
Definition
AudioPortAudio.cpp:209
Generated on
for lmms by
1.18.0