From 47f96cf0a4efe785389db8a3dad16e17976bc46b Mon Sep 17 00:00:00 2001 From: David Skoland Date: Tue, 14 Feb 2017 15:58:36 +0100 Subject: added emote comments to emote buttons with missing image --- aoevidencebutton.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 aoevidencebutton.cpp (limited to 'aoevidencebutton.cpp') diff --git a/aoevidencebutton.cpp b/aoevidencebutton.cpp new file mode 100644 index 00000000..d4adce86 --- /dev/null +++ b/aoevidencebutton.cpp @@ -0,0 +1,24 @@ +#include "aoevidencebutton.h" + +#include "file_functions.h" + +AOEvidenceButton::AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app) : QPushButton(p_parent) +{ + ao_app = p_ao_app; +} + +void AOEvidenceButton::set_image(QString p_image) +{ + QString image_path = ao_app->get_evidence_path() + p_image; + + if (file_exists(image_path)) + { + this->setText(""); + this->setStyleSheet("border-image:url(\"" + image_path + "\")"); + } + else + { + this->setText("evi"); + this->setStyleSheet(""); + } +} -- cgit