@@ -113,6 +113,11 static QStringList getOperatorCodes(const AbstractMetaClass* cls) { | |||
|
113 | 113 | return result; |
|
114 | 114 | } |
|
115 | 115 | |
|
116 | static bool class_less_than(const AbstractMetaClass *a, const AbstractMetaClass *b) | |
|
117 | { | |
|
118 | return a->name() < b->name(); | |
|
119 | } | |
|
120 | ||
|
116 | 121 | void SetupGenerator::generate() |
|
117 | 122 | { |
|
118 | 123 | AbstractMetaClassList classes_with_polymorphic_id; |
@@ -128,6 +133,7 void SetupGenerator::generate() | |||
|
128 | 133 | } |
|
129 | 134 | } |
|
130 | 135 | } |
|
136 | qSort(classes_with_polymorphic_id.begin(), classes_with_polymorphic_id.end(), class_less_than); | |
|
131 | 137 | |
|
132 | 138 | QHashIterator<QString, QList<const AbstractMetaClass*> > pack(packHash); |
|
133 | 139 | while (pack.hasNext()) { |
@@ -135,6 +141,7 void SetupGenerator::generate() | |||
|
135 | 141 | QList<const AbstractMetaClass*> list = pack.value(); |
|
136 | 142 | if (list.isEmpty()) |
|
137 | 143 | continue; |
|
144 | qSort(list.begin(), list.end(), class_less_than); | |
|
138 | 145 | |
|
139 | 146 | QString packKey = pack.key(); |
|
140 | 147 | QString packName = pack.key(); |
@@ -176,7 +183,7 void SetupGenerator::generate() | |||
|
176 | 183 | |
|
177 | 184 | QStringList polymorphicHandlers; |
|
178 | 185 | if (!packName.endsWith("_builtin")) { |
|
179 | polymorphicHandlers = writePolymorphicHandler(s, list.at(0)->package(), classes_with_polymorphic_id); | |
|
186 | polymorphicHandlers = writePolymorphicHandler(s, list.at(0)->package(), classes_with_polymorphic_id, list); | |
|
180 | 187 | s << endl; |
|
181 | 188 | } |
|
182 | 189 | |
@@ -225,18 +232,17 void SetupGenerator::generate() | |||
|
225 | 232 | } |
|
226 | 233 | |
|
227 | 234 | QStringList SetupGenerator::writePolymorphicHandler(QTextStream &s, const QString &package, |
|
228 | const AbstractMetaClassList &classes) | |
|
235 | const AbstractMetaClassList &polybase, QList<const AbstractMetaClass*>& allClasses) | |
|
229 | 236 | { |
|
230 | 237 | QStringList handlers; |
|
231 |
foreach (AbstractMetaClass *cls, |
|
|
238 | foreach (AbstractMetaClass *cls, polybase) { | |
|
232 | 239 | const ComplexTypeEntry *centry = cls->typeEntry(); |
|
233 | 240 | if (!centry->isPolymorphicBase()) |
|
234 | 241 | continue; |
|
235 | 242 | bool isGraphicsItem = (cls->qualifiedCppName()=="QGraphicsItem"); |
|
236 | 243 | |
|
237 | AbstractMetaClassList classList = this->classes(); | |
|
238 | 244 | bool first = true; |
|
239 |
foreach (AbstractMetaClass *clazz, |
|
|
245 | foreach (const AbstractMetaClass *clazz, allClasses) { | |
|
240 | 246 | bool inherits = false; |
|
241 | 247 | if (isGraphicsItem) { |
|
242 | 248 | foreach(AbstractMetaClass* interfaze, clazz->interfaces()) { |
General Comments 0
You need to be logged in to leave comments.
Login now