lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Draggable.h
Go to the documentation of this file.
1
/*
2
* Draggable.h
3
*
4
* Copyright (c) 2025 Lost Robot <r94231/at/gmail/dot/com>
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_DRAGGABLE_H
26
#define LMMS_GUI_DRAGGABLE_H
27
28
#include "
FloatModelEditorBase.h
"
29
30
namespace
lmms::gui
31
{
32
36
class
LMMS_EXPORT
Draggable
:
public
FloatModelEditorBase
37
{
38
Q_OBJECT
39
40
public
:
41
using
FloatModelEditorBase::DirectionOfManipulation
;
42
51
Draggable
(
DirectionOfManipulation
directionOfManipulation
,
52
FloatModel
* floatModel,
const
QPixmap& pixmap,
int
pointA,
int
pointB, QWidget* parent =
nullptr
);
53
54
QSize
sizeHint
()
const override
;
55
void
setPixmap
(
const
QPixmap& pixmap);
56
void
setDefaultValPixmap
(
const
QPixmap& pixmap,
float
value
= 0.f);
57
58
protected
:
59
void
paintEvent
(QPaintEvent* event)
override
;
60
void
mouseMoveEvent
(QMouseEvent* me)
override
;
61
62
protected
slots:
63
void
handleMovement
();
64
65
private
:
66
QPixmap
m_pixmap
;
67
QPixmap
m_defaultValPixmap
;
68
float
m_pointA
;
69
float
m_pointB
;
70
float
m_defaultValue
;
71
bool
m_hasDefaultValPixmap
;
72
};
73
74
}
// namespace lmms::gui
75
76
#endif
// LMMS_GUI_DRAGGABLE_H
FloatModelEditorBase.h
lmms::FloatModel
Definition
AutomatableModel.h:468
lmms::gui::AutomatableModelView::value
T value() const
Definition
AutomatableModelView.h:59
lmms::gui::Draggable::setPixmap
void setPixmap(const QPixmap &pixmap)
Definition
Draggable.cpp:56
lmms::gui::Draggable::handleMovement
void handleMovement()
Definition
Draggable.cpp:116
lmms::gui::Draggable::paintEvent
void paintEvent(QPaintEvent *event) override
Definition
Draggable.cpp:70
lmms::gui::Draggable::m_pixmap
QPixmap m_pixmap
Definition
Draggable.h:66
lmms::gui::Draggable::DirectionOfManipulation
DirectionOfManipulation
Definition
FloatModelEditorBase.h:49
lmms::gui::Draggable::sizeHint
QSize sizeHint() const override
Definition
Draggable.cpp:51
lmms::gui::Draggable::m_defaultValue
float m_defaultValue
Definition
Draggable.h:70
lmms::gui::Draggable::setDefaultValPixmap
void setDefaultValPixmap(const QPixmap &pixmap, float value=0.f)
Definition
Draggable.cpp:62
lmms::gui::Draggable::m_pointB
float m_pointB
Definition
Draggable.h:69
lmms::gui::Draggable::m_hasDefaultValPixmap
bool m_hasDefaultValPixmap
Definition
Draggable.h:71
lmms::gui::Draggable::m_pointA
float m_pointA
Definition
Draggable.h:68
lmms::gui::Draggable::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *me) override
Definition
Draggable.cpp:85
lmms::gui::Draggable::m_defaultValPixmap
QPixmap m_defaultValPixmap
Definition
Draggable.h:67
lmms::gui::Draggable::Draggable
Draggable(DirectionOfManipulation directionOfManipulation, FloatModel *floatModel, const QPixmap &pixmap, int pointA, int pointB, QWidget *parent=nullptr)
Definition
Draggable.cpp:36
lmms::gui::FloatModelEditorBase::FloatModelEditorBase
FloatModelEditorBase(DirectionOfManipulation directionOfManipulation=DirectionOfManipulation::Vertical, QWidget *_parent=nullptr, const QString &_name=QString())
default ctor
Definition
FloatModelEditorBase.cpp:63
lmms::gui::FloatModelEditorBase::directionOfManipulation
DirectionOfManipulation directionOfManipulation() const
Definition
FloatModelEditorBase.h:165
lmms::gui::FloatModelEditorBase::DirectionOfManipulation
DirectionOfManipulation
Definition
FloatModelEditorBase.h:49
lmms::gui
Definition
AudioPortAudio.cpp:209
Generated on
for lmms by
1.18.0