LMMS
Loading...
Searching...
No Matches
PixmapButton.h
Go to the documentation of this file.
1/*
2 * PixmapButton.h - declaration of class pixmapButton
3 *
4 * Copyright (c) 2004-2008 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_PIXMAP_BUTTON_H
26#define LMMS_GUI_PIXMAP_BUTTON_H
27
28#include <QPixmap>
29
30#include "AutomatableButton.h"
31
32namespace lmms::gui
33{
34
35
36class LMMS_EXPORT PixmapButton : public AutomatableButton
37{
38 Q_OBJECT
39public:
40 PixmapButton( QWidget * _parent,
41 const QString & _name = QString() );
42 ~PixmapButton() override = default;
43
44 void setActiveGraphic( const QPixmap & _pm );
45 void setInactiveGraphic( const QPixmap & _pm, bool _update = true );
46
47 QSize sizeHint() const override;
48 QSize minimumSizeHint() const override;
49
50signals:
52
53
54protected:
55 void paintEvent( QPaintEvent * _pe ) override;
56 void mousePressEvent( QMouseEvent * _me ) override;
57 void mouseReleaseEvent( QMouseEvent * _me ) override;
58 void mouseDoubleClickEvent( QMouseEvent * _me ) override;
59
60private:
61 bool isActive() const;
62
63private:
67
68} ;
69
70
71} // namespace lmms::gui
72
73#endif // LMMS_GUI_PIXMAP_BUTTON_H
AutomatableButton(QWidget *_parent, const QString &_name=QString())
Definition AutomatableButton.cpp:38
void mouseReleaseEvent(QMouseEvent *_me) override
Definition PixmapButton.cpp:84
void paintEvent(QPaintEvent *_pe) override
Definition PixmapButton.cpp:53
void mouseDoubleClickEvent(QMouseEvent *_me) override
Definition PixmapButton.cpp:98
~PixmapButton() override=default
void setActiveGraphic(const QPixmap &_pm)
Definition PixmapButton.cpp:105
bool m_pressed
Definition PixmapButton.h:66
PixmapButton(QWidget *_parent, const QString &_name=QString())
Definition PixmapButton.cpp:37
void setInactiveGraphic(const QPixmap &_pm, bool _update=true)
Definition PixmapButton.cpp:112
QSize minimumSizeHint() const override
Definition PixmapButton.cpp:126
QPixmap m_inactivePixmap
Definition PixmapButton.h:65
bool isActive() const
Definition PixmapButton.cpp:132
void mousePressEvent(QMouseEvent *_me) override
Definition PixmapButton.cpp:69
QSize sizeHint() const override
Definition PixmapButton.cpp:121
QPixmap m_activePixmap
Definition PixmapButton.h:64
Definition AudioPortAudio.cpp:223