49 QString
stringType()
const override {
return u
"LayoutSnapper"_s; }
56 void setSnapTolerance(
int snapTolerance );
74 void setSnapToGrid(
bool enabled );
86 void setSnapToGuides(
bool enabled );
98 void setSnapToItems(
bool enabled );
116 QPointF snapPoint( QPointF point,
double scaleFactor,
bool &snapped
SIP_OUT, QGraphicsLineItem *horizontalSnapLine =
nullptr,
117 QGraphicsLineItem *verticalSnapLine =
nullptr,
118 const QList< QgsLayoutItem * > *ignoreItems =
nullptr )
const;
139 QRectF snapRect(
const QRectF &rect,
double scaleFactor,
bool &snapped
SIP_OUT, QGraphicsLineItem *horizontalSnapLine =
nullptr,
140 QGraphicsLineItem *verticalSnapLine =
nullptr,
141 const QList< QgsLayoutItem * > *ignoreItems =
nullptr )
const;
157 QPointF snapPointToGrid( QPointF point,
double scaleFactor,
bool &snappedX
SIP_OUT,
bool &snappedY
SIP_OUT )
const;
174 QPointF snapPointsToGrid(
const QList< QPointF > &points,
double scaleFactor,
bool &snappedX
SIP_OUT,
bool &snappedY
SIP_OUT )
const;
189 double snapPointToGuides(
double original, Qt::Orientation orientation,
double scaleFactor,
bool &snapped
SIP_OUT )
const;
206 double snapPointsToGuides(
const QList< double > &points, Qt::Orientation orientation,
double scaleFactor,
bool &snapped
SIP_OUT )
const;
226 double snapPointToItems(
double original, Qt::Orientation orientation,
double scaleFactor,
const QList< QgsLayoutItem * > &ignoreItems,
bool &snapped
SIP_OUT,
227 QGraphicsLineItem *snapLine =
nullptr )
const;
244 double snapPointsToItems(
const QList< double > &points, Qt::Orientation orientation,
double scaleFactor,
const QList< QgsLayoutItem * > &ignoreItems,
bool &snapped
SIP_OUT,
245 QGraphicsLineItem *snapLine =
nullptr )
const;
269 QgsLayout *mLayout =
nullptr;
272 bool mSnapToGrid =
false;
273 bool mSnapToGuides =
true;
274 bool mSnapToItems =
true;
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
A container for the context for various read/write operations on objects.