File indexing completed on 2025-04-27 03:58:31
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2014-09-12 0007 * Description : A label with an active url 0008 * 0009 * SPDX-FileCopyrightText: 2014-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_DACTIVE_LABEL_H 0016 #define DIGIKAM_DACTIVE_LABEL_H 0017 0018 // Qt includes 0019 0020 #include <QLabel> 0021 #include <QUrl> 0022 #include <QString> 0023 #include <QImage> 0024 0025 // Local includes 0026 0027 #include "digikam_export.h" 0028 0029 namespace Digikam 0030 { 0031 0032 /** 0033 * A widget to host an image into a label with an active url which can be 0034 * open to default web browser using simple mouse click. 0035 */ 0036 class DIGIKAM_EXPORT DActiveLabel : public QLabel 0037 { 0038 Q_OBJECT 0039 0040 public: 0041 0042 explicit DActiveLabel(const QUrl& url = QUrl(), 0043 const QString& imgPath = QString(), 0044 QWidget* const parent = nullptr); 0045 ~DActiveLabel() override; 0046 0047 void updateData(const QUrl& url, const QImage& img); 0048 }; 0049 0050 } // namespace Digikam 0051 0052 #endif // DIGIKAM_DACTIVE_LABEL_H