drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
keylabel.h
Go to the documentation of this file.
1/*
2 Virtual Piano Widget for Qt
3 Copyright (C) 2008-2023, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef KEYLABEL_H
20#define KEYLABEL_H
21
22#include <QGraphicsTextItem>
24
30namespace drumstick {
31namespace widgets {
32
33class KeyLabel : public QGraphicsTextItem
34{
35public:
36 explicit KeyLabel(QGraphicsItem *parent = nullptr);
37 virtual ~KeyLabel() = default;
38 void setPlainText(const QString& text);
39 void adjust();
40 void setOrientation(LabelOrientation ori);
41 void restoreColor();
42 void setHtml(const QString& text);
43
44private:
46 void calculateRotation();
47
48 QColor m_savedColor;
49};
50
51}} // namespace drumstick::widgets
52
53#endif // KEYLABEL_H
LabelOrientation
Labels Orientation.
Definition: pianokeybd.h:141
@ HorizontalOrientation
Show horizontal names.
Definition: pianokeybd.h:142
Drumstick common.
Definition: alsaclient.cpp:68
Piano Keyboard Widget.