lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
ComboBox.h
Go to the documentation of this file.
1
/*
2
* ComboBox.h - class ComboBox, a combo box view for models
3
*
4
* Copyright (c) 2006-2014 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_COMBOBOX_H
26
#define LMMS_GUI_COMBOBOX_H
27
28
#include <QMenu>
29
#include <QWidget>
30
31
#include "
ComboBoxModel.h
"
32
#include "
AutomatableModelView.h
"
33
34
namespace
lmms::gui
35
{
36
37
class
LMMS_EXPORT
ComboBox
:
public
QWidget,
public
IntModelView
38
{
39
Q_OBJECT
40
public
:
41
ComboBox
( QWidget* parent =
nullptr
,
const
QString& name = QString() );
42
~ComboBox
()
override
=
default
;
43
44
ComboBoxModel
*
model
()
45
{
46
return
castModel<ComboBoxModel>
();
47
}
48
49
const
ComboBoxModel
*
model
()
const
50
{
51
return
castModel<ComboBoxModel>
();
52
}
53
54
static
constexpr
int
DEFAULT_HEIGHT
= 22;
55
56
public
slots:
57
void
selectNext
();
58
void
selectPrevious
();
59
60
61
protected
:
62
void
contextMenuEvent
( QContextMenuEvent* event )
override
;
63
void
mousePressEvent
( QMouseEvent* event )
override
;
64
void
paintEvent
( QPaintEvent* event )
override
;
65
void
wheelEvent
( QWheelEvent* event )
override
;
66
67
68
private
:
69
QPixmap
m_background
=
embed::getIconPixmap
(
"combobox_bg"
);
70
QPixmap
m_arrow
=
embed::getIconPixmap
(
"combobox_arrow"
);
71
QPixmap
m_arrowSelected
=
embed::getIconPixmap
(
"combobox_arrow_selected"
);
72
73
QMenu
m_menu
;
74
75
bool
m_pressed
;
76
77
78
private
slots:
79
void
setItem
( QAction* item );
80
81
} ;
82
83
}
// namespace lmms::gui
84
85
#endif
// LMMS_GUI_COMBOBOX_H
AutomatableModelView.h
ComboBoxModel.h
lmms::ComboBoxModel
Definition
ComboBoxModel.h:39
lmms::gui::ComboBox::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Definition
ComboBox.cpp:96
lmms::gui::ComboBox::~ComboBox
~ComboBox() override=default
lmms::gui::ComboBox::selectPrevious
void selectPrevious()
Definition
ComboBox.cpp:73
lmms::gui::ComboBox::m_menu
QMenu m_menu
Definition
ComboBox.h:73
lmms::gui::ComboBox::model
ComboBoxModel * model()
Definition
ComboBox.h:44
lmms::gui::ComboBox::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event) override
Definition
ComboBox.cpp:80
lmms::gui::ComboBox::m_background
QPixmap m_background
Definition
ComboBox.h:69
lmms::gui::ComboBox::DEFAULT_HEIGHT
static constexpr int DEFAULT_HEIGHT
Definition
ComboBox.h:54
lmms::gui::ComboBox::wheelEvent
void wheelEvent(QWheelEvent *event) override
Definition
ComboBox.cpp:211
lmms::gui::ComboBox::m_arrowSelected
QPixmap m_arrowSelected
Definition
ComboBox.h:71
lmms::gui::ComboBox::ComboBox
ComboBox(QWidget *parent=nullptr, const QString &name=QString())
Definition
ComboBox.cpp:43
lmms::gui::ComboBox::m_arrow
QPixmap m_arrow
Definition
ComboBox.h:70
lmms::gui::ComboBox::model
const ComboBoxModel * model() const
Definition
ComboBox.h:49
lmms::gui::ComboBox::m_pressed
bool m_pressed
Definition
ComboBox.h:75
lmms::gui::ComboBox::setItem
void setItem(QAction *item)
Definition
ComboBox.cpp:225
lmms::gui::ComboBox::selectNext
void selectNext()
Definition
ComboBox.cpp:65
lmms::gui::ComboBox::paintEvent
void paintEvent(QPaintEvent *event) override
Definition
ComboBox.cpp:155
lmms::gui::ModelView::castModel
T * castModel()
Definition
ModelView.h:54
lmms::embed::getIconPixmap
auto getIconPixmap(std::string_view name, int width, int height, const char *const *xpm) -> QPixmap
Return an image for the icon pixmap cache.
Definition
embed.cpp:107
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms::gui::IntModelView
TypedModelView< IntModel > IntModelView
Definition
AutomatableModelView.h:132
Generated on
for lmms by
1.18.0