3
* Copyright (C) 2001 - 2007 Christian Hohnstaedt.
8
#include "clicklabel.h"
14
ClickLabel::ClickLabel(QWidget *parent)
20
setFrameShape( QLabel::Panel );
21
setFrameShadow( QLabel::Sunken );
22
setAlignment( Qt::AlignCenter );
23
setToolTip( tr("Double click for details") );
25
setAutoFillBackground(true);
26
QPalette pal = palette();
27
QColor col = QColor(0xff, 0xff, 0xff);
28
pal.setColor(QPalette::Normal, QPalette::Window, col );
29
pal.setColor(QPalette::Inactive, QPalette::Window, col );
33
void ClickLabel::mouseDoubleClickEvent ( QMouseEvent * e )
35
QWidget::mouseDoubleClickEvent(e);
36
emit doubleClicked(text());
39
void ClickLabel::setColor(const QColor &col)
41
QPalette pal = palette();
42
pal.setColor(QPalette::Normal, QPalette::WindowText, col );
43
pal.setColor(QPalette::Inactive, QPalette::WindowText, col );
47
void ClickLabel::setRed()
49
setColor( QColor( 192, 32, 32) );
52
void ClickLabel::setGreen()
54
setColor( QColor( 32, 192, 32) );
57
void ClickLabel::disableToolTip()
59
setToolTip(QString());
63
CopyLabel::CopyLabel(QWidget *parent)
66
#if QT_VERSION >= 0x040200
67
setTextInteractionFlags(
68
Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);