forked from mercutiodesign/texmaker-3.3.3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayerbutton.cpp
47 lines (33 loc) · 1.44 KB
/
playerbutton.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/***************************************************************************
* copyright : (C) 2006 by Pascal Brachet *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "playerbutton.h"
PlayerButton::PlayerButton( QWidget *parent )
: QLabel( parent ) {
state = true;
}
void PlayerButton::setImages( QString name ) {
this->pixEnabled.load(":/images/"+name+"_enabled.png");
this->pixHover.load(":/images/"+name+"_enabled.png");
this->pixDisabled.load(":/images/"+name+"_disabled.png");
this->setPixmap(this->pixEnabled);
}
void PlayerButton::setEnabled( bool enabled ) {
state = enabled;
this->setPixmap( enabled ? this->pixEnabled : this->pixDisabled );
}
void PlayerButton::mouseReleaseEvent( QMouseEvent * e ) {
emit clicked();
}
void PlayerButton::enterEvent( QEvent * e ) {
//if (state) this->setPixmap( pixHover );
}
void PlayerButton::leaveEvent( QEvent *e ) {
//setEnabled( state );
}