File indexing completed on 2024-05-05 17:09:09
0001 /* 0002 * This file is part of the KDE project 0003 * Copyright (C) 2013 Arjen Hiemstra <ahiemstra@heimr.nl> 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program; if not, write to the Free Software 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef CQTHUMBNAILITEM_H 0021 #define CQTHUMBNAILITEM_H 0022 0023 #include <QDeclarativeItem> 0024 0025 class CQThumbnailItem : public QDeclarativeItem 0026 { 0027 Q_OBJECT 0028 Q_PROPERTY(QPixmap content READ content WRITE setContent NOTIFY contentChanged) 0029 0030 public: 0031 explicit CQThumbnailItem(QDeclarativeItem* parent = 0); 0032 ~CQThumbnailItem(); 0033 0034 virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* ); 0035 0036 QPixmap content() const; 0037 0038 public Q_SLOTS: 0039 void setContent(const QPixmap& content); 0040 0041 Q_SIGNALS: 0042 void contentChanged(); 0043 0044 private: 0045 class Private; 0046 Private * const d; 0047 }; 0048 0049 #endif // CQTHUMBNAILITEM_H