[Kde-bindings] playground/bindings/kimono
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Wed Mar 7 10:27:43 UTC 2007
SVN commit 640199 by rdale:
* Made the simpletreemodel example use the csrcc resource compiler
CCMAIL: kde-bindings at kde.org
M +4 -0 ChangeLog
M +5 -5 examples/itemviews/simpletreemodel/main.cs
M +2 -6 examples/itemviews/simpletreemodel/treeitem.cs
M +2 -2 examples/itemviews/simpletreemodel/treemodel.cs
--- trunk/playground/bindings/kimono/ChangeLog #640198:640199
@@ -1,3 +1,7 @@
+2007-03-07 Richard Dale <rdale at foton.es>
+
+ * Made the simpletreemodel example use the csrcc resource compiler
+
2007-03-06 Richard Dale <rdale at foton.es>
* A GCHandle was being used to hold the 'internalPointer' value in a
--- trunk/playground/bindings/kimono/examples/itemviews/simpletreemodel/main.cs #640198:640199
@@ -2,15 +2,15 @@
using System.IO;
using Qyoto;
-class MainClass {
+class MainClass : Qt {
public static int Main(string[] args) {
-// Q_INIT_RESOURCE("simpletreemodel");
+ Q_INIT_RESOURCE("simpletreemodel");
new QApplication(args);
- StreamReader file = new StreamReader("default.txt");
-// Debug.SetDebug(QtDebugChannel.QTDB_TRANSPARENT_PROXY | QtDebugChannel.QTDB_VIRTUAL);
- TreeModel model = new TreeModel(file.ReadToEnd());
+ QFile file = new QFile(":/default.txt");
+ file.Open((int) QIODevice.OpenModeFlag.ReadOnly);
+ TreeModel model = new TreeModel(new QTextStream(file.ReadAll()).ReadAll());
file.Close();
QTreeView view = new QTreeView();
--- trunk/playground/bindings/kimono/examples/itemviews/simpletreemodel/treeitem.cs #640198:640199
@@ -24,15 +24,11 @@
}
public int ChildCount() {
-// if (childItems != null)
- return childItems.Count;
-// return 0;
+ return childItems.Count;
}
public int ColumnCount() {
-// if (itemData != null)
- return itemData.Count;
-// return 0;
+ return itemData.Count;
}
public QVariant Data(int column) {
--- trunk/playground/bindings/kimono/examples/itemviews/simpletreemodel/treemodel.cs #640198:640199
@@ -84,11 +84,11 @@
else
return new QModelIndex();
}
-
+
public override QModelIndex Index(int row, int column) {
return Index(row, column, new QModelIndex());
}
-
+
public override QModelIndex Parent(QModelIndex index) {
if (!index.IsValid())
return new QModelIndex();
More information about the Kde-bindings
mailing list