diff --git a/gui/clicklabel.cpp b/gui/clicklabel.cpp index 87bb84d..77786f6 100644 --- a/gui/clicklabel.cpp +++ b/gui/clicklabel.cpp @@ -1,6 +1,11 @@ +#include #include "clicklabel.h" void ClickLabel::mousePressEvent(QMouseEvent *event) { - emit clicked(); + if(event->button() == Qt::LeftButton) + { + emit leftClick(); + } + return QLabel::mousePressEvent(event); } diff --git a/gui/clicklabel.h b/gui/clicklabel.h index c01bb10..cd695aa 100644 --- a/gui/clicklabel.h +++ b/gui/clicklabel.h @@ -8,7 +8,7 @@ class ClickLabel : public QLabel public: using QLabel::QLabel; signals: - void clicked(); + void leftClick(); protected: void mousePressEvent(QMouseEvent *event); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 1f7c67c..e1bd8cd 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -118,7 +118,7 @@ void MainWindow::pdfPreviewReceived(PdfPreview preview) label->setPixmap(QPixmap::fromImage(preview.previewImage)); label->setToolTip(preview.documentPath); ui->scrollAreaWidgetContents->layout()->addWidget(label); - connect(label, &ClickLabel::clicked, [=]() { + connect(label, &ClickLabel::leftClick, [=]() { QSettings settings; QString command = settings.value("pdfviewer").toString(); if(command != "" && command.contains("%p") && command.contains("%f"))