umbrello/umbrello
Go to the documentation of this file.
27 #include <QVarLengthArray>
38 m_gridDotColor(Qt::gray),
58 qreal left = int(rect.left()) - (
int(rect.left()) % gridSizeX);
59 qreal top = int(rect.top()) - (
int(rect.top()) % gridSizeY);
61 QVarLengthArray<QLineF, 200> lines;
63 for (qreal x = left; x < rect.right(); x += gridSizeX)
64 lines.append(QLineF(x, rect.top(), x, rect.bottom()));
65 for (qreal y = top; y < rect.bottom(); y += gridSizeY)
66 lines.append(QLineF(rect.left(), y, rect.right(), y));
68 painter->setPen(m_gridDotColor);
69 painter->drawLines(lines.data(), lines.size());
74 return m_gridSpacingX;
79 return m_gridSpacingY;
84 DEBUG(
"LayoutGrid") <<
"x = " << sizeX <<
" / y = " << sizeY;
85 m_gridSpacingX= sizeX;
86 m_gridSpacingY= sizeY;
91 return m_gridDotColor;
96 DEBUG(
"LayoutGrid") <<
"color = " << color;
97 m_gridDotColor = color;
107 if (m_isVisible != visible) {
108 DEBUG(
"LayoutGrid") <<
"visible = " << visible;
109 m_isVisible = visible;
void setVisible(bool visible)
#define DEBUG_REGISTER_DISABLED(src)
void setGridDotColor(const QColor &color)
void setGridSpacing(int sizeX, int sizeY)
void paint(QPainter *painter, const QRectF &rect)
UMLScene instances represent diagrams.
const QColor & gridDotColor() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.