[Mono-list] Qt C# bindings and a simple HelloWorld
Adam Treat
manybooby@yahoo.com
Mon, 4 Feb 2002 18:04:22 -0800
--------------Boundary-00=_A3F17617I8RW06NYH4GS
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
So I've been mucking about for a bit with some c-sharp bindings to the
qt-toolkit. I've been successful with a generic helloworld program. I think
I am ready to begin generating some bindings in earnest after a few problems
are solved:
1. Not sure how to handle Slots and Signals. (biggest problem) ;)
2. I have been using the qtc bindings from kde3 in the pinvoke statements. I
would like to stop using the libqtc library and just dllimport from libqt but
the name mangling (see http://www.delorie.com/gnu/docs/gcc/gxxint_15.html) is
going to have to be accounted for. Thinking about writing a tool that will
automatically mangle the dllimport statement. ie:
From:
[DllImport("libqtc.so.1.0.0")]
public static extern Object qt_new_QApplication(int argc, string[] argv);
To:
[DllImport("libqt.so.2")]
public static extern Object __12QApplicationRiPPc(int argc, string[] argv);
3. I don't know how to use kalyptus (don't know perl) and I am a frankly
little frightened to go in that direction... Thinking about using the kdoc
html output and generating the bindings from that, similar to what the intel
guys did with the ECMA documentation to c# stubs... Richard, Miguel, Mike do
you have some suggestions on the best way to proceed?
Well tell me what you think.
Adam
P.S. I am primarly a java programmer, with little experience in qt, c++, or
c. This is an exercise to hopefully do something useful and allow me to
learn a little so feel free to offer up some pointers ;)
// qt_HelloWorld.cs - qt-csharp Hello World
namespace QtSamples {
using Qt;
using System;
public class qt_HelloWorld {
public static int Main (string[] args)
{
QApplication a = new QApplication(args);
QPushButton hello = new QPushButton("Hello world!", 0);
hello.resize(100, 30);
a.setMainWidget(hello);
hello.show();
return a.exec();
}
}
}
--------------Boundary-00=_A3F17617I8RW06NYH4GS
Content-Type: application/x-zip;
name="qtc-sharp.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="qtc-sharp.zip"
UEsDBAoAAAAAAFyARCwAAAAAAAAAAAAAAAAFABUAcXRjIy9VVAkAAy8hXzx7IV88VXgEAOgD6ANQ
SwMEFA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