File indexing completed on 2025-02-23 04:34:24
0001 /** 0002 * \file picturelabel.h 0003 * Label for picture preview. 0004 * 0005 * \b Project: Kid3 0006 * \author Urs Fleisch 0007 * \date 04 Jan 2009 0008 * 0009 * Copyright (C) 2009-2018 Urs Fleisch 0010 * 0011 * This file is part of Kid3. 0012 * 0013 * Kid3 is free software; you can redistribute it and/or modify 0014 * it under the terms of the GNU General Public License as published by 0015 * the Free Software Foundation; either version 2 of the License, or 0016 * (at your option) any later version. 0017 * 0018 * Kid3 is distributed in the hope that it will be useful, 0019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0021 * GNU General Public License for more details. 0022 * 0023 * You should have received a copy of the GNU General Public License 0024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0025 */ 0026 0027 #pragma once 0028 0029 #include <QWidget> 0030 0031 class QByteArray; 0032 class QLabel; 0033 0034 /** 0035 * Label for picture preview. 0036 */ 0037 class PictureLabel : public QWidget { 0038 public: 0039 /** 0040 * Constructor. 0041 * 0042 * @param parent parent widget 0043 */ 0044 explicit PictureLabel(QWidget* parent); 0045 0046 /** 0047 * Destructor. 0048 */ 0049 ~PictureLabel() override; 0050 0051 /** 0052 * Set picture data. 0053 * 0054 * @param data picture data, empty if no picture is available 0055 */ 0056 void setData(const QByteArray& data); 0057 0058 private: 0059 /** 0060 * Clear picture. 0061 */ 0062 void clearPicture(); 0063 0064 QLabel* m_pictureLabel; 0065 QLabel* m_sizeLabel; 0066 uint m_pixmapHash; 0067 };