[Kde-bindings] playground/bindings/kimono
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu Jun 8 16:34:24 UTC 2006
SVN commit 549448 by rdale:
* Example t7 now works, which means that both custom slots
slots and signals work.
* At present an Emit() method and signals interface is
needed for classes which don't have any custom signals
* The example wasn't working because the slots and signals
had return types of 'void', and slot/signal return values
haven't been implemented yet.
CCMAIL: kde-bindings at kde.org
M +10 -0 ChangeLog
M +18 -6 examples/tutorial/t7/lcdrange.cs
M +6 -2 qyoto/Qyoto.cs
--- trunk/playground/bindings/kimono/ChangeLog #549447:549448
@@ -1,3 +1,13 @@
+2006-06-08 Richard Dale <rdale at foton.es>
+
+ * Example t7 now works, which means that both custom slots
+ slots and signals work.
+ * At present an Emit() method and signals interface is
+ needed for classes which don't have any custom signals
+ * The example wasn't working because the slots and signals
+ had return types of 'void', and slot/signal return values
+ haven't been implemented yet.
+
2006-06-08 Paolo Capriotti <paolo.capriotti at gmail.com>
* The overriden MetaObject is now called in place
--- trunk/playground/bindings/kimono/examples/tutorial/t7/lcdrange.cs #549447:549448
@@ -1,8 +1,10 @@
-using Qt;
+using Qyoto;
class LCDRange : QWidget {
private QSlider slider;
+ public LCDRange() : this((QWidget) null) {}
+
public LCDRange(QWidget parent) : base(parent) {
QLCDNumber lcd = new QLCDNumber(2);
lcd.SetSegmentStyle(QLCDNumber.SegmentStyle.Filled);
@@ -27,17 +29,21 @@
return slider.Value();
}
- [Q_SLOT("void setValue(int)")]
+ [Q_SLOT("setValue(int)")]
public void SetValue(int value) {
slider.SetValue(value);
}
- [Q_SIGNAL("void valueChanged(int)")]
- public void ValueChanged(int newValue) { }
-
-
+ protected new ILCDRangeSignals Emit() {
+ return (ILCDRangeSignals) Q_EMIT;
+ }
}
+public interface ILCDRangeSignals : IQWidgetSignals {
+ [Q_SIGNAL("valueChanged(int)")]
+ void ValueChanged(int newValue);
+}
+
class MyWidget : QWidget {
public MyWidget(QWidget parent) : base(parent) {
QPushButton quit = new QPushButton("Quit");
@@ -69,4 +75,10 @@
main.Show();
QApplication.Exec();
}
+ protected new IMyWidgetSignals Emit() {
+ return (IMyWidgetSignals) Q_EMIT;
+ }
}
+
+public interface IMyWidgetSignals : IQWidgetSignals {
+}
--- trunk/playground/bindings/kimono/qyoto/Qyoto.cs #549447:549448
@@ -58,18 +58,22 @@
}
public static string[] GetSignalSignatures(Type t) {
+ if (IsSmokeClass(t)) {
+ return new string[0];
+ }
+
Type iface;
try {
iface = GetSignalsInterface(t);
}
catch {
- return null;
+ return new string[0];
}
MethodInfo[] mis = iface.GetMethods();
/// the interface has no signals...
if (mis.Length == 0)
- return null;
+ return new string[0];
string[] signatures = new string[mis.Length];
int i = 0;
More information about the Kde-bindings
mailing list