changeset 254:34a37904ff77

(none)
author maxter
date Sun, 30 Aug 2009 10:59:56 +0000
parents 073b9153ed8a
children c9e2206661ae
files CMakeLists.txt build/core.makefile build/core.txt cpp/qt_core/QVariant_shell.cpp cpp/qt_gui/UrlHandler_shell.cpp cpp/qt_gui/UrlHandler_shell.h cpp/qt_qtd/ArrayOpsPrimitive_shell.cpp generator/containergenerator.cpp generator/cppheadergenerator.cpp generator/fileout.h generator/typesystem_core-java.xml generator/typesystem_gui-java.java generator/typesystem_gui-java.xml generator/typesystem_gui.xml generator/typesystem_network-java.xml generator/typesystem_network.xml generator/typesystem_opengl-java.xml generator/typesystem_opengl.xml generator/typesystem_sql.xml generator/typesystem_svg-java.xml generator/typesystem_svg.xml generator/typesystem_webkit-java.xml generator/typesystem_webkit.xml generator/typesystem_xml.xml include/QObjectEntity.h include/qtd_core.h qt/CMakeLists.txt qt/QDefines.d qt/QGlobal.d qt/d1/qt/core/QLine.d qt/d1/qt/core/QModelIndex.d qt/d1/qt/core/QPoint.d qt/d1/qt/core/QRect.d qt/d1/qt/core/QRectF.d qt/d1/qt/core/QVariant.d qt/d1/qt/qtd/Str.d qt/d2/qt/core/QLine.d qt/d2/qt/core/QModelIndex.d qt/d2/qt/core/QPoint.d qt/d2/qt/core/QRect.d qt/d2/qt/core/QRectF.d qt/d2/qt/core/QVariant.d qt/d2/qt/qtd/Str.d qt/qtd/Traits.d
diffstat 44 files changed, 584 insertions(+), 529 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Sun Aug 30 09:59:12 2009 +0000
+++ b/CMakeLists.txt	Sun Aug 30 10:59:56 2009 +0000
@@ -15,7 +15,7 @@
 Please delete them.
 
   Or you can restart cmake with `-DALLOW_IN_SOURCE_BUILDS=1`, but it is not
-recomended.
+recommended.
 ")
 endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE_BUILDS)
 
@@ -389,7 +389,11 @@
 	endforeach(d_source ${d_generated_files})
 	set(classes ArrayOps ${classes})
 	foreach(class ${classes})
-	    set(d_sources ${d_sources} ${CMAKE_BINARY_DIR}/qt/${package}/${class}.d)	
+	    set(d_sources ${d_sources} ${CMAKE_BINARY_DIR}/qt/${package}/${class}.d)
+	    set(aux_name ${CMAKE_BINARY_DIR}/qt/${package}/${class}_aux.d )
+            if(EXISTS ${aux_name})
+	        set(d_sources ${d_sources} ${aux_name})
+	    endif(EXISTS ${aux_name})
 	    set(cpp_sources ${cpp_sources} ${CMAKE_BINARY_DIR}/cpp/qt_${package}/${class}_shell.cpp) 
 	endforeach(class ${classes})
 	set(files_for_gen ${files_for_gen} ${cpp_sources} ${d_sources})
@@ -417,7 +421,7 @@
 	      set(regexp_str_tmp "(${ver_safe_tmp}/|${cbd_safe_tmp}/|${csd_safe_tmp}/|)(.+)")
 	      string(REGEX REPLACE ${regexp_str_tmp} "\\2" ins_path "${path}") 
 	      install(FILES ${d_source} DESTINATION include/d/${ins_path} COMPONENT qtd RENAME ${name}.di)
-	      install(FILES ${path}/${name}_enum.d DESTINATION include/d/${ins_path} COMPONENT qtd RENAME ${name}_enum.di OPTIONAL)
+	      install(FILES ${path}/${name}_aux.d DESTINATION include/d/${ins_path} COMPONENT qtd RENAME ${name}_aux.di OPTIONAL)
 	    endforeach(d_source ${d_sources})
 	endif(NOT GENERATE_DI_FILES)
 
--- a/build/core.makefile	Sun Aug 30 09:59:12 2009 +0000
+++ b/build/core.makefile	Sun Aug 30 10:59:56 2009 +0000
@@ -5,7 +5,7 @@
 endif
 
 ##--------------------------
-QTD_CORE += QGlobal $(D_PATH)/qtd/Str core/Qt qtd/ArrayOpsPrimitive $(D_PATH)/QtDObject $(D_PATH)/Signal \
+QTD_CORE += QGlobal $(D_PATH)/qtd/Str core/Qt qtd/ArrayOpsPrimitive $(D_PATH)/QtdObject $(D_PATH)/Signal \
 $(D_PATH)/core/QPoint \
 $(D_PATH)/core/QPointF \
 $(D_PATH)/core/QRect \
--- a/build/core.txt	Sun Aug 30 09:59:12 2009 +0000
+++ b/build/core.txt	Sun Aug 30 10:59:56 2009 +0000
@@ -7,13 +7,19 @@
     qt_core/QLine_shell qt_core/QLineF_shell
     qt_core/QRect_shell qt_core/QRectF_shell
     qt_core/QString_shell qt_core/QVariant_shell
-    qt_core/QModelIndex_shell qt_core/QMetaType_shell)
+    qt_core/QModelIndex_shell qt_core/QMetaType_shell
+    qt_core/QMetaObject_shell)
 ## Module specific d files.
-set (d_files QGlobal qtd/Array  
+set (d_files
+    QGlobal
+    qtd/Array  
     qtd/ArrayOpsPrimitive   
-    core/QString core/QMetaType)
+    qtd/Traits
+    core/QString
+    core/QMetaType
+    core/QMetaObject)
 set (d_version_files 
-    QtDObject
+    QtdObject
     Signal qtd/Str
     core/QLine core/QLineF
     core/QModelIndex
--- a/cpp/qt_core/QVariant_shell.cpp	Sun Aug 30 09:59:12 2009 +0000
+++ b/cpp/qt_core/QVariant_shell.cpp	Sun Aug 30 10:59:56 2009 +0000
@@ -857,7 +857,7 @@
     QVariant_QtDShell *__qt_this = (QVariant_QtDShell *) __this_nativeId;
     QString  __qt_return_value = __qt_this->toString();
 
-    _d_toUtf8(__qt_return_value.utf16(), __qt_return_value.size(), __java_return_value);
+    qtd_toUtf8(__qt_return_value.utf16(), __qt_return_value.size(), __java_return_value);
 
 }
 
--- a/cpp/qt_gui/UrlHandler_shell.cpp	Sun Aug 30 09:59:12 2009 +0000
+++ b/cpp/qt_gui/UrlHandler_shell.cpp	Sun Aug 30 10:59:56 2009 +0000
@@ -4,19 +4,19 @@
 
 UrlHandler::UrlHandler(void *d_ptr, QObject*  parent0)
     : QObject(parent0),
-      Qtd_QObjectEntity(d_ptr)
+      QtD_QObjectEntity(this, d_ptr)
 {
 }
 
 #ifdef CPP_SHARED
-extern "C" typedef void (*pfqtd_UrlHandler_handleUrl_QUrl_dispatch)(void *d_entity, void* arg__1);
+extern "C" typedef void (*pfqtd_UrlHandler_handleUrl_QUrl_dispatch)(void *dId, void* arg__1);
 pfqtd_UrlHandler_handleUrl_QUrl_dispatch qtd_UrlHandler_handleUrl_QUrl_dispatch;
 #else
-extern "C" void qtd_UrlHandler_handleUrl_QUrl_dispatch(void *d_entity, void* name1);
+extern "C" void qtd_UrlHandler_handleUrl_QUrl_dispatch(void *dId, void* name1);
 #endif
 void UrlHandler::handleUrl(const QUrl &url)
 {
-    qtd_UrlHandler_handleUrl_QUrl_dispatch(this->d_entity(), &(QUrl& )url);
+    qtd_UrlHandler_handleUrl_QUrl_dispatch(this->dId, &(QUrl& )url);
 }
 
 extern "C" DLL_PUBLIC void qtd_UrlHandler_destructor(void *ptr)
--- a/cpp/qt_gui/UrlHandler_shell.h	Sun Aug 30 09:59:12 2009 +0000
+++ b/cpp/qt_gui/UrlHandler_shell.h	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 #include <QUrl>
 #include <QObjectEntity.h>
 
-class UrlHandler : public QObject, public Qtd_QObjectEntity
+class UrlHandler : public QObject, public QtD_QObjectEntity
 {
     Q_OBJECT
 
--- a/cpp/qt_qtd/ArrayOpsPrimitive_shell.cpp	Sun Aug 30 09:59:12 2009 +0000
+++ b/cpp/qt_qtd/ArrayOpsPrimitive_shell.cpp	Sun Aug 30 10:59:56 2009 +0000
@@ -37,15 +37,15 @@
     QTD_EXPORT_VAR_SET(qtd_allocate_int_array, callbacks[0]);
     QTD_EXPORT_VAR_SET(qtd_assign_int_array_element, callbacks[1]);
     QTD_EXPORT_VAR_SET(qtd_get_int_from_array, callbacks[2]);
-    
+
     QTD_EXPORT_VAR_SET(qtd_allocate_uint_array, callbacks[3]);
     QTD_EXPORT_VAR_SET(qtd_assign_uint_array_element, callbacks[4]);
     QTD_EXPORT_VAR_SET(qtd_get_uint_from_array, callbacks[5]);
-    
+
     QTD_EXPORT_VAR_SET(qtd_allocate_double_array, callbacks[6]);
     QTD_EXPORT_VAR_SET(qtd_assign_double_array_element, callbacks[7]);
     QTD_EXPORT_VAR_SET(qtd_get_double_from_array, callbacks[8]);
-    
+
     QTD_EXPORT_VAR_SET(qtd_allocate_string_array, callbacks[9]);
     QTD_EXPORT_VAR_SET(qtd_assign_string_array_element, callbacks[10]);
     QTD_EXPORT_VAR_SET(qtd_string_from_array, callbacks[11]);
--- a/generator/containergenerator.cpp	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/containergenerator.cpp	Sun Aug 30 10:59:56 2009 +0000
@@ -447,7 +447,7 @@
         d_type = cls_name;
         if (centry->designatedInterface())
             d_type = centry->designatedInterface()->name();
-        nativeId = ".nativeId";
+        nativeId = ".__nativeId";
     }
 
     if (centry->designatedInterface()) {
@@ -470,7 +470,7 @@
       << INDENT << "*elem = arr[pos]" << nativeId << ";" << endl
       << "}" << endl << endl
 
-      << "package " << d_type << " qtd_" << cls_name << "_cpp_to_d(" << cpp_type << " __qt_return_value)" << endl
+      << "package " << d_type << " qtd_" << cls_name << "_cpp_to_d(" << cpp_type << " ret)" << endl
       << "{" << endl;
 
     marshallFromCppToD(s, centry);
--- a/generator/cppheadergenerator.cpp	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/cppheadergenerator.cpp	Sun Aug 30 10:59:56 2009 +0000
@@ -178,13 +178,15 @@
 
     s << "class " << shellClassName(java_class)
       << " : public " << java_class->qualifiedCppName();
-    if (java_class->hasVirtualFunctions())
-        s << ", public Qtd_QObjectEntity";
+    if (java_class->isQObject())
+        s << ", public QtD_QObjectEntity";
+    else if(java_class->hasVirtualFunctions())
+        s << ", public QtD_Entity";
     s << endl  << "{" << endl;
 
     if (java_class->isQObject()) {
       s << "public:" << endl
-        << "  Q_OBJECT_CHECK" << endl;
+        << "  Q_OBJECT_CHECK" << endl
 //        << "  mutable const QMetaObject *m_meta_object;" << endl;
 
 /*      if (java_class->hasVirtualSlots()) {
@@ -193,9 +195,9 @@
 */
 //      s << "  const QMetaObject *metaObject() const;" << endl
 //        << "  void *qt_metacast(const char *);" << endl
-//        << "  QT_TR_FUNCTIONS" << endl
-//        << "  virtual int qt_metacall(QMetaObject::Call, int, void **);" << endl
-      s << "private:" << endl;
+//        << "  QT_TR_FUNCTIONS" << end
+      << "  virtual int qt_metacall(QMetaObject::Call, int, void **);" << endl
+      << "private:" << endl;
     }
 
 
--- a/generator/fileout.h	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/fileout.h	Sun Aug 30 10:59:56 2009 +0000
@@ -71,7 +71,6 @@
     static bool dummy;
     static bool diff;
 
- private:
     bool isDone;
 };
 
