QElectroTech  0.70
qetgraphicshandleritem.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 QETGRAPHICSHANDLERITEM_H
19 #define QETGRAPHICSHANDLERITEM_H
20 
21 #include <QGraphicsItem>
22 #include <QPen>
23 
31 class QetGraphicsHandlerItem : public QGraphicsItem
32 {
33  public:
34  QetGraphicsHandlerItem(qreal size = 10);
35  QRectF boundingRect() const override;
36 
37  enum { Type = UserType + 1200};
38  int type() const override {return Type;}
39 
40  void setColor(QColor color);
41 
42  protected:
43  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
44 
45  private:
47  m_br;
48  qreal m_size;
49  QColor m_color;
50  QPen m_pen;
51 
52  public:
53  static QVector<QetGraphicsHandlerItem *> handlerForPoint(const QVector<QPointF> &points, int size = 10);
54 };
55 
56 #endif // QETGRAPHICSHANDLERITEM_H
int type() const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
QetGraphicsHandlerItem::paint.
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
void setColor(QColor color)
QetGraphicsHandlerItem::setColor.
QRectF boundingRect() const override
QetGraphicsHandlerItem::boundingRect.
QetGraphicsHandlerItem(qreal size=10)
QetGraphicsHandlerItem::QetGraphicsHandlerItem.
static QVector< QetGraphicsHandlerItem * > handlerForPoint(const QVector< QPointF > &points, int size=10)
QetGraphicsHandlerItem::handlerForPoint.