48 QString
stringType()
const override {
return u
"LayoutSnapper"_s; }
55 void setSnapTolerance(
int snapTolerance );
73 void setSnapToGrid(
bool enabled );
85 void setSnapToGuides(
bool enabled );
97 void setSnapToItems(
bool enabled );
116 QPointF point,
double scaleFactor,
bool &snapped
SIP_OUT, QGraphicsLineItem *horizontalSnapLine =
nullptr, QGraphicsLineItem *verticalSnapLine =
nullptr,
const QList< QgsLayoutItem * > *ignoreItems =
nullptr
142 QGraphicsLineItem *horizontalSnapLine =
nullptr,
143 QGraphicsLineItem *verticalSnapLine =
nullptr,
144 const QList< QgsLayoutItem * > *ignoreItems =
nullptr
161 QPointF snapPointToGrid( QPointF point,
double scaleFactor,
bool &snappedX
SIP_OUT,
bool &snappedY
SIP_OUT )
const;
178 QPointF snapPointsToGrid(
const QList< QPointF > &points,
double scaleFactor,
bool &snappedX
SIP_OUT,
bool &snappedY
SIP_OUT )
const;
193 double snapPointToGuides(
double original, Qt::Orientation orientation,
double scaleFactor,
bool &snapped
SIP_OUT )
const;
210 double snapPointsToGuides(
const QList< double > &points, Qt::Orientation orientation,
double scaleFactor,
bool &snapped
SIP_OUT )
const;
230 double snapPointToItems(
double original, Qt::Orientation orientation,
double scaleFactor,
const QList< QgsLayoutItem * > &ignoreItems,
bool &snapped
SIP_OUT, QGraphicsLineItem *snapLine =
nullptr )
const;
247 double snapPointsToItems(
248 const QList< double > &points, Qt::Orientation orientation,
double scaleFactor,
const QList< QgsLayoutItem * > &ignoreItems,
bool &snapped
SIP_OUT, QGraphicsLineItem *snapLine =
nullptr
272 QgsLayout *mLayout =
nullptr;
275 bool mSnapToGrid =
false;
276 bool mSnapToGuides =
true;
277 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.
An integer settings entry.