--- a/generator/typesystem_core-java.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_core-java.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<typesystem package="qt.core" default-superclass="QtDObject">
+<typesystem package="qt.core" default-superclass="QtdObject">
     <inject-code>
     qt.Utilities.loadQtLibrary("QtCore");
     </inject-code>
--- a/generator/typesystem_gui-java.java	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_gui-java.java	Sun Aug 30 10:59:56 2009 +0000
@@ -170,20 +170,20 @@
 
     @QtBlockedSlot
     public final QPolygon add(int x, int y) {
-        add_private(nativeId(), x, y);
+        add_private(__nativeId(), x, y);
         return this;
     }
 
     @QtBlockedSlot
     public final QPolygon add(QPoint pt) {
-        add_private(nativeId(), pt.x(), pt.y());
+        add_private(__nativeId(), pt.x(), pt.y());
         return this;
     }
 
     @QtBlockedSlot
     public final QPolygon add(QPolygon p) {
         int size = p.size();
-        long nid = nativeId();
+        long nid = __nativeId();
         for (int i = 0; i < size; ++i) {
             QPoint pt = p.at(i);
             add_private(nid, pt.x(), pt.y());
@@ -199,20 +199,20 @@
 
     @QtBlockedSlot
     public final QPolygonF add(double x, double y) {
-        add_private(nativeId(), x, y);
+        add_private(__nativeId(), x, y);
         return this;
     }
 
     @QtBlockedSlot
     public final QPolygonF add(QPointF pt) {
-        add_private(nativeId(), pt.x(), pt.y());
+        add_private(__nativeId(), pt.x(), pt.y());
         return this;
     }
 
     @QtBlockedSlot
     public final QPolygonF add(QPolygonF p) {
         int size = p.size();
-        long nid = nativeId();
+        long nid = __nativeId();
         for (int i = 0; i < size; ++i) {
             QPointF pt = p.at(i);
             add_private(nid, pt.x(), pt.y());
@@ -859,14 +859,14 @@
     public static string getOpenFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) {
         string res;
         string _selectedFilter = "";
-        qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.nativeId, caption, dir, filter, _selectedFilter, 0);
+        qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.__nativeId, caption, dir, filter, _selectedFilter, 0);
         return res;
     }
     
     public static string getSaveFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) {
         string res;
         string _selectedFilter = "";
-        qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.nativeId, caption, dir, filter, _selectedFilter, 0);
+        qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.__nativeId, caption, dir, filter, _selectedFilter, 0);
         return res;
     }
     
