File indexing completed on 2024-05-05 08:08:36

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 // application specific includes
0021 #include "ksirkskineditorscene.h"
0022 
0023 #include <QGraphicsSceneMouseEvent>
0024 #include "ksirkskineditor_debug.h"
0025 
0026 namespace KsirkSkinEditor
0027 {
0028 
0029 Scene::Scene(QObject* parent) :
0030   QGraphicsScene(parent)
0031 {
0032   qCDebug(KSIRKSKINEDITOR_LOG);
0033 }
0034 
0035 Scene::Scene(qreal x, qreal y, qreal width, qreal height, QObject* parent) :
0036   QGraphicsScene(x, y, width, height, parent)
0037 {
0038 }
0039 
0040 Scene::~Scene()
0041 {
0042   qCDebug(KSIRKSKINEDITOR_LOG);
0043 }
0044 
0045 void Scene::mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent)
0046 {
0047 //   qCDebug(KSIRKSKINEDITOR_LOG) << mouseEvent->scenePos();
0048   emit position(mouseEvent->scenePos());
0049   QGraphicsScene::mouseMoveEvent( mouseEvent );
0050 }
0051 
0052 void Scene::mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent)
0053 {
0054 //   qCDebug(KSIRKSKINEDITOR_LOG) << mouseEvent->scenePos();
0055   emit pressPosition(mouseEvent->scenePos());
0056   QGraphicsScene::mousePressEvent( mouseEvent );
0057 }
0058 
0059 void Scene::mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent)
0060 {
0061 //   qCDebug(KSIRKSKINEDITOR_LOG) << mouseEvent->scenePos();
0062   emit releasePosition(mouseEvent->scenePos());
0063   QGraphicsScene::mouseReleaseEvent( mouseEvent );
0064 }
0065 
0066 void Scene::dropEvent ( QGraphicsSceneDragDropEvent * event )
0067 {
0068   qCDebug(KSIRKSKINEDITOR_LOG) << event->scenePos();
0069   QGraphicsScene::dropEvent(event);
0070 }
0071 
0072 } // closing namespace
0073 
0074 #include "moc_ksirkskineditorscene.cpp"