Engauge Digitizer 2
Loading...
Searching...
No Matches
GridLines.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "GridLines.h"
8#include <QPen>
9
13
15{
16 qDeleteAll (m_gridLinesContainer);
17}
18
20{
21 m_gridLinesContainer.push_back (gridLine);
22}
23
25{
26 for (int i = 0; i < m_gridLinesContainer.count(); i++) {
27 GridLine *gridLine = m_gridLinesContainer [i];
28 delete gridLine;
29 }
30
31 m_gridLinesContainer.clear();
32}
33
34void GridLines::setPen (const QPen &pen)
35{
36 for (int i = 0; i < m_gridLinesContainer.count(); i++) {
37 m_gridLinesContainer [i]->setPen (pen);
38 }
39}
40
42{
43 for (int i = 0; i < m_gridLinesContainer.count(); i++) {
44 m_gridLinesContainer [i]->setVisible (visible);
45 }
46}
const int INNER_RADIUS_MIN
Single grid line drawn a straight or curved line.
Definition GridLine.h:21
GridLines()
Single constructor.
Definition GridLines.cpp:10
void setVisible(bool visible)
Make all grid lines visible or hidden.
Definition GridLines.cpp:41
void add(GridLine *gridLine)
Add specified grid line. Ownership of all allocated QGraphicsItems is passed to new GridLine.
Definition GridLines.cpp:19
void clear()
Deallocate and remove all grid lines.
Definition GridLines.cpp:24
void setPen(const QPen &pen)
Set the pen style of each grid line.
Definition GridLines.cpp:34
~GridLines()
Destructor deallocates memory.
Definition GridLines.cpp:14