diff --git a/src/app/App.cpp b/src/app/App.cpp index 283cbcae4..cfbdedd8f 100644 --- a/src/app/App.cpp +++ b/src/app/App.cpp @@ -352,8 +352,8 @@ void registerToolType (const char *name) { #define registerSharedToolType(TYPE, NAME, METHOD) qmlRegisterSingletonType( \ NAME, 1, 0, NAME, \ - [](QQmlEngine *, QJSEngine *) -> QObject *{ \ - QObject *object = METHOD(); \ + [](QQmlEngine *, QJSEngine *) -> QObject *{ \ + QObject *object = const_cast(METHOD()); \ QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); \ return object; \ } \ diff --git a/src/app/App.hpp b/src/app/App.hpp index b35737018..bec1daccc 100644 --- a/src/app/App.hpp +++ b/src/app/App.hpp @@ -64,7 +64,7 @@ public: return mNotifier; } - Colors *getColors () const { + const Colors *getColors () const { return mColors; } diff --git a/src/app/providers/ImageProvider.cpp b/src/app/providers/ImageProvider.cpp index a9ad4dedb..525e0f40a 100644 --- a/src/app/providers/ImageProvider.cpp +++ b/src/app/providers/ImageProvider.cpp @@ -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;