LMMS
Loading...
Searching...
No Matches
TextFloat.h
Go to the documentation of this file.
1/*
2 * TextFloat.h - class textFloat, a floating text-label
3 *
4 * Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
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_TEXT_FLOAT_H
26#define LMMS_GUI_TEXT_FLOAT_H
27
28#include <QWidget>
29
30#include "lmms_export.h"
31
32class QLabel;
33
34namespace lmms::gui
35{
36
37class LMMS_EXPORT TextFloat : public QWidget
38{
39 Q_OBJECT
40public:
41 TextFloat();
42 ~TextFloat() override = default;
43
44 void setTitle(const QString & title);
45 void setText(const QString & text);
46 void setPixmap(const QPixmap & pixmap);
47
48 void setVisibilityTimeOut(int msecs);
49
50 static TextFloat * displayMessage(const QString & title,
51 const QString & msg,
52 const QPixmap & pixmap = QPixmap(),
53 int timeout = 2000,
54 QWidget * parent = nullptr);
55
56 void moveGlobal(QWidget * w, const QPoint & offset)
57 {
58 move(w->mapToGlobal(QPoint(0, 0)) + offset);
59 }
60
61
62protected:
63 void mousePressEvent(QMouseEvent * me) override;
64
65
66private:
67 TextFloat(const QString & title, const QString & text, const QPixmap & pixmap);
68
69 QLabel * m_pixmapLabel;
70 QLabel * m_titleLabel;
71 QLabel * m_textLabel;
72
73};
74
75
76} // namespace lmms::gui
77
78#endif // LMMS_GUI_TEXT_FLOAT_H
Definition TextFloat.h:38
void setTitle(const QString &title)
Definition TextFloat.cpp:74
void setText(const QString &text)
Definition TextFloat.cpp:80
QLabel * m_textLabel
Definition TextFloat.h:71
~TextFloat() override=default
TextFloat()
Definition TextFloat.cpp:39
void setPixmap(const QPixmap &pixmap)
Definition TextFloat.cpp:86
void moveGlobal(QWidget *w, const QPoint &offset)
Definition TextFloat.h:56
void setVisibilityTimeOut(int msecs)
Definition TextFloat.cpp:92
static TextFloat * displayMessage(const QString &title, const QString &msg, const QPixmap &pixmap=QPixmap(), int timeout=2000, QWidget *parent=nullptr)
Definition TextFloat.cpp:98
QLabel * m_titleLabel
Definition TextFloat.h:70
QLabel * m_pixmapLabel
Definition TextFloat.h:69
UINT_D64 w
Definition inflate.c:942
static const char * title
Definition pugl.h:1747
static double timeout
Definition pugl.h:1799
static uintptr_t parent
Definition pugl.h:1644
const char * msg
Definition missing_descriptor.c:20
Definition AudioPortAudio.cpp:223
const char * text
Definition swell-functions.h:167