Commit 46f989c2 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(App): colors getter returns a const pointer now

parent 00bc9aa1
......@@ -353,7 +353,7 @@ void registerToolType (const char *name) {
#define registerSharedToolType(TYPE, NAME, METHOD) qmlRegisterSingletonType<TYPE>( \
NAME, 1, 0, NAME, \
[](QQmlEngine *, QJSEngine *) -> QObject *{ \
QObject *object = METHOD(); \
QObject *object = const_cast<TYPE *>(METHOD()); \
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); \
return object; \
} \
......
......@@ -64,7 +64,7 @@ public:
return mNotifier;
}
Colors *getColors () const {
const Colors *getColors () const {
return mColors;
}
......
......@@ -58,10 +58,7 @@ static QByteArray buildByteArrayAttribute (const QByteArray &name, const QByteAr
return attribute;
}
static QByteArray parseFillAndStroke (
QXmlStreamAttributes &readerAttributes,
const Colors &colors
) {
static QByteArray parseFillAndStroke (QXmlStreamAttributes &readerAttributes, const Colors &colors) {
static QRegExp regex("^color-([^-]+)-(fill|stroke)$");
QByteArray attributes;
......@@ -86,10 +83,7 @@ static QByteArray parseFillAndStroke (
return attributes;
}
static QByteArray parseStyle (
QXmlStreamAttributes &readerAttributes,
const Colors &colors
) {
static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colors &colors) {
static QRegExp regex("^color-([^-]+)-style-(fill|stroke)$");
QByteArray attribute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment