11#include <klocalizedstring.h>
41 d->markers.append(QExplicitlySharedDataPointer<KoMarker>(0));
54 if (!file.exists())
return;
56 if (!file.open(QIODevice::ReadOnly))
return;
64 errKrita <<
"Parsing error in " << svgFile <<
"! Aborting!" << Qt::endl
65 <<
" In line: " << errorLine <<
", column: " << errorColumn << Qt::endl
66 <<
" Error message: " << errorMsg << Qt::endl;
67 errKrita << i18n(
"Parsing error in the main document at line %1, column %2\nError message: %3"
68 , errorLine , errorColumn , errorMsg);
78 [](
const QString &fileName) {
80 if (!file.exists())
return QByteArray();
82 file.open(QIODevice::ReadOnly);
83 return file.readAll();
90 Q_FOREACH (
const QExplicitlySharedDataPointer<KoMarker> &marker, parser.
knownMarkers()) {
104 foreach (
const QExplicitlySharedDataPointer<KoMarker>& m,
d->markers){
105 markerList.append(m.data());
112 foreach (
const QExplicitlySharedDataPointer<KoMarker>& m,
d->markers) {
113 if (marker == m.data()) {
116 if (m && *marker == *m) {
121 d->markers.append(QExplicitlySharedDataPointer<KoMarker>(marker));
~KoMarkerCollection() override
QList< QExplicitlySharedDataPointer< KoMarker > > markers
void loadDefaultMarkers()
load the markers that are available per default.
KoMarkerCollection(QObject *parent=0)
KoMarker * addMarker(KoMarker *marker)
void loadMarkersFromFile(const QString &svgFile)
static QString findAsset(const QString &type, const QString &fileName)
static QDomDocument createDocumentFromSvg(QIODevice *device, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0)
void setXmlBaseDir(const QString &baseDir)
Sets the initial xml base directory (the directory form where the file is read)
QList< KoShape * > parseSvg(const QDomElement &e, QSizeF *fragmentSize=0)
Parses a svg fragment, returning the list of top level child shapes.
void setFileFetcher(FileFetcherFunc func)
void setResolution(const QRectF boundsInPixels, qreal pixelsPerInch)
QList< QExplicitlySharedDataPointer< KoMarker > > knownMarkers() const