@@ -1013,51 +1013,51 @@
     }
     
     public final void drawConvexPolygon(in QPoint[] points) {
-        qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(nativeId, points.ptr, points.length);
+        qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(__nativeId, points.ptr, points.length);
     }
     
     public final void drawConvexPolygon(in QPointF[] points) {
-        qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(nativeId, points.ptr, points.length);
+        qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(__nativeId, points.ptr, points.length);
     }
     
     public final void drawLines(in QLine[] lines) {
-        qtd_QPainter_drawLines_nativepointerQLine_int(nativeId, lines.ptr, lines.length);
+        qtd_QPainter_drawLines_nativepointerQLine_int(__nativeId, lines.ptr, lines.length);
     }
 
     public final void drawLines(in QLineF[] lines) {
-        qtd_QPainter_drawLines_nativepointerQLineF_int(nativeId, lines.ptr, lines.length);
+        qtd_QPainter_drawLines_nativepointerQLineF_int(__nativeId, lines.ptr, lines.length);
     }
     
     public final void drawPolygon(in QPoint[] points, Qt_FillRule fillRule = Qt_FillRule.OddEvenFill) {
-        qtd_QPainter_drawPolygon_nativepointerQPoint_int_FillRule(nativeId, points.ptr, points.length, fillRule);
+        qtd_QPainter_drawPolygon_nativepointerQPoint_int_FillRule(__nativeId, points.ptr, points.length, fillRule);
     }
 
     public final void drawPolygon(in QPointF[] points, Qt_FillRule fillRule = Qt_FillRule.OddEvenFill) {
-        qtd_QPainter_drawPolygon_nativepointerQPointF_int_FillRule(nativeId, points.ptr, points.length, fillRule);
+        qtd_QPainter_drawPolygon_nativepointerQPointF_int_FillRule(__nativeId, points.ptr, points.length, fillRule);
     }
 
     public final void drawPolyline(in QPoint[] points) {
-        qtd_QPainter_drawPolyline_nativepointerQPoint_int(nativeId, points.ptr, points.length);
+        qtd_QPainter_drawPolyline_nativepointerQPoint_int(__nativeId, points.ptr, points.length);
     }
 
     public final void drawPolyline(in QPointF[] points) {
-        qtd_QPainter_drawPolyline_nativepointerQPointF_int(nativeId, points.ptr, points.length);
+        qtd_QPainter_drawPolyline_nativepointerQPointF_int(__nativeId, points.ptr, points.length);
     }
     
     public final void drawPoints(in QPoint[] points) {
-        qtd_QPainter_drawPoints_nativepointerQPoint_int(nativeId, points.ptr, points.length);
+        qtd_QPainter_drawPoints_nativepointerQPoint_int(__nativeId, points.ptr, points.length);
     }
 
     public final void drawPoints(in QPointF[] points) {
-        qtd_QPainter_drawPoints_nativepointerQPointF_int(nativeId, points.ptr, points.length);
+        qtd_QPainter_drawPoints_nativepointerQPointF_int(__nativeId, points.ptr, points.length);
     }
     
     public final void drawRects(in QRect[] rects) {
-        qtd_QPainter_drawRects_nativepointerQRect_int(nativeId, rects.ptr, rects.length);
+        qtd_QPainter_drawRects_nativepointerQRect_int(__nativeId, rects.ptr, rects.length);
     }
 
     public final void drawRects(in QRectF[] rects) {
-        qtd_QPainter_drawRects_nativepointerQRectF_int(nativeId, rects.ptr, rects.length);
+        qtd_QPainter_drawRects_nativepointerQRectF_int(__nativeId, rects.ptr, rects.length);
     }
 /*
     public static QPaintDeviceInterface redirected(QPaintDeviceInterface device, qt.core.QPoint offset) {
@@ -1689,25 +1689,25 @@
 
 class QInputDialog___ extends QInputDialog {
     public static double getDouble(QWidget _parent, string title, string label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, ref bool ok = false, int flags = 0) {
-        return qtd_QInputDialog_getDouble_private_QWidget_string_string_double_double_double_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.nativeId, title, label, value, minValue, maxValue, decimals, &ok, flags);
+        return qtd_QInputDialog_getDouble_private_QWidget_string_string_double_double_double_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.__nativeId, title, label, value, minValue, maxValue, decimals, &ok, flags);
     }
     
     static if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
     {
 	public static int getInt(QWidget _parent, string title, string label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, ref bool ok = false, int flags = 0) {
-	    return qtd_QInputDialog_getInt_private_QWidget_string_string_int_int_int_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.nativeId, title, label, value, minValue, maxValue, step, &ok, flags);
+            return qtd_QInputDialog_getInt_private_QWidget_string_string_int_int_int_int_nativepointerbool_WindowFlags(_parent is null ? null : _parent.__nativeId, title, label, value, minValue, maxValue, step, &ok, flags);
 	}
     }
 
     public static string getItem(QWidget _parent, string title, string label, string[] items, int current = 0, bool editable = true, ref bool ok = false, int flags = 0) {
         string res;
-        qtd_QInputDialog_getItem_private_QWidget_string_string_List_int_bool_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.nativeId, title, label, items.ptr, items.length, current, editable, &ok, flags);
+        qtd_QInputDialog_getItem_private_QWidget_string_string_List_int_bool_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.__nativeId, title, label, items.ptr, items.length, current, editable, &ok, flags);
         return res;
     }
 
     public static string getText(QWidget _parent, string title, string label, QLineEdit_EchoMode echo = QLineEdit_EchoMode.Normal, string text = null, ref bool ok = false, int flags = 0) {
         string res;
-        qtd_QInputDialog_getText_private_QWidget_string_string_EchoMode_string_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.nativeId, title, label, echo, text, &ok, flags);
+        qtd_QInputDialog_getText_private_QWidget_string_string_EchoMode_string_nativepointerbool_WindowFlags(&res, _parent is null ? null : _parent.__nativeId, title, label, echo, text, &ok, flags);
         return res;
     }
 }// class
@@ -1716,7 +1716,7 @@
     version(D_Version2) 
     {
 	void opAssign(in QFont arg__1)  {
-	    this.nativeId = qtd_QFont_QFont_QFont(arg__1 is null ? null : (cast(QFont)arg__1).nativeId);
+            this.__nativeId = qtd_QFont_QFont_QFont(arg__1 is null ? null : (cast(QFont)arg__1).__nativeId);
 	}
     }
 }// class"
--- a/generator/typesystem_gui-java.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_gui-java.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<typesystem package="qt.gui" default-superclass="QtDObject">
+<typesystem package="qt.gui" default-superclass="QtdObject">
     <inject-code>
         qt.Utilities.loadQtLibrary("QtGui");
     </inject-code>
--- a/generator/typesystem_gui.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_gui.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<typesystem package="qt.gui" default-superclass="QtDObject">
+<typesystem package="qt.gui" default-superclass="QtdObject">
 <depend package="qt.core" />
 <inject-code>
         qt.Utilities.loadQtLibrary("QtGui");
@@ -7,7 +7,7 @@
 
 <template name="gui.class_from_variant_java">
     public this(QVariant arg__1) {
-        void* __qt_return_value = qtd_%CLASS_NAME_%CLASS_NAME_QVariant(cast(void*) this, arg__1 is null ? null : arg__1.nativeId);
+        void* __qt_return_value = qtd_%CLASS_NAME_%CLASS_NAME_QVariant(cast(void*) this, arg__1 is null ? null : arg__1.__nativeId);
         super(__qt_return_value);
     }
 </template>
@@ -1138,11 +1138,11 @@
     
     <inject-code class="java">
     public final void insert(int i, QPoint t) {
-        qtd_QPolygon_insert_int_QPoint(nativeId, i, t);
+        qtd_QPolygon_insert_int_QPoint(__nativeId, i, t);
     }
     
     public final void insert(int i, int n, QPoint t) {
-        qtd_QPolygon_insert_int_int_QPoint(nativeId, i, n, t);
+        qtd_QPolygon_insert_int_int_QPoint(__nativeId, i, n, t);
     }
     </inject-code>
     <inject-code class="java-free">
@@ -1223,11 +1223,11 @@
 		-->
     <inject-code class="java">
     public final void insert(int i, QPointF t) {
-        qtd_QPolygonF_insert_int_QPointF(nativeId, i, t);
+        qtd_QPolygonF_insert_int_QPointF(__nativeId, i, t);
     }
 
     public final void insert(int i, int n, QPointF t) {
-        qtd_QPolygonF_insert_int_int_QPointF(nativeId, i, n, t);
+        qtd_QPolygonF_insert_int_int_QPointF(__nativeId, i, n, t);
     }
     </inject-code>
     <inject-code class="java-free">
@@ -5772,7 +5772,7 @@
                 qt.GeneratorUtilities.threadCheck(this);
                 if (nativeId() == 0)
                     throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
-                __qt_QMessageBox_setWindowModality(nativeId(), %1.value());
+                __qt_QMessageBox_setWindowModality(__nativeId(), %1.value());
                 return ;
             }
             </inject-code>
--- a/generator/typesystem_network-java.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_network-java.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<typesystem package="qt.network" default-superclass="QtDObject">
+<typesystem package="qt.network" default-superclass="QtdObject">
     <inject-code>
         qt.Utilities.loadQtLibrary("QtNetwork");
     </inject-code>
--- a/generator/typesystem_network.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_network.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<typesystem package="qt.network" default-superclass="QtDObject">
+<typesystem package="qt.network" default-superclass="QtdObject">
 <inject-code>
         qt.Utilities.loadQtLibrary("QtNetwork");
     </inject-code>
--- a/generator/typesystem_opengl-java.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_opengl-java.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<typesystem package="qt.opengl" default-superclass="QtDObject">
+<typesystem package="qt.opengl" default-superclass="QtdObject">
   <inject-code>
     qt.Utilities.loadQtLibrary("QtGui");
     qt.Utilities.loadQtLibrary("QtOpenGL");
--- a/generator/typesystem_opengl.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_opengl.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet type="text/xsl" href="merge.xsl"?>
 
-<typesystem package="qt.opengl" default-superclass="QtDObject">
+<typesystem package="qt.opengl" default-superclass="QtdObject">
 <depend package="qt.core" />
 <depend package="qt.gui" />
 <inject-code>
--- a/generator/typesystem_sql.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_sql.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<typesystem package="qt.sql" default-superclass="qt.QtDObject">
+<typesystem package="qt.sql" default-superclass="qt.QtdObject">
 <inject-code>
         qt.Utilities.loadQtLibrary("QtSql");
     </inject-code>
--- a/generator/typesystem_svg-java.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_svg-java.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,4 +1,4 @@
-<typesystem package="qt.svg" default-superclass="QtDObject">
+<typesystem package="qt.svg" default-superclass="QtdObject">
     <inject-code>
         qt.Utilities.loadQtLibrary("QtXml");
         qt.Utilities.loadQtLibrary("QtGui");
--- a/generator/typesystem_svg.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_svg.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<typesystem package="qt.svg" default-superclass="QtDObject">
+<typesystem package="qt.svg" default-superclass="QtdObject">
 <inject-code>
         qt.Utilities.loadQtLibrary("QtXml");
         qt.Utilities.loadQtLibrary("QtGui");
--- a/generator/typesystem_webkit-java.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_webkit-java.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<typesystem package="qt.webkit" default-superclass="QtDObject">
+<typesystem package="qt.webkit" default-superclass="QtdObject">
     <inject-code>
     qt.Utilities.loadQtLibrary("QtGui");
     qt.Utilities.loadQtLibrary("QtNetwork");
--- a/generator/typesystem_webkit.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_webkit.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<typesystem package="qt.webkit" default-superclass="QtDObject">
+<typesystem package="qt.webkit" default-superclass="QtdObject">
 <inject-code>
     qt.Utilities.loadQtLibrary("QtGui");
     qt.Utilities.loadQtLibrary("QtNetwork");
--- a/generator/typesystem_xml.xml	Sun Aug 30 09:59:12 2009 +0000
+++ b/generator/typesystem_xml.xml	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet type="text/xsl" href="merge.xsl"?>
 
-<typesystem package="qt.xml" default-superclass="QtDObject">
+<typesystem package="qt.xml" default-superclass="QtdObject">
 <inject-code>
         com.trolltech.qt.Utilities.loadQtLibrary("QtXml");
     </inject-code>
--- a/include/QObjectEntity.h	Sun Aug 30 09:59:12 2009 +0000
+++ b/include/QObjectEntity.h	Sun Aug 30 10:59:56 2009 +0000
@@ -1,16 +1,49 @@
 #ifndef QQOBJECTENTITY_H
 #define QQOBJECTENTITY_H
 
-#include <cstdlib>
+#include "qtd_core.h"
+#include <qobject.h>
+#include <iostream>
 
-class Qtd_QObjectEntity
+QTD_EXPORT(void, qtd_delete_d_qobject, (void* dPtr))
+
+#ifdef CPP_SHARED
+#define qtd_delete_d_qobject qtd_get_qtd_delete_d_qobject()
+#endif
+
+//TODO: user data ID must be registered with QObject::registerUserData;
+#define userDataId 0
+
+class QtD_QObjectEntity : public QtD_Entity, public QObjectUserData
 {
 public:
-	Qtd_QObjectEntity(void *d_ptr) { _d_ptr = d_ptr; }
-	void *d_entity() const { return _d_ptr; }
 
-private:
-	void *_d_ptr;
+    QtD_QObjectEntity(QObject *qObject, void *dId) : QtD_Entity(dId)
+    {
+        qObject->setUserData(userDataId, this);
+    }
+
+    virtual ~QtD_QObjectEntity()
+    {        
+        if (dId)
+            destroyEntity();     
+    }
+    
+    inline void destroyEntity(QObject *qObject = NULL)
+    {
+        Q_ASSERT(dId);
+        qtd_delete_d_qobject(dId);
+        if (qObject)
+        {
+            qObject->setUserData(userDataId, NULL);
+            dId = NULL;
+        }
+    }
+
+    inline static QtD_QObjectEntity* getQObjectEntity(const QObject *qObject)
+    {
+        return static_cast<QtD_QObjectEntity*>(qObject->userData(userDataId));
+    }
 };
 
 #endif // QQOBJECTENTITY_H
--- a/include/qtd_core.h	Sun Aug 30 09:59:12 2009 +0000
+++ b/include/qtd_core.h	Sun Aug 30 10:59:56 2009 +0000
@@ -21,16 +21,16 @@
 #endif
 
 #ifdef CPP_SHARED
-  #define QTD_EXPORT(TYPE, NAME, ARGS)      \
+  #define QTD_EXPORT(TYPE, NAME, ARGS) \
     extern "C" typedef TYPE (*pf_##NAME)ARGS; \
     extern "C" pf_##NAME qtd_get_##NAME();
   #define QTD_EXPORT_VAR(NAME) \
     pf_##NAME m_##NAME;        \
     extern "C" DLL_PUBLIC pf_##NAME qtd_get_##NAME() { return m_##NAME; }
-  #define QTD_EXPORT_VAR_SET(NAME, VALUE) \
+#define QTD_EXPORT_VAR_SET(NAME, VALUE) \
     m_##NAME = (pf_##NAME) VALUE
 #else
-  #define QTD_EXPORT(TYPE, NAME, ARGS)      \
+  #define QTD_EXPORT(TYPE, NAME, ARGS) \
     extern "C" TYPE NAME ARGS;
 #endif
 
@@ -46,7 +46,23 @@
     void* ptr;
 };
 
-const uint USER_DATA_ID = 0;
+enum QtdObjectFlags
+{
+    qNone,
+    qNativeOwnership            = 0x01,
+    qDOwnership                 = 0x02
+    //gcManaged                 = 0x04
+};
+
+class QtD_Entity
+{
+public:
+    void* dId;
+
+    QtD_Entity(void* id) : dId(id)
+    {
+    }
+};
 
 #define Array DArray
 
@@ -54,15 +70,17 @@
 typedef void (*pfunc_abstr)();
 #endif
 
-QTD_EXPORT(void, _d_toUtf8, (const unsigned short* arr, uint size, void* str))
-QTD_EXPORT(void, __qtd_dummy, ())
+QTD_EXPORT(void, qtd_toUtf8, (const unsigned short* arr, uint size, void* str))
+QTD_EXPORT(void, qtd_dummy, ())
 
 #ifdef CPP_SHARED
-#define _d_toUtf8 qtd_get__d_toUtf8()
-#define __qtd_dummy qtd_get___qtd_dummy()
+#define qtd_toUtf8 qtd_get_qtd_toUtf8()
+#define qtd_dummy qtd_get_qtd_dummy()
 #endif
 
 extern "C" QModelIndex qtd_to_QModelIndex(QModelIndexAccessor mia);
 extern "C" QModelIndexAccessor qtd_from_QModelIndex(const QModelIndex &index);
 
+
+
 #endif // QTD_CORE_H
--- a/qt/CMakeLists.txt	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/CMakeLists.txt	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 project (qt_d D)
 
 set(QT_SRCS_D
-QtDObject.d
+QtdObject.d
 QGlobal.d
 
 core/QChildEvent.d
--- a/qt/QDefines.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/QDefines.d	Sun Aug 30 10:59:56 2009 +0000
@@ -1,4 +1,4 @@
-module qt.QDefines;
-
-const char[] QT_VERSION_STR = "4.5.0";
-const int QT_VERSION = 0x040403;
\ No newline at end of file
+module qt.QDefines;
+
+const char[] QT_VERSION_STR = "4.5.1";
+const int QT_VERSION = 263425;
--- a/qt/QGlobal.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/QGlobal.d	Sun Aug 30 10:59:56 2009 +0000
@@ -20,6 +20,11 @@
                    core.memory;
 }
 
+T static_cast(T, U)(U obj)
+{
+    return cast(T)cast(void*)obj;
+}
+
 template QT_BEGIN_NAMESPACE() {
 }
 
@@ -35,13 +40,21 @@
 mixin QT_BEGIN_HEADER;
 mixin QT_BEGIN_NAMESPACE;
 
-extern(C) void __qtd_dummy() {}
+//TODO: this sucks
+extern(C) void qtd_dummy() {}
+// Defined in QObject.d
+extern(C) void qtd_delete_d_qobject(void* dPtr);
 
 version(cpp_shared)
 {
-    extern (C) void __qtd_qtd_core_initCallBacks(void* toUtf8, void* dummy);
+    extern (C) void qtd_core_initCallBacks(void* toUtf8, void* dummy);
     static this() {
-        __qtd_qtd_core_initCallBacks(&_d_toUtf8, &__qtd_dummy);
+        qtd_core_initCallBacks(&qtd_toUtf8, &qtd_dummy);
+    }
+
+    extern (C) void qtd_QObjectEntity_initCallBacks(void* del_d_obj);
+    static this() {
+        qtd_QObjectEntity_initCallBacks(&qtd_delete_d_qobject);
     }
 }
 
@@ -694,6 +707,7 @@
     const InterfaceCountImpl = TInterfaces.length;
 }
 
+/+
 scope class StackObject(C)
 {
     byte[InstanceSize!(C)] data;
@@ -719,6 +733,7 @@
         }
     }
 }
++/
 
 mixin QT_END_HEADER;
 
--- a/qt/d1/qt/core/QLine.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/core/QLine.d	Sun Aug 30 10:59:56 2009 +0000
@@ -28,68 +28,68 @@
         ln.pt2 = QPoint(x2pos, y2pos);
         return ln;
     }
-    
+
     bool isNull() // const
     {
         return pt1 == pt2;
     }
-    
+
     int x1() // const
     {
         return pt1.x();
     }
-    
+
     int y1() // const
     {
         return pt1.y();
     }
-    
+
     int x2() // const
     {
         return pt2.x();
     }
-    
+
     int y2() // const
     {
         return pt2.y();
     }
-    
+
     QPoint p1() // const
     {
         return pt1;
     }
-    
+
     QPoint p2() // const
     {
         return pt2;
     }
-    
+
     int dx() // const
     {
         return pt2.x() - pt1.x();
     }
-    
+
     int dy() // const
     {
         return pt2.y() - pt1.y();
     }
-    
+
     void translate(in QPoint point)
     {
         pt1 += point;
         pt2 += point;
     }
-    
+
     void translate(int adx, int ady)
     {
         translate(QPoint(adx, ady));
     }
-    
+
     QLine translated(in QPoint p) // const
     {
         return QLine(pt1 + p, pt2 + p);
     }
-    
+
     QLine translated(int adx, int ady) // const
     {
         return translated(QPoint(adx, ady));
@@ -109,35 +109,35 @@
     {
         pt1 = aP1;
     }
-    
+
     void setP2(in QPoint aP2) // for convenience
     {
         pt2 = aP2;
     }
-    
+
     void setPoints(in QPoint aP1, in QPoint aP2)
     {
         pt1 = aP1;
         pt2 = aP2;
     }
-    
+
     void setLine(int aX1, int aY1, int aX2, int aY2)
     {
         pt1 = QPoint(aX1, aY1);
         pt2 = QPoint(aX2, aY2);
     }
-    
+
     bool opEquals(in QLine d) // const
     {
         return pt1 == d.pt1 && pt2 == d.pt2;
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QLine_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLine_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QLine_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLine_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
 private:
@@ -153,112 +153,112 @@
 
 public struct QLineF
 {
-    
+
     alias QLineF_IntersectType IntersectType;
-    
+
     alias QLineF_IntersectType.NoIntersection NoIntersection;
     alias QLineF_IntersectType.BoundedIntersection BoundedIntersection;
     alias QLineF_IntersectType.UnboundedIntersection UnboundedIntersection;
-    
+
     public static QLineF opCall() {
         QLineF ln;
         ln.pt1 = QPointF();
         ln.pt2 = QPointF();
         return ln;
     }
-    
+
     public static QLineF opCall(in QPointF apt1, in QPointF apt2) {
         QLineF ln;
         ln.pt1 = apt1;
         ln.pt2 = apt2;
         return ln;
     }
-    
+
     public static QLineF opCall(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos) {
         QLineF ln;
         ln.pt1 = QPointF(x1pos, y1pos);
         ln.pt2 = QPointF(x2pos, y2pos);
         return ln;
     }
-    
-    public static QLineF opCall(in QLine line){ 
+
+    public static QLineF opCall(in QLine line){
         QLineF ln;
         ln.pt1 = QPointF(line.p1());
         ln.pt2 = QPointF(line.p2());
         return ln;
     }
-    
+
     public final bool isNull() // const
     {
         return qtd_QLineF_isNull(this);
     }
-    
+
     qreal x1() // const
     {
         return pt1.x();
     }
-    
+
     qreal y1() // const
     {
         return pt1.y();
     }
-    
+
     qreal x2() // const
     {
         return pt2.x();
     }
-    
+
     qreal y2() // const
     {
         return pt2.y();
     }
-    
+
     QPointF p1() // const
     {
         return pt1;
     }
-    
+
     QPointF p2() // const
     {
         return pt2;
     }
-    
+
     qreal dx() // const
     {
         return pt2.x() - pt1.x();
     }
-    
+
     qreal dy() // const
     {
         return pt2.y() - pt1.y();
     }
-    
+
     QLineF normalVector() // const
     {
         return QLineF(p1(), p1() + QPointF(dy(), -dx()));
     }
-    
+
     void translate(in QPointF point)
     {
         pt1 += point;
         pt2 += point;
     }
-    
+
     void translate(qreal adx, qreal ady)
     {
         this.translate(QPointF(adx, ady));
     }
-    
+
     QLineF translated(in QPointF p) // const
     {
         return QLineF(pt1 + p, pt2 + p);
     }
-    
+
     QLineF translated(qreal adx, qreal ady) // const
     {
         return translated(QPointF(adx, ady));
     }
-    
+
     void setLength(qreal len)
     {
         if (isNull())
@@ -266,7 +266,7 @@
         QLineF v = unitVector();
         pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
     }
-    
+
     void length(qreal len)
     {
         if (isNull())
@@ -274,97 +274,97 @@
         QLineF v = unitVector();
         pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
     }
-    
+
     QPointF pointAt(qreal t) // const
     {
         qreal vx = pt2.x() - pt1.x();
         qreal vy = pt2.y() - pt1.y();
         return QPointF(pt1.x() + vx * t, pt1.y() + vy * t);
     }
-    
+
     QLine toLine() // const
     {
         return QLine(pt1.toPoint(), pt2.toPoint());
     }
-    
+
     void setP1(in QPointF aP1)
     {
         pt1 = aP1;
     }
-    
+
     void setP2(in QPointF aP2)
     {
         pt2 = aP2;
     }
-    
+
     void p1(in QPointF aP1)
     {
         pt1 = aP1;
     }
-    
+
     void p2(in QPointF aP2)
     {
         pt2 = aP2;
     }
-    
+
     void setPoints(in QPointF aP1, in QPointF aP2)
     {
         pt1 = aP1;
         pt2 = aP2;
     }
-    
+
     void setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2)
     {
         pt1 = QPointF(aX1, aY1);
         pt2 = QPointF(aX2, aY2);
     }
-    
+
     bool opEquals(in QLineF d) // const
     {
         return pt1 == d.pt1 && pt2 == d.pt2;
     }
-    
+
     public final double angle() {
         return qtd_QLineF_angle(this);
     }
-    
+
     public final double angle(in QLineF l) {
         return qtd_QLineF_angle_QLineF(this, &l);
     }
-    
+
     public final double angleTo(in QLineF l) {
         return qtd_QLineF_angleTo_QLineF(this, &l);
     }
-    
+
     // ### Qt 5: rename intersects() or intersection() and rename IntersectType IntersectionType
     private final QLineF_IntersectType intersect(in QLineF l, QPointF* intersectionPoint) {
         return cast(QLineF_IntersectType) qtd_QLineF_intersect_QLineF_nativepointerQPointF(this, &l, intersectionPoint);
     }
-    
+
     public final double length() {
         return qtd_QLineF_length(this);
     }
-    
+
     public final void writeTo(QDataStream arg__1) {
-        qtd_QLineF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLineF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
     public final void readFrom(QDataStream arg__1) {
-        qtd_QLineF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLineF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
     public final void setAngle(double angle) {
         qtd_QLineF_setAngle_double(this, angle);
     }
-    
+
     public final QLineF unitVector() {
         return qtd_QLineF_unitVector(this);
     }
-    
+
     public static QLineF fromPolar(double length, double angle) {
         return qtd_QLineF_fromPolar_double_double(length, angle);
     }
-    
+
     private:
         QPointF pt1, pt2;
 }
--- a/qt/d1/qt/core/QModelIndex.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/core/QModelIndex.d	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 module qt.core.QModelIndex;
 
 public import qt.QGlobal;
-private import qt.QtDObject;
+private import qt.QtdObject;
 
 // automatic imports-------------
 private import qt.core.QVariant;
@@ -35,7 +35,7 @@
 
     public final QVariant data(int role = 0) {
         void* __qt_return_value = __qtd_QModelIndex_data_int(this, role);
-        return new QVariant(__qt_return_value, false);
+        return new QVariant(__qt_return_value);
     }
 
     public final int flags() {
@@ -64,7 +64,7 @@
         void* __qt_return_value = m;
         if (__qt_return_value is null)
             return null;
-        void* d_obj = __QObject_entity(__qt_return_value);
+        void* d_obj = qtd_get_d_qobject(__qt_return_value);
         return cast(QAbstractItemModel) d_obj;
     }
 
--- a/qt/d1/qt/core/QPoint.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/core/QPoint.d	Sun Aug 30 10:59:56 2009 +0000
@@ -61,7 +61,7 @@
 
     QPoint opMulAssign(qreal c)
     { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
-    
+
     bool opEquals(in QPoint p)
     { return xp == p.xp && yp == p.yp; }
 
@@ -70,7 +70,7 @@
 
     QPoint opSub(in QPoint p)
     { return QPoint(this.xp-p.xp, this.yp-p.yp); }
-    
+
     QPoint opMul(qreal c)
     { return QPoint(qRound(this.xp*c), qRound(this.yp*c)); }
 
@@ -87,11 +87,11 @@
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QPoint_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPoint_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QPoint_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPoint_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
 private:
@@ -116,46 +116,46 @@
         pt.xp = pt.yp = 0;
         return pt;
     }
-    
+
     public static QPointF opCall(qreal xpos, qreal ypos) {
         QPointF pt;
         pt.xp = xpos;
         pt.yp = ypos;
         return pt;
     }
-    
+
     public static QPointF opCall(in QPoint p) {
         QPointF pt;
         pt.xp = p.x();
         pt.yp = p.y();
         return pt;
     }
-    
+
     bool isNull() //const
     {
         return qIsNull(xp) && qIsNull(yp);
     }
-    
+
     qreal x() //const
     {
         return xp;
     }
-    
+
     qreal y() //const
     {
         return yp;
     }
-    
+
     void x(qreal xpos)
     {
         xp = xpos;
     }
-    
+
     void y(qreal ypos)
     {
         yp = ypos;
     }
-/*    
+/*
 inline qreal &QPointF::rx()
 {
         return xp;
@@ -166,53 +166,53 @@
     return yp;
 }
 */
