File indexing completed on 2024-05-05 04:05:12
0001 /* This file is part of KsirK. 0002 Copyright (C) 2008 Gael de Chalendar <kleag@free.fr> 0003 0004 KsirK is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU General Public 0006 License as published by the Free Software Foundation, either version 2 0007 of the License, or (at your option) any later version. 0008 0009 This program is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 General Public License for more details. 0013 0014 You should have received a copy of the GNU General Public License 0015 along with this program; if not, write to the Free Software 0016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0017 02110-1301, USA 0018 */ 0019 0020 #ifndef KSIRKSKINEDITORPIXMAPITEM_H 0021 #define KSIRKSKINEDITORPIXMAPITEM_H 0022 0023 // include files for Qt 0024 #include <QGraphicsPixmapItem> 0025 #include <QObject> 0026 #include <QPointF> 0027 0028 // include files for KDE 0029 0030 // include files for kde games 0031 0032 class QGraphicsSceneMouseEvent; 0033 0034 namespace KsirkSkinEditor 0035 { 0036 class PixmapItem : public QObject, public QGraphicsPixmapItem 0037 { 0038 Q_OBJECT 0039 0040 public: 0041 /** 0042 * Create the window and initializes its members 0043 */ 0044 explicit PixmapItem(QGraphicsItem* parent=nullptr); 0045 0046 /** 0047 * Deletes the background and the pool 0048 */ 0049 ~PixmapItem() override; 0050 0051 Q_SIGNALS: 0052 void pressed(QGraphicsItem*, const QPointF&); 0053 void placed(QGraphicsItem*, const QPointF&); 0054 0055 protected: 0056 void mousePressEvent(QGraphicsSceneMouseEvent* event) override; 0057 void mouseReleaseEvent (QGraphicsSceneMouseEvent* event) override; 0058 0059 }; 0060 0061 } // closing namespace KsirkSkinEditor 0062 0063 #endif 0064