hydrogen 1.2.3
InfoBar.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef INFOBAR_H
24#define INFOBAR_H
25
26#include <QWidget>
27#include <vector>
29#include <core/Object.h>
30
31class QHBoxLayout;
32class QLabel;
33class QPushButton;
34
36class InfoBar : public QWidget, public H2Core::Object<InfoBar>
37{
39 Q_OBJECT
40
41 QHBoxLayout *m_pLayout;
42 QLabel *m_pLabel;
43
44 QString m_sTitle;
45 QString m_sText;
46
47 std::vector<QPushButton *> m_buttons;
48
49 public:
50 InfoBar(QWidget *parent = Q_NULLPTR);
51 void setTitle(const QString &text);
52 void setText(const QString &text);
53 QPushButton *addButton( const QString &label );
54 void reset();
55
56public slots:
58
59
60 private:
61 void updateStyleSheet();
62 void createLayout();
63 void createIcon();
64 void createLabel();
65 void createCloseButton();
66 void updateText();
67};
68
69#endif
#define H2_OBJECT(name)
Definition Object.h:224
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
void setText(const QString &text)
Definition InfoBar.cpp:109
void createIcon()
Definition InfoBar.cpp:70
QString m_sText
Definition InfoBar.h:45
void updateText()
Definition InfoBar.cpp:116
InfoBar(QWidget *parent=Q_NULLPTR)
Definition InfoBar.cpp:35
void onPreferencesChanged(H2Core::Preferences::Changes changes)
Definition InfoBar.cpp:56
void createCloseButton()
Definition InfoBar.cpp:90
QHBoxLayout * m_pLayout
Definition InfoBar.h:41
void updateStyleSheet()
Definition InfoBar.cpp:50
QString m_sTitle
Definition InfoBar.h:44
QPushButton * addButton(const QString &label)
Definition InfoBar.cpp:123
std::vector< QPushButton * > m_buttons
Definition InfoBar.h:47
QLabel * m_pLabel
Definition InfoBar.h:42
void createLayout()
Definition InfoBar.cpp:62
void reset()
Definition InfoBar.cpp:133
void setTitle(const QString &text)
Definition InfoBar.cpp:102
void createLabel()
Definition InfoBar.cpp:78