[Kde-bindings] playground/bindings/kimono
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Wed Jan 24 15:48:48 UTC 2007
SVN commit 626776 by rdale:
* QVariant.Value() and QVariant.FromValue() now work correctly with enums
CCMAIL: kde-bindings at kde.org
M +1 -0 ChangeLog
M +4 -0 core/QVariantExtras.cs
--- trunk/playground/bindings/kimono/ChangeLog #626775:626776
@@ -4,6 +4,7 @@
and get methods removed from the api
* QDomNodeList is no longer an ArrayList type
* Added QList<QRgb> as a C# List<uint> type
+ * QVariant.Value() and QVariant.FromValue() now work correctly with enums
2007-22-01 Arno Rehn <arno at arnorehn.de>
--- trunk/playground/bindings/kimono/core/QVariantExtras.cs #626775:626776
@@ -52,6 +52,8 @@
return (T) (object) ToUInt();
} else if (typeof(T) == typeof(QUrl)) {
return (T) (object) ToUrl();
+ } else if (typeof(T).IsEnum) {
+ return (T) (object) ToInt();
} else {
return (T) (object) default(T);
}
@@ -102,6 +104,8 @@
return new QVariant((uint) value);
} else if (typeof(T) == typeof(QUrl)) {
return new QVariant((QUrl) value);
+ } else if (typeof(T).IsEnum) {
+ return new QVariant((int) value);
} else {
return new QVariant();
}
More information about the Kde-bindings
mailing list