-    
+
     QPointF opAddAssign(in QPointF p)
     { xp+=p.xp; yp+=p.yp; return *this; }
-    
+
     QPointF opSubAssign(in QPointF p)
     { xp-=p.xp; yp-=p.yp; return *this; }
-    
+
     QPointF opMulAssign(qreal c)
     { xp*=c; yp*=c; return *this; }
-    
+
     bool opEquals(in QPointF p)
     { return qFuzzyCompare(xp, p.xp) && qFuzzyCompare(yp, p.yp); }
-    
+
     QPointF opAdd(in QPointF p)
     { return QPointF(this.xp+p.xp, this.yp+p.yp); }
-    
+
     QPointF opSub(in QPointF p)
     { return QPointF(this.xp-p.xp, this.yp-p.yp); }
-    
+
     QPointF opMul(qreal c)
     { return QPointF(this.xp*c, this.yp*c); }
-    
+
     QPointF opDivAssign(qreal c)
     {
         xp/=c;
         yp/=c;
         return *this;
     }
-    
+
     QPointF opDiv(qreal c)
     {
         return QPointF(xp/c, yp/c);
     }
-    
+
     QPoint toPoint() //const
     {
         return QPoint(qRound(xp), qRound(yp));
     }
-    
+
     public final void writeTo(QDataStream arg__1) {
-        qtd_QPointF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPointF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
     public final void readFrom(QDataStream arg__1) {
-        qtd_QPointF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPointF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
 private:
     qreal xp;
     qreal yp;
--- a/qt/d1/qt/core/QRect.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/core/QRect.d	Sun Aug 30 10:59:56 2009 +0000
@@ -313,11 +313,11 @@
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QRect_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRect_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QRect_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRect_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final QRect opAnd(in QRect r) {
@@ -335,7 +335,7 @@
     public final bool contains(QRect r, bool proper = false) {
         return qtd_QRect_contains_QRect_bool(this, &r, proper);
     }
-    
+
     public final bool intersects(QRect r) {
         return qtd_QRect_intersects_QRect(this, &r);
     }
@@ -343,7 +343,7 @@
     public final QRect normalized() {
         return qtd_QRect_normalized(this);
     }
-    
+
 private:
     version(OSX)
     {
--- a/qt/d1/qt/core/QRectF.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/core/QRectF.d	Sun Aug 30 10:59:56 2009 +0000
@@ -18,7 +18,7 @@
         rt.w = rt.h = 0.;
         return rt;
     }
-    
+
     public static QRectF opCall(qreal aleft, qreal atop, qreal awidth, qreal aheight)
     {
         QRectF rt;
@@ -76,28 +76,28 @@
 
     qreal left() // const
     { return xp; }
-    
+
     qreal top() // const
     { return yp; }
-    
+
     qreal right() // const
     { return xp + w; }
-    
+
     qreal bottom() // const
     { return yp + h; }
-    
+
     QPointF topLeft() // const
     { return QPointF(xp, yp); }
-    
+
     QPointF bottomRight() // const
     { return QPointF(xp+w, yp+h); }
-    
+
     QPointF topRight() // const
     { return QPointF(xp+w, yp); }
-    
+
     QPointF bottomLeft() // const
     { return QPointF(xp, yp+h); }
-    
+
     void setLeft(qreal pos) { qreal diff = pos - xp; xp += diff; w -= diff; }
 
     void setRight(qreal pos) { w = pos - xp; }
@@ -235,7 +235,7 @@
         w = s.width();
         h = s.height();
     }
-    
+
     bool contains(qreal ax, qreal ay) // conts
     {
         return contains(QPointF(ax, ay));
@@ -295,11 +295,11 @@
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QRectF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRectF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QRectF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRectF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final QRectF opOr(in QRectF r) {
--- a/qt/d1/qt/core/QVariant.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/core/QVariant.d	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 module qt.core.QVariant;
 
 public import qt.QGlobal;
-private import qt.QtDObject;
+private import qt.QtdObject;
 private import qt.core.QMetaType;
 
 // automatic imports-------------
@@ -33,7 +33,7 @@
 }
 
 
-public class QVariant : QtDObject
+public class QVariant : QtdObject
 {
     enum Type {
         Invalid = 0,
@@ -93,7 +93,7 @@
 
         LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
     }
-    
+
 // Functions
 
     private template getMetaId()
@@ -103,7 +103,7 @@
 	    if(i <= 0)
 		i = qRegisterMetaType!(T)(name);";
     }
-	
+
     static public QVariant fromValue(T)(T obj)
     {
 	QVariant var;
@@ -131,7 +131,7 @@
 	}
 	return var;
     }
-    
+
     static public QVariant opCall(T)(T obj)
     {
 	return fromValue(obj);
@@ -144,7 +144,7 @@
 
 
     public this(QDataStream s) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.__nativeId);
         super(__qt_return_value);
     }
 
@@ -162,25 +162,25 @@
 
 
     public this(QBitArray bitarray) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QByteArray bytearray) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QDate date) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QDateTime datetime) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.__nativeId);
         super(__qt_return_value);
     }
 
