forked from qt-creator/qt-creator
ModelEditor: Make keyword static known to class member parser
Sometimes my brain is a junk room where I found the most wondrous bugs. Change-Id: Ic3a29152fed564d405ee1251ff69ee57cf10ae36 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -665,6 +665,8 @@ void ClassItem::updateMembers(const Style *style)
|
||||
*text += StereotypesItem::format(member.stereotypes());
|
||||
*text += QStringLiteral(" ");
|
||||
}
|
||||
if (member.properties() & MClassMember::PropertyStatic)
|
||||
*text += QStringLiteral("static ");
|
||||
if (member.properties() & MClassMember::PropertyVirtual)
|
||||
*text += QStringLiteral("virtual ");
|
||||
*text += member.declaration().toHtmlEscaped();
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
PropertyOverride = 0x8,
|
||||
PropertyFinal = 0x10,
|
||||
PropertyConstexpr = 0x20,
|
||||
PropertyStatic = 0x40,
|
||||
PropertyQsignal = 0x100,
|
||||
PropertyQslot = 0x200,
|
||||
PropertyQinvokable = 0x400,
|
||||
|
||||
@@ -434,6 +434,8 @@ QString ClassMembersEdit::build(const QList<MClassMember> &members)
|
||||
text += QStringLiteral("slot ");
|
||||
if (member.properties() & MClassMember::PropertyQinvokable)
|
||||
text += QStringLiteral("invokable ");
|
||||
if (member.properties() & MClassMember::PropertyStatic)
|
||||
text += QStringLiteral("static ");
|
||||
if (member.properties() & MClassMember::PropertyVirtual)
|
||||
text += QStringLiteral("virtual ");
|
||||
if (member.properties() & MClassMember::PropertyConstexpr)
|
||||
@@ -507,6 +509,9 @@ QList<MClassMember> ClassMembersEdit::parse(const QString &text, bool *ok)
|
||||
StereotypesController ctrl;
|
||||
member.setStereotypes(ctrl.fromString(stereotypes));
|
||||
word = cursor.readWord().toLower();
|
||||
} else if (word == QStringLiteral("static")) {
|
||||
member.setProperties(member.properties() | MClassMember::PropertyStatic);
|
||||
word = cursor.readWord().toLower();
|
||||
} else if (word == QStringLiteral("virtual")) {
|
||||
member.setProperties(member.properties() | MClassMember::PropertyVirtual);
|
||||
word = cursor.readWord().toLower();
|
||||
|
||||
Reference in New Issue
Block a user