lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Rubberband.h
Go to the documentation of this file.
1
/*
2
* Rubberband.h - rubberband - either own implementation for Qt3 or wrapper for
3
* Qt4
4
*
5
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6
*
7
* This file is part of LMMS - https://lmms.io
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public
11
* License as published by the Free Software Foundation; either
12
* version 2 of the License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public
20
* License along with this program (see COPYING); if not, write to the
21
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
* Boston, MA 02110-1301 USA.
23
*
24
*/
25
26
#ifndef LMMS_GUI_RUBBERBAND_H
27
#define LMMS_GUI_RUBBERBAND_H
28
29
#include <QRubberBand>
30
#include <QVector>
31
32
namespace
lmms::gui
33
{
34
35
36
class
selectableObject
:
public
QWidget
37
{
38
Q_OBJECT
39
public
:
40
selectableObject
( QWidget * _parent ) :
41
QWidget( _parent ),
42
m_selected
( false )
43
{
44
}
45
46
~selectableObject
()
override
=
default
;
47
48
inline
void
setSelected
(
bool
selected)
49
{
50
if
(
m_selected
== selected) {
return
; }
51
m_selected
= selected;
52
update
();
53
}
54
55
inline
bool
isSelected
()
const
56
{
57
return
(
m_selected
);
58
}
59
60
61
public
slots:
62
virtual
void
update
()
63
{
64
QWidget::update();
65
}
66
67
68
private
:
69
bool
m_selected
;
70
71
} ;
72
73
74
75
76
class
RubberBand
:
public
QRubberBand
77
{
78
public
:
79
RubberBand
( QWidget * _parent );
80
~RubberBand
()
override
=
default
;
81
82
QVector<selectableObject *>
selectedObjects
()
const
;
83
QVector<selectableObject *>
selectableObjects
()
const
;
84
85
86
protected
:
87
void
resizeEvent
( QResizeEvent * _re )
override
;
88
89
private
:
90
91
};
92
93
94
}
// namespace lmms::gui
95
96
#endif
// LMMS_GUI_RUBBERBAND_H
lmms::gui::RubberBand::selectableObjects
QVector< selectableObject * > selectableObjects() const
Definition
Rubberband.cpp:70
lmms::gui::RubberBand::resizeEvent
void resizeEvent(QResizeEvent *_re) override
Definition
Rubberband.cpp:62
lmms::gui::RubberBand::RubberBand
RubberBand(QWidget *_parent)
Definition
Rubberband.cpp:33
lmms::gui::RubberBand::~RubberBand
~RubberBand() override=default
lmms::gui::RubberBand::selectedObjects
QVector< selectableObject * > selectedObjects() const
Definition
Rubberband.cpp:41
lmms::gui::selectableObject::m_selected
bool m_selected
Definition
Rubberband.h:69
lmms::gui::selectableObject::~selectableObject
~selectableObject() override=default
lmms::gui::selectableObject::update
virtual void update()
Definition
Rubberband.h:62
lmms::gui::selectableObject::setSelected
void setSelected(bool selected)
Definition
Rubberband.h:48
lmms::gui::selectableObject::selectableObject
selectableObject(QWidget *_parent)
Definition
Rubberband.h:40
lmms::gui::selectableObject::isSelected
bool isSelected() const
Definition
Rubberband.h:55
lmms::gui
Definition
AudioPortAudio.cpp:209
Generated on
for lmms by
1.18.0