Version: 9.16.0
GraphicsView_Scene.h
Go to the documentation of this file.
1// Copyright (C) 2013-2026 CEA, EDF, OPEN CASCADE
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef GRAPHICSVIEW_SCENE_H
21#define GRAPHICSVIEW_SCENE_H
22
23#include "GraphicsView.h"
24
25#include <QGraphicsScene>
26
27class QGraphicsRectItem;
28
29/*
30 Class : GraphicsView_Scene
31 Description : Scene of the graphics view
32*/
34{
35 Q_OBJECT
36
37public:
38 GraphicsView_Scene( QObject* theParent = 0 );
40
41public:
42 void processRectChanged();
43
44protected slots:
45 void onSceneRectChanged( const QRectF& theRect ); // for debug
46
47protected:
48 virtual void keyPressEvent( QKeyEvent* );
49 virtual void keyReleaseEvent( QKeyEvent* );
50 virtual void mousePressEvent( QGraphicsSceneMouseEvent* );
51 virtual void mouseMoveEvent( QGraphicsSceneMouseEvent* );
52 virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent* );
53 virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent* );
54 virtual void wheelEvent( QGraphicsSceneWheelEvent* );
55 virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* );
56
57 virtual void dragEnterEvent( QGraphicsSceneDragDropEvent* );
58 virtual void dragLeaveEvent( QGraphicsSceneDragDropEvent* );
59 virtual void dragMoveEvent( QGraphicsSceneDragDropEvent* );
60 virtual void dropEvent( QGraphicsSceneDragDropEvent* );
61
62signals:
63 void gsKeyEvent( QKeyEvent* );
64 void gsMouseEvent( QGraphicsSceneMouseEvent* );
65 void gsWheelEvent( QGraphicsSceneWheelEvent* );
66 void gsContextMenuEvent( QGraphicsSceneContextMenuEvent* );
67
69
70private:
71 QGraphicsRectItem* mySceneRectItem; // for debug
72};
73
74#endif
#define GRAPHICSVIEW_API
Definition: GraphicsView.h:29
Definition: GraphicsView_Scene.h:34
void gsMouseEvent(QGraphicsSceneMouseEvent *)
QGraphicsRectItem * mySceneRectItem
Definition: GraphicsView_Scene.h:71
void gsWheelEvent(QGraphicsSceneWheelEvent *)
void gsBoundingRectChanged()
void gsKeyEvent(QKeyEvent *)
void gsContextMenuEvent(QGraphicsSceneContextMenuEvent *)
For more information see QT documentation.