@@ -204,7 +204,7 @@
 
 
     public this(QLocale locale) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.__nativeId);
         super(__qt_return_value);
     }
 
@@ -234,7 +234,7 @@
 
 
     public this(QRegExp regExp) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.__nativeId);
         super(__qt_return_value);
     }
 
@@ -252,19 +252,19 @@
 
 
     public this(QTime time) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QUrl url) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QVariant other) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.__nativeId);
         super(__qt_return_value);
     }
 
@@ -314,7 +314,7 @@
     {
 	int i = qtd_MetatypeId(toStringz(name));
 	assert(i > 0);
-	return qtd_QVariant_canConvert(nativeId, i);
+	return qtd_QVariant_canConvert(__nativeId, i);
     }
 
     public final bool canConvert(Type)() {
@@ -359,58 +359,58 @@
 	else  static if ( is(Type == QTime) )
 	    return canConvertImpl("QTime");
 	else static if ( is(Type == uint) )
-	    return canConvertImpl("unsigned int"); // TODO: 
+	    return canConvertImpl("unsigned int"); // TODO:
 	else static if ( is(Type == ulong) )
-	    return canConvertImpl("unsigned long long"); // TODO: 
+	    return canConvertImpl("unsigned long long"); // TODO:
 	else static if ( is(Type == QUrl) )
 	    return canConvertImpl("QUrl");
 	else
 	{
 	    static if( is( Type == class ) || is( Type == interface ) )
 	    {
-		Object object = cast(Object)qtd_QVariant_data(nativeId);
+		Object object = cast(Object)qtd_QVariant_data(__nativeId);
 		if(object)
 		    return cast(Type)(object) !is null;
 		return false;
 	    }
 	    else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
 	    {
-		auto array = cast(DArrayToC*)qtd_QVariant_data(nativeId);
+		auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
 		return cast(Type)(array.array) !is null;
 	    }
 	    else
 	    {
 		int i = qtd_MetatypeId(toStringz(typeid(Type).toString));
-		return qtd_QVariant_canConvert(nativeId, i);
+		return qtd_QVariant_canConvert(__nativeId, i);
 	    }
 	}
     }
 
     public final Type value(Type)() {
 	static if ( is(Type == QBitArray) )
-	    return toBitArra; 
+	    return toBitArra;
 	else static if ( is(Type == bool) )
-	    return toBool; 
+	    return toBool;
 	else static if ( is(Type == QByteArray) )
-	    return toByteArray; 
+	    return toByteArray;
 	else static if ( is(Type == QDate) )
-	    return toDate; 
+	    return toDate;
 	else static if ( is(Type == QDateTime) )
-	    return toDateTime; 
+	    return toDateTime;
 	else static if ( is(Type == double) )
-	    return toDouble; 
+	    return toDouble;
 	else static if ( is(Type == int) )
-	    return toInt; 
+	    return toInt;
 	else static if ( is(Type == QLine) )
-	    return toLine; 
+	    return toLine;
 	else static if ( is(Type == QLineF) )
-	    return toLineF; 
+	    return toLineF;
 	else static if ( is(Type == QLocale) )
-	    return toLocale; 
+	    return toLocale;
 	else static if ( is(Type == long) )
-	    return toLongLong; 
+	    return toLongLong;
 	else static if ( is(Type == QPoint) )
-	    return toPoint; 
+	    return toPoint;
 	else static if ( is(Type == QPointF) )
 	    return toPointF;
 	else static if ( is(Type == QRect) )
@@ -435,194 +435,188 @@
 	    return toUrl;
 	else static if( is( Type == class ) || is( Type == interface ) )
 	{
-	    Object object = cast(Object)qtd_QVariant_data(nativeId);
+	    Object object = cast(Object)qtd_QVariant_data(__nativeId);
 	    if(object)
 		return cast(Type)(object);
 	    return null;
 	}
 	else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
 	{
-	    auto array = cast(DArrayToC*)qtd_QVariant_data(nativeId);
+	    auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
 	    return cast(Type)(array.array);
 	}
 	else
 	{
-	    return *cast(Type*)qtd_QVariant_data(nativeId);
+	    return *cast(Type*)qtd_QVariant_data(__nativeId);
 	}
     }
 
     public final void clear() {
-        qtd_QVariant_clear(nativeId);
+        qtd_QVariant_clear(__nativeId);
     }
 
     protected final bool cmp(QVariant other) {
-        return qtd_QVariant_cmp_QVariant(nativeId, other is null ? null : other.nativeId);
+        return qtd_QVariant_cmp_QVariant(__nativeId, other is null ? null : other.__nativeId);
     }
 
     protected final void create(int type, void* copy) {
-        qtd_QVariant_create_int_nativepointervoid(nativeId, type, copy);
+        qtd_QVariant_create_int_nativepointervoid(__nativeId, type, copy);
     }
 
     public final bool isNull() {
-        return qtd_QVariant_isNull(nativeId);
+        return qtd_QVariant_isNull(__nativeId);
     }
 
     public final bool isValid() {
-        return qtd_QVariant_isValid(nativeId);
+        return qtd_QVariant_isValid(__nativeId);
     }
 
     public final void load(QDataStream ds) {
-        qtd_QVariant_load_QDataStream(nativeId, ds is null ? null : ds.nativeId);
+        qtd_QVariant_load_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
     }
 
     public final void writeTo(QDataStream s) {
-        qtd_QVariant_writeTo_QDataStream(nativeId, s is null ? null : s.nativeId);
+        qtd_QVariant_writeTo_QDataStream(__nativeId, s is null ? null : s.__nativeId);
     }
 
     public final QVariant operator_assign(QVariant other) {
-        void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(nativeId, other is null ? null : other.nativeId);
-        return new QVariant(__qt_return_value, true);
+        void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(__nativeId, other is null ? null : other.__nativeId);
+        return new QVariant(__qt_return_value, QtdObjectFlags.nativeOwnership);
     }
 
     private final bool operator_equal(QVariant v) {
-        return qtd_QVariant_operator_equal_QVariant(nativeId, v is null ? null : v.nativeId);
+        return qtd_QVariant_operator_equal_QVariant(__nativeId, v is null ? null : v.__nativeId);
     }
 
     public final void readFrom(QDataStream s) {
-        qtd_QVariant_readFrom_QDataStream(nativeId, s is null ? null : s.nativeId);
+        qtd_QVariant_readFrom_QDataStream(__nativeId, s is null ? null : s.__nativeId);
     }
 
     public final void save(QDataStream ds) {
-        qtd_QVariant_save_QDataStream(nativeId, ds is null ? null : ds.nativeId);
+        qtd_QVariant_save_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
     }
 
     public final QBitArray toBitArray() {
-        void* __qt_return_value = qtd_QVariant_toBitArray(nativeId);
-        return new QBitArray(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toBitArray(__nativeId);
+        return new QBitArray(__qt_return_value);
     }
 
     public final bool toBool() {
-        return qtd_QVariant_toBool(nativeId);
+        return qtd_QVariant_toBool(__nativeId);
     }
 
     public final QByteArray toByteArray() {
-        void* __qt_return_value = qtd_QVariant_toByteArray(nativeId);
-        return new QByteArray(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toByteArray(__nativeId);
+        return new QByteArray(__qt_return_value);
     }
 
     public final QDate toDate() {
-        void* __qt_return_value = qtd_QVariant_toDate(nativeId);
-        return new QDate(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toDate(__nativeId);
+        return new QDate(__qt_return_value);
     }
 
     public final QDateTime toDateTime() {
-        void* __qt_return_value = qtd_QVariant_toDateTime(nativeId);
-        return new QDateTime(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toDateTime(__nativeId);
+        return new QDateTime(__qt_return_value);
     }
 
     public final double toDouble(bool* ok = null) {
-        return qtd_QVariant_toDouble_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toDouble_nativepointerbool(__nativeId, ok);
     }
 
     public final int toInt(bool* ok = null) {
-        return qtd_QVariant_toInt_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toInt_nativepointerbool(__nativeId, ok);
     }
 
     public final QLine toLine() {
-        return qtd_QVariant_toLine(nativeId);
+        return qtd_QVariant_toLine(__nativeId);
     }
 
     public final QLineF toLineF() {
-        return qtd_QVariant_toLineF(nativeId);
+        return qtd_QVariant_toLineF(__nativeId);
     }
 
     public final QLocale toLocale() {
-        void* __qt_return_value = qtd_QVariant_toLocale(nativeId);
-        return new QLocale(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toLocale(__nativeId);
+        return new QLocale(__qt_return_value);
     }
 
     public final long toLongLong(bool* ok = null) {
-        return qtd_QVariant_toLongLong_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toLongLong_nativepointerbool(__nativeId, ok);
     }
 
     public final QPoint toPoint() {
-        return qtd_QVariant_toPoint(nativeId);
+        return qtd_QVariant_toPoint(__nativeId);
     }
 
     public final QPointF toPointF() {
-        return qtd_QVariant_toPointF(nativeId);
+        return qtd_QVariant_toPointF(__nativeId);
     }
 
     public final QRect toRect() {
-        return qtd_QVariant_toRect(nativeId);
+        return qtd_QVariant_toRect(__nativeId);
     }
 
     public final QRectF toRectF() {
-        return qtd_QVariant_toRectF(nativeId);
+        return qtd_QVariant_toRectF(__nativeId);
     }
 
     public final QRegExp toRegExp() {
-        void* __qt_return_value = qtd_QVariant_toRegExp(nativeId);
-        return new QRegExp(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toRegExp(__nativeId);
+        return new QRegExp(__qt_return_value);
     }
 
     public final QSize toSize() {
-        return qtd_QVariant_toSize(nativeId);
+        return qtd_QVariant_toSize(__nativeId);
     }
 
     public final QSizeF toSizeF() {
-        return qtd_QVariant_toSizeF(nativeId);
+        return qtd_QVariant_toSizeF(__nativeId);
     }
 
     public final string toString() {
         string res;
-        qtd_QVariant_toString(nativeId, &res);
+        qtd_QVariant_toString(__nativeId, &res);
         return res;
     }
 
     public final QTime toTime() {
-        void* __qt_return_value = qtd_QVariant_toTime(nativeId);
-        return new QTime(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toTime(__nativeId);
+        return new QTime(__qt_return_value);
     }
 
     public final uint toUInt(bool* ok = null) {
-        return qtd_QVariant_toUInt_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toUInt_nativepointerbool(__nativeId, ok);
     }
 
     public final ulong toULongLong(bool* ok = null) {
-        return qtd_QVariant_toULongLong_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toULongLong_nativepointerbool(__nativeId, ok);
     }
 
     public final QUrl toUrl() {
-        void* __qt_return_value = qtd_QVariant_toUrl(nativeId);
-        return new QUrl(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toUrl(__nativeId);
+        return new QUrl(__qt_return_value);
     }
 
     public final char* typeName() {
-        return qtd_QVariant_typeName(nativeId);
+        return qtd_QVariant_typeName(__nativeId);
     }
-    
+
     public final Type type() {
-        return cast(Type)qtd_QVariant_type(nativeId);
+        return cast(Type)qtd_QVariant_type(__nativeId);
     }
 
     public final int userType() {
-        return qtd_QVariant_userType(nativeId);
+        return qtd_QVariant_userType(__nativeId);
     }
 // Field accessors
 
-    public this(void* native_id, bool no_real_delete = false) {
-        super(native_id, no_real_delete);
+    public this(void* native_id, QtdObjectFlags flags = QtdObjectFlags.none) {
+        super(native_id, flags);
     }
 
-
-    ~this() {
-        if(!__no_real_delete)
-            __free_native_resources();
-    }
-
-    protected void __free_native_resources() {
-        qtd_QVariant_destructor(nativeId());
+    protected override void __deleteNative() {
+        qtd_QVariant_destructor(__nativeId);
     }
 
 // Injected code in class
--- a/qt/d1/qt/qtd/Str.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d1/qt/qtd/Str.d	Sun Aug 30 10:59:56 2009 +0000
@@ -11,11 +11,11 @@
 
 module qt.qtd.Str;
 
-import tango.text.convert.Utf : toString;
+    import tango.text.convert.Utf : toString;
 public import tango.stdc.stringz : fromStringz;
 
-alias char[] string;
-alias wchar[] wstring;
+    alias char[] string;
+    alias wchar[] wstring;
 
 alias char* stringz;
 alias char* cstringz;
@@ -36,20 +36,8 @@
 
 	return argv;
 }
-
-version(Windows)
-{
-    export extern(C) void _d_toUtf8(wchar* arr, uint size, string* str)
-    {
-        *str = toString(arr[0..size]);
-    }
-}
-else
-{
-    extern(C) void _d_toUtf8(wchar* arr, uint size, string* str)
-    {
-        *str = toString(arr[0..size]);
-    }
+extern(C) void qtd_toUtf8(wchar* arr, uint size, string* str){
+    *str = toString(arr[0..size]);
 }
 
 
--- a/qt/d2/qt/core/QLine.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/core/QLine.d	Sun Aug 30 10:59:56 2009 +0000
@@ -24,68 +24,68 @@
         pt1 = QPoint(x1pos, y1pos);
         pt2 = QPoint(x2pos, y2pos);
     }
-    
+
     bool isNull() // const
     {
         return pt1 == pt2;
     }
-    
+
     int x1() // const
     {
         return pt1.x();
     }
-    
+
     int y1() // const
     {
         return pt1.y();
     }
-    
+
     int x2() // const
     {
         return pt2.x();
     }
-    
+
     int y2() // const
     {
         return pt2.y();
     }
-    
+
     QPoint p1() // const
     {
         return pt1;
     }
-    
+
     QPoint p2() // const
     {
         return pt2;
     }
-    
+
     int dx() // const
     {
         return pt2.x() - pt1.x();
     }
-    
+
     int dy() // const
     {
         return pt2.y() - pt1.y();
     }
-    
+
     void translate(ref QPoint point)
     {
         pt1 += point;
         pt2 += point;
     }
-    
+
     void translate(int adx, int ady)
     {
         translate(QPoint(adx, ady));
     }
-    
+
     QLine translated(ref QPoint p) // const
     {
         return QLine(pt1 + p, pt2 + p);
     }
-    
+
     QLine translated(int adx, int ady) // const
     {
         return translated(QPoint(adx, ady));
@@ -105,35 +105,35 @@
     {
         pt1 = aP1;
     }
-    
+
     void setP2(ref QPoint aP2) // for convenience
     {
         pt2 = aP2;
     }
-    
+
     void setPoints(ref QPoint aP1, ref QPoint aP2)
     {
         pt1 = aP1;
         pt2 = aP2;
     }
-    
+
     void setLine(int aX1, int aY1, int aX2, int aY2)
     {
         pt1 = QPoint(aX1, aY1);
         pt2 = QPoint(aX2, aY2);
     }
-    
+
     bool opEquals(ref QLine d) // const
     {
         return pt1 == d.pt1 && pt2 == d.pt2;
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QLine_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLine_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QLine_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLine_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
 private:
@@ -149,106 +149,106 @@
 
 public struct QLineF
 {
-    
+
     alias QLineF_IntersectType IntersectType;
-    
+
     alias QLineF_IntersectType.NoIntersection NoIntersection;
     alias QLineF_IntersectType.BoundedIntersection BoundedIntersection;
     alias QLineF_IntersectType.UnboundedIntersection UnboundedIntersection;
-    
+
     public static QLineF opCall() {
         QLineF ln;
         ln.pt1 = QPointF();
         ln.pt2 = QPointF();
         return ln;
     }
-    
+
     public this(QPointF apt1, QPointF apt2) {
         pt1 = apt1;
         pt2 = apt2;
     }
-    
+
     public this(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos) {
         pt1 = QPointF(x1pos, y1pos);
         pt2 = QPointF(x2pos, y2pos);
     }
-    
-    public this(QLine line){ 
+
+    public this(QLine line){
         pt1 = QPointF(line.p1());
         pt2 = QPointF(line.p2());
     }
-    
+
     public final bool isNull() // const
     {
         return qtd_QLineF_isNull(&this);
     }
-    
+
     qreal x1() // const
     {
         return pt1.x();
     }
-    
+
     qreal y1() // const
     {
         return pt1.y();
     }
-    
+
     qreal x2() // const
     {
         return pt2.x();
     }
-    
+
     qreal y2() // const
     {
         return pt2.y();
     }
-    
+
     QPointF p1() // const
     {
         return pt1;
     }
-    
+
     QPointF p2() // const
     {
         return pt2;
     }
-    
+
     qreal dx() // const
     {
         return pt2.x() - pt1.x();
     }
-    
+
     qreal dy() // const
     {
         return pt2.y() - pt1.y();
     }
-    
+
     QLineF normalVector() // const
     {
         return QLineF(p1(), p1() + QPointF(dy(), -dx()));
     }
-    
+
     void translate(ref QPointF point)
     {
         pt1 += point;
         pt2 += point;
     }
-    
+
     void translate(qreal adx, qreal ady)
     {
         this.translate(QPointF(adx, ady));
     }
-    
+
     QLineF translated(ref QPointF p) // const
     {
         return QLineF(pt1 + p, pt2 + p);
     }
-    
+
     QLineF translated(qreal adx, qreal ady) // const
     {
         return translated(QPointF(adx, ady));
     }
-    
+
     void setLength(qreal len)
     {
         if (isNull())
@@ -256,7 +256,7 @@
         QLineF v = unitVector();
         pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
     }
-    
+
     void length(qreal len)
     {
         if (isNull())
@@ -264,97 +264,97 @@
         QLineF v = unitVector();
         pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
     }
-    
+
     QPointF pointAt(qreal t) // const
     {
         qreal vx = pt2.x() - pt1.x();
         qreal vy = pt2.y() - pt1.y();
         return QPointF(pt1.x() + vx * t, pt1.y() + vy * t);
     }
-    
+
     QLine toLine() // const
     {
         return QLine(pt1.toPoint(), pt2.toPoint());
     }
-    
+
     void setP1(ref QPointF aP1)
     {
         pt1 = aP1;
     }
-    
+
     void setP2(ref QPointF aP2)
     {
         pt2 = aP2;
     }
-    
+
     void p1(ref QPointF aP1)
     {
         pt1 = aP1;
     }
-    
+
     void p2(ref QPointF aP2)
     {
         pt2 = aP2;
     }
-    
+
     void setPoints(ref QPointF aP1, ref QPointF aP2)
     {
         pt1 = aP1;
         pt2 = aP2;
     }
-    
+
     void setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2)
     {
         pt1 = QPointF(aX1, aY1);
         pt2 = QPointF(aX2, aY2);
     }
-    
+
     bool opEquals(ref QLineF d) // const
     {
         return pt1 == d.pt1 && pt2 == d.pt2;
     }
-    
+
     public final double angle() {
         return qtd_QLineF_angle(&this);
     }
-    
+
     public final double angle(ref QLineF l) {
         return qtd_QLineF_angle_QLineF(&this, &l);
     }
-    
+
     public final double angleTo(ref QLineF l) {
         return qtd_QLineF_angleTo_QLineF(&this, &l);
     }
-    
+
     // ### Qt 5: rename intersects() or intersection() and rename IntersectType IntersectionType
     private final QLineF_IntersectType intersect(ref QLineF l, QPointF* intersectionPoint) {
         return cast(QLineF_IntersectType) qtd_QLineF_intersect_QLineF_nativepointerQPointF(&this, &l, intersectionPoint);
     }
-    
+
     public final double length() {
         return qtd_QLineF_length(&this);
     }
-    
+
     public final void writeTo(QDataStream arg__1) {
-        qtd_QLineF_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLineF_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
     public final void readFrom(QDataStream arg__1) {
-        qtd_QLineF_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QLineF_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
     public final void setAngle(double angle) {
         qtd_QLineF_setAngle_double(&this, angle);
     }
-    
+
     public final QLineF unitVector() {
         return qtd_QLineF_unitVector(&this);
     }
-    
+
     public static QLineF fromPolar(double length, double angle) {
         return qtd_QLineF_fromPolar_double_double(length, angle);
     }
-    
+
     private:
         QPointF pt1, pt2;
 }
--- a/qt/d2/qt/core/QModelIndex.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/core/QModelIndex.d	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 module qt.core.QModelIndex;
 
 public import qt.QGlobal;
-private import qt.QtDObject;
+private import qt.core.QObject;
 
 // automatic imports-------------
 private import qt.core.QVariant;
@@ -17,7 +17,7 @@
          mi.p = mi.m = null;
          return mi;
     }
-    
+
     public final QModelIndex child(int row, int column) {
         return __qtd_QModelIndex_child_int_int(&this, row, column);
     }
@@ -28,7 +28,7 @@
 
     public final QVariant data(int role = 0) {
         void* __qt_return_value = __qtd_QModelIndex_data_int(&this, role);
-        return new QVariant(__qt_return_value, false);
+        return new QVariant(__qt_return_value);
     }
 
     public final int flags() {
@@ -57,7 +57,7 @@
         void* __qt_return_value = m;
         if (__qt_return_value is null)
             return null;
-        void* d_obj = __QObject_entity(__qt_return_value);
+        void* d_obj = qtd_get_d_qobject(__qt_return_value);
         return cast(QAbstractItemModel) d_obj;
     }
 
--- a/qt/d2/qt/core/QPoint.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/core/QPoint.d	Sun Aug 30 10:59:56 2009 +0000
@@ -60,7 +60,7 @@
 
     QPoint opMulAssign(qreal c)
     { xp = qRound(xp*c); yp = qRound(yp*c); return this; }
-    
+
     bool opEquals(ref QPoint p)
     { return xp == p.xp && yp == p.yp; }
 
@@ -69,7 +69,7 @@
 
     QPoint opSub(ref QPoint p)
     { return QPoint(this.xp-p.xp, this.yp-p.yp); }
-    
+
     QPoint opMul(qreal c)
     { return QPoint(qRound(this.xp*c), qRound(this.yp*c)); }
 
@@ -86,11 +86,11 @@
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QPoint_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPoint_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QPoint_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPoint_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
 private:
@@ -115,42 +115,42 @@
         pt.xp = pt.yp = 0;
         return pt;
     }
-    
+
     public this(qreal xpos, qreal ypos) {
         xp = xpos;
         yp = ypos;
     }
-    
+
     public this(QPoint p) {
         xp = p.x();
         yp = p.y();
     }
-    
+
     bool isNull() //const
     {
         return qIsNull(xp) && qIsNull(yp);
     }
-    
+
     qreal x() //const
     {
         return xp;
     }
-    
+
     qreal y() //const
     {
         return yp;
     }
-    
+
     void x(qreal xpos)
     {
         xp = xpos;
     }
-    
+
     void y(qreal ypos)
     {
         yp = ypos;
     }
-/*    
+/*
 inline qreal &QPointF::rx()
 {
         return xp;
@@ -161,53 +161,53 @@
     return yp;
 }
 */
-    
+
     QPointF opAddAssign(ref QPointF p)
     { xp+=p.xp; yp+=p.yp; return this; }
-    
+
     QPointF opSubAssign(ref QPointF p)
     { xp-=p.xp; yp-=p.yp; return this; }
-    
+
     QPointF opMulAssign(qreal c)
     { xp*=c; yp*=c; return this; }
-    
+
     bool opEquals(ref QPointF p)
     { return qFuzzyCompare(xp, p.xp) && qFuzzyCompare(yp, p.yp); }
-    
+
     QPointF opAdd(ref QPointF p)
     { return QPointF(this.xp+p.xp, this.yp+p.yp); }
-    
+
     QPointF opSub(ref QPointF p)
     { return QPointF(this.xp-p.xp, this.yp-p.yp); }
-    
+
     QPointF opMul(qreal c)
     { return QPointF(this.xp*c, this.yp*c); }
-    
+
     QPointF opDivAssign(qreal c)
     {
         xp/=c;
         yp/=c;
         return this;
     }
-    
+
     QPointF opDiv(qreal c)
     {
         return QPointF(xp/c, yp/c);
     }
-    
+
     QPoint toPoint() //const
     {
         return QPoint(qRound(xp), qRound(yp));
     }
-    
+
     public final void writeTo(QDataStream arg__1) {
-        qtd_QPointF_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPointF_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
     public final void readFrom(QDataStream arg__1) {
-        qtd_QPointF_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QPointF_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
-    
+
 private:
     qreal xp;
     qreal yp;
--- a/qt/d2/qt/core/QRect.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/core/QRect.d	Sun Aug 30 10:59:56 2009 +0000
@@ -306,11 +306,11 @@
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QRect_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRect_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QRect_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRect_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final QRect opAnd(const QRect r) const {
@@ -328,7 +328,7 @@
     public final bool contains(const QRect r, bool proper = false) const {
         return qtd_QRect_contains_QRect_bool(&this, &r, proper);
     }
-    
+
     public final bool intersects(const QRect r) const {
         return qtd_QRect_intersects_QRect(&this, &r);
     }
@@ -336,7 +336,7 @@
     public final QRect normalized() const {
         return qtd_QRect_normalized(&this);
     }
-    
+
 private:
     version(OSX)
     {
--- a/qt/d2/qt/core/QRectF.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/core/QRectF.d	Sun Aug 30 10:59:56 2009 +0000
@@ -17,7 +17,7 @@
         rt.w = rt.h = 0.;
         return rt;
     }
-    
+
     public this(qreal aleft, qreal atop, qreal awidth, qreal aheight)
     {
         xp = aleft;
@@ -67,28 +67,28 @@
 
     qreal left() const
     { return xp; }
-    
+
     qreal top() const
     { return yp; }
-    
+
     qreal right() const
     { return xp + w; }
-    
+
     qreal bottom() const
     { return yp + h; }
-    
+
     QPointF topLeft() const
     { return QPointF(xp, yp); }
-    
+
     QPointF bottomRight() const
     { return QPointF(xp+w, yp+h); }
-    
+
     QPointF topRight() const
     { return QPointF(xp+w, yp); }
-    
+
     QPointF bottomLeft() const
     { return QPointF(xp, yp+h); }
-    
+
     void setLeft(qreal pos) { qreal diff = pos - xp; xp += diff; w -= diff; }
 
     void setRight(qreal pos) { w = pos - xp; }
@@ -226,7 +226,7 @@
         w = s.width();
         h = s.height();
     }
-    
+
     bool contains(qreal ax, qreal ay) const
     {
         return contains(QPointF(ax, ay));
@@ -286,11 +286,11 @@
     }
 
     public final void writeTo(QDataStream arg__1) {
-        qtd_QRectF_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRectF_writeTo_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final void readFrom(QDataStream arg__1) {
-        qtd_QRectF_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.nativeId);
+        qtd_QRectF_readFrom_QDataStream(&this, arg__1 is null ? null : arg__1.__nativeId);
     }
 
     public final QRectF opOr(ref QRectF r) const {
--- a/qt/d2/qt/core/QVariant.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/core/QVariant.d	Sun Aug 30 10:59:56 2009 +0000
@@ -1,7 +1,7 @@
 module qt.core.QVariant;
 
 public import qt.QGlobal;
-private import qt.QtDObject;
+private import qt.QtdObject;
 private import qt.core.QMetaType;
 
 // automatic imports-------------
@@ -27,7 +27,7 @@
 import std.string;
 
 
-public class QVariant : QtDObject
+public class QVariant : QtdObject
 {
     enum Type {
         Invalid = 0,
@@ -87,7 +87,7 @@
 
         LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
     }
-    
+
 // Functions
 
     private template getMetaId()
@@ -97,7 +97,7 @@
 	    if(i <= 0)
 		i = qRegisterMetaType!(T)(name);";
     }
-	
+
     static public QVariant fromValue(T)(T obj)
     {
 	QVariant var;
@@ -125,7 +125,7 @@
 	}
 	return var;
     }
-    
+
     static public QVariant opCall(T)(T obj)
     {
 	return fromValue(obj);
@@ -138,7 +138,7 @@
 
 
     public this(QDataStream s) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.__nativeId);
         super(__qt_return_value);
     }
 
@@ -156,25 +156,25 @@
 
 
     public this(QBitArray bitarray) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QByteArray bytearray) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QDate date) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QDateTime datetime) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.__nativeId);
         super(__qt_return_value);
     }
 
@@ -198,7 +198,7 @@
 
 
     public this(QLocale locale) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.__nativeId);
         super(__qt_return_value);
     }
 
@@ -228,7 +228,7 @@
 
 
     public this(QRegExp regExp) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.__nativeId);
         super(__qt_return_value);
     }
 
@@ -246,19 +246,19 @@
 
 
     public this(QTime time) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QUrl url) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.__nativeId);
         super(__qt_return_value);
     }
 
 
     public this(QVariant other) {
-        void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.nativeId);
+        void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.__nativeId);
         super(__qt_return_value);
     }
 
