forked from qt-creator/qt-creator
CppEditor: Fix space issue for auto generated Q_PROPERTY
Change-Id: I3744ecfc18c7291666f346ea7b047ee749672e05 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -2798,12 +2798,12 @@ class Foo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
custom<N2::test> bar@;
|
custom<N2::test> bar@;
|
||||||
N2::test*getBar() const;
|
N2::test *getBar() const;
|
||||||
void setBar(const custom<N2::test> &newBar);
|
void setBar(const custom<N2::test> &newBar);
|
||||||
signals:
|
signals:
|
||||||
void barChanged(N2::test*bar);
|
void barChanged(N2::test *bar);
|
||||||
private:
|
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);
|
testDocuments << QuickFixTestDocument::create("file.h", original, expected);
|
||||||
@@ -2812,7 +2812,7 @@ private:
|
|||||||
original = "";
|
original = "";
|
||||||
expected = R"-(
|
expected = R"-(
|
||||||
using namespace N1;
|
using namespace N1;
|
||||||
N2::test*Foo::getBar() const
|
N2::test *Foo::getBar() const
|
||||||
{
|
{
|
||||||
return bar.get();
|
return bar.get();
|
||||||
}
|
}
|
||||||
@@ -2837,7 +2837,7 @@ void Foo::setBar(const custom<N2::test> &newBar)
|
|||||||
t.types.append("custom");
|
t.types.append("custom");
|
||||||
t.equalComparison = "<cur>.equals(<new>)";
|
t.equalComparison = "<cur>.equals(<new>)";
|
||||||
t.returnExpression = "<cur>.get()";
|
t.returnExpression = "<cur>.get()";
|
||||||
t.returnType = "<T>*";
|
t.returnType = "<T> *";
|
||||||
t.assignment = "<cur>.assign(<new>)";
|
t.assignment = "<cur>.assign(<new>)";
|
||||||
s->customTemplates.push_back(t);
|
s->customTemplates.push_back(t);
|
||||||
|
|
||||||
|
@@ -4144,8 +4144,9 @@ void GetterSetterRefactoringHelper::performGeneration(ExistingGetterSetterData d
|
|||||||
type = ref->elementType();
|
type = ref->elementType();
|
||||||
type.setConst(false);
|
type.setConst(false);
|
||||||
|
|
||||||
QString propertyDeclaration = QLatin1String("Q_PROPERTY(") + overview.prettyType(type)
|
QString propertyDeclaration = QLatin1String("Q_PROPERTY(")
|
||||||
+ QLatin1Char(' ') + memberBaseName(data.memberVariableName);
|
+ overview.prettyType(type,
|
||||||
|
memberBaseName(data.memberVariableName));
|
||||||
bool needMember = false;
|
bool needMember = false;
|
||||||
if (data.getterName.isEmpty())
|
if (data.getterName.isEmpty())
|
||||||
needMember = true;
|
needMember = true;
|
||||||
|
Reference in New Issue
Block a user