diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index cc3bef67d8e..0451e1632c1 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -2798,12 +2798,12 @@ class Foo { public: custom bar@; - N2::test*getBar() const; + N2::test *getBar() const; void setBar(const custom &newBar); signals: - void barChanged(N2::test*bar); + void barChanged(N2::test *bar); private: - Q_PROPERTY(N2::test* bar READ getBar NOTIFY barChanged) + Q_PROPERTY(N2::test *bar READ getBar NOTIFY barChanged) }; })--"; testDocuments << QuickFixTestDocument::create("file.h", original, expected); @@ -2812,7 +2812,7 @@ private: original = ""; expected = R"-( using namespace N1; -N2::test*Foo::getBar() const +N2::test *Foo::getBar() const { return bar.get(); } @@ -2837,7 +2837,7 @@ void Foo::setBar(const custom &newBar) t.types.append("custom"); t.equalComparison = ".equals()"; t.returnExpression = ".get()"; - t.returnType = "*"; + t.returnType = " *"; t.assignment = ".assign()"; s->customTemplates.push_back(t); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index cc4768dc991..6dc0b3d6fa1 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -4144,8 +4144,9 @@ void GetterSetterRefactoringHelper::performGeneration(ExistingGetterSetterData d type = ref->elementType(); type.setConst(false); - QString propertyDeclaration = QLatin1String("Q_PROPERTY(") + overview.prettyType(type) - + QLatin1Char(' ') + memberBaseName(data.memberVariableName); + QString propertyDeclaration = QLatin1String("Q_PROPERTY(") + + overview.prettyType(type, + memberBaseName(data.memberVariableName)); bool needMember = false; if (data.getterName.isEmpty()) needMember = true;