@@ -308,7 +308,7 @@
     {
 	int i = qtd_MetatypeId(toStringz(name));
 	assert(i > 0);
-	return qtd_QVariant_canConvert(nativeId, i);
+	return qtd_QVariant_canConvert(__nativeId, i);
     }
 
     public final bool canConvert(Type)() {
@@ -353,58 +353,58 @@
 	else  static if ( is(Type == QTime) )
 	    return canConvertImpl("QTime");
 	else static if ( is(Type == uint) )
-	    return canConvertImpl("unsigned int"); // TODO: 
+	    return canConvertImpl("unsigned int"); // TODO:
 	else static if ( is(Type == ulong) )
-	    return canConvertImpl("unsigned long long"); // TODO: 
+	    return canConvertImpl("unsigned long long"); // TODO:
 	else static if ( is(Type == QUrl) )
 	    return canConvertImpl("QUrl");
 	else
 	{
 	    static if( is( Type == class ) || is( Type == interface ) )
 	    {
-		Object object = cast(Object)qtd_QVariant_data(nativeId);
+		Object object = cast(Object)qtd_QVariant_data(__nativeId);
 		if(object)
 		    return cast(Type)(object) !is null;
 		return false;
 	    }
 	    else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
 	    {
-		auto array = cast(DArrayToC*)qtd_QVariant_data(nativeId);
+		auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
 		return cast(Type)(array.array) !is null;
 	    }
 	    else
 	    {
 		int i = qtd_MetatypeId(toStringz(typeid(Type).toString));
-		return qtd_QVariant_canConvert(nativeId, i);
+		return qtd_QVariant_canConvert(__nativeId, i);
 	    }
 	}
     }
 
     public final Type value(Type)() {
 	static if ( is(Type == QBitArray) )
-	    return toBitArra; 
+	    return toBitArra;
 	else static if ( is(Type == bool) )
-	    return toBool; 
+	    return toBool;
 	else static if ( is(Type == QByteArray) )
-	    return toByteArray; 
+	    return toByteArray;
 	else static if ( is(Type == QDate) )
-	    return toDate; 
+	    return toDate;
 	else static if ( is(Type == QDateTime) )
-	    return toDateTime; 
+	    return toDateTime;
 	else static if ( is(Type == double) )
-	    return toDouble; 
+	    return toDouble;
 	else static if ( is(Type == int) )
-	    return toInt; 
+	    return toInt;
 	else static if ( is(Type == QLine) )
-	    return toLine; 
+	    return toLine;
 	else static if ( is(Type == QLineF) )
-	    return toLineF; 
+	    return toLineF;
 	else static if ( is(Type == QLocale) )
-	    return toLocale; 
+	    return toLocale;
 	else static if ( is(Type == long) )
-	    return toLongLong; 
+	    return toLongLong;
 	else static if ( is(Type == QPoint) )
-	    return toPoint; 
+	    return toPoint;
 	else static if ( is(Type == QPointF) )
 	    return toPointF;
 	else static if ( is(Type == QRect) )
@@ -429,194 +429,188 @@
 	    return toUrl;
 	else static if( is( Type == class ) || is( Type == interface ) )
 	{
-	    Object object = cast(Object)qtd_QVariant_data(nativeId);
+	    Object object = cast(Object)qtd_QVariant_data(__nativeId);
 	    if(object)
 		return cast(Type)(object);
 	    return null;
 	}
 	else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
 	{
-	    auto array = cast(DArrayToC*)qtd_QVariant_data(nativeId);
+	    auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
 	    return cast(Type)(array.array);
 	}
 	else
 	{
-	    return *cast(Type*)qtd_QVariant_data(nativeId);
+	    return *cast(Type*)qtd_QVariant_data(__nativeId);
 	}
     }
 
     public final void clear() {
-        qtd_QVariant_clear(nativeId);
+        qtd_QVariant_clear(__nativeId);
     }
 
     protected final bool cmp(QVariant other) {
-        return qtd_QVariant_cmp_QVariant(nativeId, other is null ? null : other.nativeId);
+        return qtd_QVariant_cmp_QVariant(__nativeId, other is null ? null : other.__nativeId);
     }
 
     protected final void create(int type, void* copy) {
-        qtd_QVariant_create_int_nativepointervoid(nativeId, type, copy);
+        qtd_QVariant_create_int_nativepointervoid(__nativeId, type, copy);
     }
 
     public final bool isNull() {
-        return qtd_QVariant_isNull(nativeId);
+        return qtd_QVariant_isNull(__nativeId);
     }
 
     public final bool isValid() {
-        return qtd_QVariant_isValid(nativeId);
+        return qtd_QVariant_isValid(__nativeId);
     }
 
     public final void load(QDataStream ds) {
-        qtd_QVariant_load_QDataStream(nativeId, ds is null ? null : ds.nativeId);
+        qtd_QVariant_load_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
     }
 
     public final void writeTo(QDataStream s) {
-        qtd_QVariant_writeTo_QDataStream(nativeId, s is null ? null : s.nativeId);
+        qtd_QVariant_writeTo_QDataStream(__nativeId, s is null ? null : s.__nativeId);
     }
 
     public final QVariant operator_assign(QVariant other) {
-        void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(nativeId, other is null ? null : other.nativeId);
-        return new QVariant(__qt_return_value, true);
+        void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(__nativeId, other is null ? null : other.__nativeId);
+        return new QVariant(__qt_return_value, QtdObjectFlags.nativeOwnership);
     }
 
     private final bool operator_equal(QVariant v) {
-        return qtd_QVariant_operator_equal_QVariant(nativeId, v is null ? null : v.nativeId);
+        return qtd_QVariant_operator_equal_QVariant(__nativeId, v is null ? null : v.__nativeId);
     }
 
     public final void readFrom(QDataStream s) {
-        qtd_QVariant_readFrom_QDataStream(nativeId, s is null ? null : s.nativeId);
+        qtd_QVariant_readFrom_QDataStream(__nativeId, s is null ? null : s.__nativeId);
     }
 
     public final void save(QDataStream ds) {
-        qtd_QVariant_save_QDataStream(nativeId, ds is null ? null : ds.nativeId);
+        qtd_QVariant_save_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
     }
 
     public final QBitArray toBitArray() {
-        void* __qt_return_value = qtd_QVariant_toBitArray(nativeId);
-        return new QBitArray(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toBitArray(__nativeId);
+        return new QBitArray(__qt_return_value);
     }
 
     public final bool toBool() {
-        return qtd_QVariant_toBool(nativeId);
+        return qtd_QVariant_toBool(__nativeId);
     }
 
     public final QByteArray toByteArray() {
-        void* __qt_return_value = qtd_QVariant_toByteArray(nativeId);
-        return new QByteArray(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toByteArray(__nativeId);
+        return new QByteArray(__qt_return_value);
     }
 
     public final QDate toDate() {
-        void* __qt_return_value = qtd_QVariant_toDate(nativeId);
-        return new QDate(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toDate(__nativeId);
+        return new QDate(__qt_return_value);
     }
 
     public final QDateTime toDateTime() {
-        void* __qt_return_value = qtd_QVariant_toDateTime(nativeId);
-        return new QDateTime(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toDateTime(__nativeId);
+        return new QDateTime(__qt_return_value);
     }
 
     public final double toDouble(bool* ok = null) {
-        return qtd_QVariant_toDouble_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toDouble_nativepointerbool(__nativeId, ok);
     }
 
     public final int toInt(bool* ok = null) {
-        return qtd_QVariant_toInt_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toInt_nativepointerbool(__nativeId, ok);
     }
 
     public final QLine toLine() {
-        return qtd_QVariant_toLine(nativeId);
+        return qtd_QVariant_toLine(__nativeId);
     }
 
     public final QLineF toLineF() {
-        return qtd_QVariant_toLineF(nativeId);
+        return qtd_QVariant_toLineF(__nativeId);
     }
 
     public final QLocale toLocale() {
-        void* __qt_return_value = qtd_QVariant_toLocale(nativeId);
-        return new QLocale(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toLocale(__nativeId);
+        return new QLocale(__qt_return_value);
     }
 
     public final long toLongLong(bool* ok = null) {
-        return qtd_QVariant_toLongLong_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toLongLong_nativepointerbool(__nativeId, ok);
     }
 
     public final QPoint toPoint() {
-        return qtd_QVariant_toPoint(nativeId);
+        return qtd_QVariant_toPoint(__nativeId);
     }
 
     public final QPointF toPointF() {
-        return qtd_QVariant_toPointF(nativeId);
+        return qtd_QVariant_toPointF(__nativeId);
     }
 
     public final QRect toRect() {
-        return qtd_QVariant_toRect(nativeId);
+        return qtd_QVariant_toRect(__nativeId);
     }
 
     public final QRectF toRectF() {
-        return qtd_QVariant_toRectF(nativeId);
+        return qtd_QVariant_toRectF(__nativeId);
     }
 
     public final QRegExp toRegExp() {
-        void* __qt_return_value = qtd_QVariant_toRegExp(nativeId);
-        return new QRegExp(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toRegExp(__nativeId);
+        return new QRegExp(__qt_return_value);
     }
 
     public final QSize toSize() {
-        return qtd_QVariant_toSize(nativeId);
+        return qtd_QVariant_toSize(__nativeId);
     }
 
     public final QSizeF toSizeF() {
-        return qtd_QVariant_toSizeF(nativeId);
+        return qtd_QVariant_toSizeF(__nativeId);
     }
 
     public final string toString() {
         string res;
-        qtd_QVariant_toString(nativeId, &res);
+        qtd_QVariant_toString(__nativeId, &res);
         return res;
     }
 
     public final QTime toTime() {
-        void* __qt_return_value = qtd_QVariant_toTime(nativeId);
-        return new QTime(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toTime(__nativeId);
+        return new QTime(__qt_return_value);
     }
 
     public final uint toUInt(bool* ok = null) {
-        return qtd_QVariant_toUInt_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toUInt_nativepointerbool(__nativeId, ok);
     }
 
     public final ulong toULongLong(bool* ok = null) {
-        return qtd_QVariant_toULongLong_nativepointerbool(nativeId, ok);
+        return qtd_QVariant_toULongLong_nativepointerbool(__nativeId, ok);
     }
 
     public final QUrl toUrl() {
-        void* __qt_return_value = qtd_QVariant_toUrl(nativeId);
-        return new QUrl(__qt_return_value, false);
+        void* __qt_return_value = qtd_QVariant_toUrl(__nativeId);
+        return new QUrl(__qt_return_value);
     }
 
     public final char* typeName() {
-        return qtd_QVariant_typeName(nativeId);
+        return qtd_QVariant_typeName(__nativeId);
     }
-    
+
     public final Type type() {
-        return cast(Type)qtd_QVariant_type(nativeId);
+        return cast(Type)qtd_QVariant_type(__nativeId);
     }
 
     public final int userType() {
-        return qtd_QVariant_userType(nativeId);
+        return qtd_QVariant_userType(__nativeId);
     }
 // Field accessors
 
-    public this(void* native_id, bool no_real_delete = false) {
-        super(native_id, no_real_delete);
+    public this(void* native_id, QtdObjectFlags flags = QtdObjectFlags.none) {
+        super(native_id, flags);
     }
 
-
-    ~this() {
-        if(!__no_real_delete)
-            __free_native_resources();
-    }
-
-    protected void __free_native_resources() {
-        qtd_QVariant_destructor(nativeId());
+    protected override void __deleteNative() {
+        qtd_QVariant_destructor(__nativeId);
     }
 
 // Injected code in class
--- a/qt/d2/qt/qtd/Str.d	Sun Aug 30 09:59:12 2009 +0000
+++ b/qt/d2/qt/qtd/Str.d	Sun Aug 30 10:59:56 2009 +0000
@@ -36,7 +36,7 @@
         argv[argc++] = cast(char*)(p.dup~'\0');
     }
     argv[argc] = null;
-        
+
     return argv;
 }
 
@@ -45,19 +45,11 @@
     return s ? s[0 .. strlen(s)].idup : cast(string)null;
 }
 
-version(Windows)
+
+extern(C) void qtd_toUtf8(wchar* arr, uint size, string* str)
 {
-    export extern(C) void _d_toUtf8(wchar* arr, uint size, string* str)
-    {
-        *str = toUTF8(arr[0..size]);
-    }
-}
-else
-{
-    extern(C) void _d_toUtf8(wchar* arr, uint size, string* str)
-    {
-        *str = toUTF8(arr[0..size]);
-    }
+    *str = toUTF8(arr[0..size]);
 }
 
 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qt/qtd/Traits.d	Sun Aug 30 10:59:56 2009 +0000
@@ -0,0 +1,10 @@
+module qt.qtd.Traits;
+
+version (D_Version2)
+{
+    public import std.traits;
+}
+else
+{
+    public import tango.core.Traits : BaseTypeTuple = BaseTypeTupleOf;
+}