Kstars

rectnode.h
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #pragma once
7 
8 #include <QColor>
9 #include <QSGGeometryNode>
10 
11 class QSGGeometry;
13 
14 /**
15  * @class RectNode
16  * @short QSGGeometryNode derived class that draws filled and non-filled rectangles
17  *
18  * @author Artem Fedoskin
19  * @version 1.0
20  */
21 class RectNode : public QSGGeometryNode
22 {
23  public:
24  explicit RectNode(bool filled = false);
25 
26  /**
27  * @brief setRect sets rectangle to display
28  * @param x - x coordinate of left-top corner
29  * @param y - y coordinate of left-top corner
30  * @param w - width
31  * @param h - height
32  */
33  void setRect(int x, int y, int w, int h);
34 
35  /** setColor sets the color of rectangle */
36  void setColor(const QColor &color);
37 
38  /**
39  * @brief setFilled sets whether the rectangle should be filled or no
40  * @param filled true to be filled, false otherwise
41  */
42  void setFilled(bool filled);
43 
44  private:
45  QSGGeometry *m_geometry { nullptr };
46  QSGFlatColorMaterial *m_material { nullptr };
47  bool m_filled { false };
48 };
void setRect(int x, int y, int w, int h)
setRect sets rectangle to display
Definition: rectnode.cpp:25
QSGGeometryNode derived class that draws filled and non-filled rectangles.
Definition: rectnode.h:21
void setColor(const QColor &color)
setColor sets the color of rectangle
Definition: rectnode.cpp:35
void setFilled(bool filled)
setFilled sets whether the rectangle should be filled or no
Definition: rectnode.cpp:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.