Seamly2D
Code documentation
vgraphicsfillitem.h
Go to the documentation of this file.
1 /************************************************************************
2  **
3  ** @file vgraphicsfillitem.h
4  ** @author Bojan Kverh
5  ** @date October 16, 2016
6  **
7  ** @brief
8  ** @copyright
9  ** This source code is part of the Valentine project, a pattern making
10  ** program, whose allow create and modeling patterns of clothing.
11  ** Copyright (C) 2013-2015 Seamly2D project
12  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
13  **
14  ** Seamly2D is free software: you can redistribute it and/or modify
15  ** it under the terms of the GNU General Public License as published by
16  ** the Free Software Foundation, either version 3 of the License, or
17  ** (at your option) any later version.
18  **
19  ** Seamly2D is distributed in the hope that it will be useful,
20  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  ** GNU General Public License for more details.
23  **
24  ** You should have received a copy of the GNU General Public License
25  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
26  **
27  *************************************************************************/
28 
29 #ifndef VGRAPHICSFILLITEM_H
30 #define VGRAPHICSFILLITEM_H
31 
32 #include <QGraphicsPathItem>
33 #include <QPainter>
34 
35 class VGraphicsFillItem : public QGraphicsPathItem
36 {
37 public:
38  /**
39  * @brief VGraphicsFillItem Constructor
40  * @param color color used for the item's pen & brush
41  * @param fill flag used if the item is to be filled or not
42  */
43  explicit VGraphicsFillItem(const QColor &color, bool fill, QGraphicsItem *parent = nullptr);
44  /**
45  * @brief ~VGraphicsFillItem Destructor
46  */
48  /**
49  * @brief paint Paints the item, filling the inside surface
50  * @param painter pointer to the painter object
51  * @param option unused
52  * @param widget unused
53  */
54  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
55 
56 private:
57  QColor m_color;
58  bool m_fill;
59 
60 };
61 
62 #endif // VGRAPHICSFILLITEM_H
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
paint Paints the item, filling the inside surface
~VGraphicsFillItem()
~VGraphicsFillItem Destructor
VGraphicsFillItem(const QColor &color, bool fill, QGraphicsItem *parent=nullptr)
VGraphicsFillItem Constructor.