lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
BarModelEditor.h
Go to the documentation of this file.
1
/*
2
* BarModelEditor.h - edit model values using a bar display
3
*
4
* Copyright (c) 2023-now Michael Gregorius
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
#pragma once
26
27
#ifndef LMMS_GUI_BAR_MODEL_EDITOR_H
28
#define LMMS_GUI_BAR_MODEL_EDITOR_H
29
30
#include "
FloatModelEditorBase.h
"
31
32
33
namespace
lmms::gui
34
{
35
36
class
LMMS_EXPORT
BarModelEditor
:
public
FloatModelEditorBase
37
{
38
Q_OBJECT
39
40
public
:
41
Q_PROPERTY(QBrush
backgroundBrush
READ
getBackgroundBrush
WRITE
setBackgroundBrush
)
42
Q_PROPERTY(QBrush
barBrush
READ
getBarBrush
WRITE
setBarBrush
)
43
Q_PROPERTY(QColor
textColor
READ
getTextColor
WRITE
setTextColor
)
44
45
BarModelEditor
(QString text,
FloatModel
* floatModel, QWidget * parent =
nullptr
);
46
47
// Define how the widget will behave in a layout
48
QSizePolicy
sizePolicy
() const;
49
50
QSize
minimumSizeHint
() const override;
51
52
QSize
sizeHint
() const override;
53
54
QBrush const &
getBackgroundBrush
() const;
55
void
setBackgroundBrush
(QBrush const &
backgroundBrush
);
56
57
QBrush const &
getBarBrush
() const;
58
void
setBarBrush
(QBrush const &
barBrush
);
59
60
QColor const &
getTextColor
() const;
61
void
setTextColor
(QColor const &
textColor
);
62
63
protected:
64
void
paintEvent
(QPaintEvent *event) override;
65
66
private:
67
QString const
m_text
;
68
69
QBrush
m_backgroundBrush
;
70
QBrush
m_barBrush
;
71
QColor
m_textColor
;
72
};
73
74
}
// namespace lmms::gui
75
76
#endif
// LMMS_GUI_BAR_MODEL_EDITOR_H
FloatModelEditorBase.h
lmms::FloatModel
Definition
AutomatableModel.h:468
lmms::gui::BarModelEditor::backgroundBrush
QBrush backgroundBrush
Definition
BarModelEditor.h:41
lmms::gui::BarModelEditor::BarModelEditor
BarModelEditor(QString text, FloatModel *floatModel, QWidget *parent=nullptr)
Definition
BarModelEditor.cpp:9
lmms::gui::BarModelEditor::textColor
QColor textColor
Definition
BarModelEditor.h:43
lmms::gui::BarModelEditor::sizeHint
QSize sizeHint() const override
Definition
BarModelEditor.cpp:30
lmms::gui::BarModelEditor::getBarBrush
QBrush const & getBarBrush() const
Definition
BarModelEditor.cpp:45
lmms::gui::BarModelEditor::setBarBrush
void setBarBrush(QBrush const &barBrush)
Definition
BarModelEditor.cpp:50
lmms::gui::BarModelEditor::m_textColor
QColor m_textColor
Definition
BarModelEditor.h:71
lmms::gui::BarModelEditor::setTextColor
void setTextColor(QColor const &textColor)
Definition
BarModelEditor.cpp:60
lmms::gui::BarModelEditor::m_barBrush
QBrush m_barBrush
Definition
BarModelEditor.h:70
lmms::gui::BarModelEditor::m_backgroundBrush
QBrush m_backgroundBrush
Definition
BarModelEditor.h:69
lmms::gui::BarModelEditor::barBrush
QBrush barBrush
Definition
BarModelEditor.h:42
lmms::gui::BarModelEditor::sizePolicy
QSizePolicy sizePolicy() const
Definition
BarModelEditor.cpp:19
lmms::gui::BarModelEditor::paintEvent
void paintEvent(QPaintEvent *event) override
Definition
BarModelEditor.cpp:65
lmms::gui::BarModelEditor::setBackgroundBrush
void setBackgroundBrush(QBrush const &backgroundBrush)
Definition
BarModelEditor.cpp:40
lmms::gui::BarModelEditor::getTextColor
QColor const & getTextColor() const
Definition
BarModelEditor.cpp:55
lmms::gui::BarModelEditor::getBackgroundBrush
QBrush const & getBackgroundBrush() const
Definition
BarModelEditor.cpp:35
lmms::gui::BarModelEditor::m_text
QString const m_text
Definition
BarModelEditor.h:67
lmms::gui::BarModelEditor::minimumSizeHint
QSize minimumSizeHint() const override
Definition
BarModelEditor.cpp:24
lmms::gui::FloatModelEditorBase::FloatModelEditorBase
FloatModelEditorBase(DirectionOfManipulation directionOfManipulation=DirectionOfManipulation::Vertical, QWidget *_parent=nullptr, const QString &_name=QString())
default ctor
Definition
FloatModelEditorBase.cpp:63
lmms::gui
Definition
AudioPortAudio.cpp:209
Generated on
for lmms by
1.18.0