QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
qgimanager.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef QGI_MANAGER_H
19#define QGI_MANAGER_H
20
21#include <QtCore>
22
23class QGraphicsScene;
24class QGraphicsItem;
25
31 // constructors, destructors
32 public:
33 QGIManager(QGraphicsScene *);
34 virtual ~QGIManager();
35 private:
37
38 // attributes
39 private:
40 QGraphicsScene *scene;
41 QHash<QGraphicsItem *, int> qgi_manager;
43
44 // methods
45 public:
46 void manage(QGraphicsItem *);
47 void release(QGraphicsItem *);
48#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
49 // In Qt6 QVector is an alias for QList, so these overloads would collide
50 // with the QVector ones below (same signature). Keep them on Qt5 only.
51 QT_DEPRECATED_X("Use QGIManager::manage(const QVector<QGraphicsItem *> &) instead")
52 void manage(const QList<QGraphicsItem *> &);
53 QT_DEPRECATED_X("Use QGIManager::release(const QVector<QGraphicsItem *> &) instead")
54 void release(const QList<QGraphicsItem *> &);
55#endif
56 void manage(const QVector<QGraphicsItem *> &items);
57 void release(const QVector<QGraphicsItem *> &items);
58 void setDestroyQGIOnDelete(bool);
59 bool manages(QGraphicsItem *) const;
60};
61#endif
void manage(QGraphicsItem *)
Definition qgimanager.cpp:52
void setDestroyQGIOnDelete(bool)
Definition qgimanager.cpp:112
QHash< QGraphicsItem *, int > qgi_manager
Definition qgimanager.h:41
virtual ~QGIManager()
Definition qgimanager.cpp:40
bool destroy_qgi_on_delete
Definition qgimanager.h:42
QGIManager(const QGIManager &)
QGIManager(QGraphicsScene *)
Definition qgimanager.cpp:27
QGraphicsScene * scene
Definition qgimanager.h:40
void release(QGraphicsItem *)
Definition qgimanager.cpp:64
bool manages(QGraphicsItem *) const
Definition qgimanager.cpp:121