File indexing completed on 2024-09-15 12:05:57
0001 // Copyright (c) 2017 Pino Toscano <pino@kde.org> 0002 // 0003 // This program is free software; you can redistribute it and/or 0004 // modify it under the terms of the GNU General Public License 0005 // version 2 as published by the Free Software Foundation. 0006 // 0007 // This program is distributed in the hope that it will be useful, 0008 // but WITHOUT ANY WARRANTY; without even the implied warranty of 0009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0010 // General Public License for more details. 0011 // 0012 // You should have received a copy of the GNU General Public License 0013 // along with this program; see the file COPYING. If not, write to 0014 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0015 // Boston, MA 02110-1301, USA. 0016 0017 #include "clickablelabel.h" 0018 0019 #include <QMouseEvent> 0020 0021 ClickableLabel::ClickableLabel(QWidget *parent) 0022 : QLabel(parent) 0023 { 0024 } 0025 0026 ClickableLabel::~ClickableLabel() 0027 { 0028 } 0029 0030 void ClickableLabel::mouseReleaseEvent(QMouseEvent *event) 0031 { 0032 if (event->button() == Qt::LeftButton) 0033 Q_EMIT clicked(); 0034 } 0035 0036 #include "moc_clickablelabel.cpp"