diff generator/generator.cpp @ 357:9784459f0750

An attempt (failed due to optlink) to improve locality of declarations exported from QtD executables Q_CLASSINFO implementation Now Qtd can be built on Windows
author Max Samukha <maxter@spambox.com>
date Wed, 02 Jun 2010 19:38:05 +0300
parents 073b9153ed8a
children
line wrap: on
line diff
--- a/generator/generator.cpp	Tue May 25 20:14:04 2010 +0300
+++ b/generator/generator.cpp	Wed Jun 02 19:38:05 2010 +0300
@@ -140,6 +140,24 @@
     return false;
 }
 
+// hackery to get qt module names
+QString Generator::packageToQtModule(QString package, ModuleNameType nameType)
+{
+    if (!package.startsWith("qt."))
+        qFatal(qPrintable("Package " + package + " does not start with 'qt.'"));
+
+    QString module = package.right(package.length() - 3);
+
+    if (nameType == ShortUpper)
+        return module.toUpper();
+    else if (nameType == LongCamel) {
+        module[0] = module[0].toTitleCase();
+        return "Qt" + module;
+    }
+    else
+        Q_ASSERT(0);
+}
+
 bool isLinearContainer(const ContainerTypeEntry *type)
 {
     if (type->type() == ContainerTypeEntry::ListContainer