faq
flatforty
contribute
subscribe
configure
search
rdf
main
|
| Qyoto C#/Mono Bindings for Qt4, New QtRuby release and PHP Bindings Coming Soon |
Posted by Richard Dale on Tuesday 03/Jul/2007, @05:52
from the ninja-monkeys dept.
After the recent final release of QtJambi, Trolltech's Java bindings, I'm pleased to announce another new member of the Qt bindings family, the Qyoto C#/Mono bindings for Qt 4.3, which are available for download on the Qyoto/Kimono site, where there is also a help forum for your Qyoto programming questions. Big thanks to David Canar for setting up the site, and organizing the release. Read on for more details.
Additionally, I've just released QtRuby 1.4.9 on the Korundum Rubyforge site with many improvements. Meanwhile Thomas Moenicke is working on another binding using the Smoke library - PHP-Qt - see last week's Commit-Digest for details. What with these bindings, and all the action with Kross scripting of KDE apps and Plasma (and PyQt/PyKDE of course), these are exciting times for fans of non-C++ languages in KDE!
Arno Rehn and myself have given a presentation and demo of Qyoto at aKademy 2007. We will show how you can quickly build user interfaces with Qt Designer/uics, easily communicate with other applications via the QtDBus framework, and how other CLR languages, such as IronPython, work with Qyoto.
Qyoto includes very complete coverage of the Qt classes, and optionally the QScintilla text editing framework, along with the 'uics' tool for compiling Qt Designer .ui files to C#, and 'csrcc' a resource compiler based on Qt's rcc. The code is based on QtRuby, which in turn was derived from PerlQt, and it uses the same language independent Smoke library as those bindings. That should mean that Qyoto will be quite solid and mature for a first release.
Now for a brief summary of how the Qt language features look in Qyoto. You define slots by marking methods in your class like this:
[Q_SLOT]
public void MySlot(int arg) {
...
Signals are defined in an interface associated with the class, with the signatures being marked with a 'Q_SIGNAL' attribute:
public interface IMyButtonSignals : IQPushButtonSignals {
[Q_SIGNAL]
void Clicked(bool arg);
To emit a signal you, use a special property called 'Emit' like this:
Emit.Clicked(true);
Note that Qyoto signals are typesafe and can be checked by the compiler because they must conform to the type signatures defined in your signals interface. Qt properties are mapped directly on C# properties, and so instead of setting the text of a button with a setText() method call:
mybutton.setText("Hello World!");
You set a 'Text' property like this:
mybutton.Text = "Hello World!";
If you wish properties to appear in the QMetaObject data for your class, so that you can export them over DBus perhaps, you can mark them like this: [Q_PROPERTY]
public string Text {
...
Connecting a signal to a slot is very similar to C++:
Connect(quit, SIGNAL("clicked()"), app, SLOT("quit()"));
But note the quotes round the signal/slot signatures.
Well that pretty much sums up the differences - the api is so similar to the C++ api that very little explanation should be needed. Although Qyoto has its own distinctive personality with method names beginning with capital letters and much use of getting/setting properties, the code examples should be very easy to follow, and getting up to speed straightforward for those familiar with Qt. The MonoDevelop IDE works well with Qyoto, and there is a MonoDevelop project file 'Qyoto.mpb' provided, which is a very useful way to browse the classes in the api.
Happy C#/Mono hacking with Qyoto!
<
|
>
|
|
The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
|
Over 40 comments listed.
Printing out index only. |
This is wonderful Richard!
by manyoso on Tuesday 03/Jul/2007, @07:25
|
Three cheers for both you and Arno for developing these csharp bindings!
|
[
Reply To This | View ]
|
|
|
Consistency between bindings
by Diederik van der Boor on Tuesday 03/Jul/2007, @07:52
|
With all these bindings, are the developers looking for consistency between the bindings?
Examples:
- Korundum seams to use a completely different approach to signals then Qyoto does here.
- Why the weird namings?
- Are they all based on Smoke, or does this differ between the bindings?
- How fast and easy can be the bindings be made up to date with releases?
Off course, some things can't be consistent, but it would be sad if a developer has to relearn Qt programming for every new binding.
|
[
Reply To This | View ]
|
|
|
Windows
by self on Tuesday 03/Jul/2007, @08:37
|
QtRuby works on Windows?
|
[
Reply To This | View ]
|
|
|
MONO? MONO?!
by name on Tuesday 03/Jul/2007, @09:48
|
For Christ's sake, can you people just leave this crap to microsoft and novell? Just because Miguel de Icasa goes out of his way to bring MS-controlled environment to other platforms doesn't mean we have to use it...
|
[
Reply To This | View ]
|
|
|
Korundum and KDE4
by Vide on Tuesday 03/Jul/2007, @13:06
|
Hi
I would like to start to write a little app in Ruby using KDE4 technology (solid and maybe plasma). When do you think this will be possible? around beta1? already now?
|
[
Reply To This | View ]
|
|
|
Fantastic!
by Sebastian Sauer on Tuesday 03/Jul/2007, @14:03
|
Thanks for the great work! btw, seems qyoto.org went done - a good sign :)
|
[
Reply To This | View ]
|
Where is Perl in KDE?
by AC on Tuesday 03/Jul/2007, @15:38
|
Where are the Perl bindings for KDE library calls?
Where is the Perl DCOP interface that can receive messages and bind anonymously?
Where is the KDE UI designer that emits Perl code?
Where is the Cross support for Perl?
Where is the Kommander documentation with Perl examples?
Where are the Amarok and Konversation Perl scripts?
Where is the Perl work relating to Qt4 and KDE4?
It is fuck all possible to write a KDE application, whole or partial, in Perl. While you neglect a Unix system's most important language after C, GNOME/Gtk2 is eating your lunch. Guys, it *chafes*.
|
[
Reply To This | View ]
|
|
|
With the new language bindings...
by T. J. Brumfield on Tuesday 03/Jul/2007, @21:43
|
With the new language bindings, perhaps it is time to reconsider something that has been brought up before.
As many of you are aware, the FreeDesktop.org project aims at bringing together some common aspects of the free desktop. However, when developing applications, one is still forced to focus either on GTK or QT and in doing so direct their product at one audience predominantly. QT apps can run in Gnome (or Xfce) and GTK apps in KDE, however they don't look fully integrated. Furthermore, because of the fundamental coding differences between GTK and QT, we often have redundant efforts into relatively mirror software programs, one aimed at each major desktop.
I'm certainly not the first to suggest this, but isn't now specifically a good time to consider more fully merging the two technologies? With the major refactoring of KDE 4 and QT 4, there are some major new core technologies that any developer should be excited about. KDE is also embracing Tango, DBus, and many of the FreeDesktop.org concepts.
Furthermore, one of the major arguments for keeping GTK and QT separate technologies has been C vs C++, however both now have diverse language bindings. Developers should be able to develop in any language they choose, and not have the language be mandated by the toolkit. Honestly, the only good reason to keep them separate is in design. People who prefer GTK styles or widgets opt to develop with GTK, and vice versa. Couldn't there be a universal library that is capable of operating in appearance and usability like both GTK and QT when it comes to widgets and visuals? In fact merging the two might extend both and not only enable developers to reach a broader audience easier, but unlock more power and potential for everyone.
Choice is important, and one should never lose the ability to run their desktop how they see fit. Neither Gnome nor KDE should lose all their efforts into developing their vision of the desktop, however further merging core technologies and libraries means opening up these powerful tools to developers for all free desktops.
Imagine any application being able to tap into the potential merged technologies of:
* Cairo - A sophisticated 2D vector graphics library.
* Pango - A library for laying out and rendering of text, with an emphasis on internationalization.
* D-Bus - Interprocess communication system.
* GStreamer - A multimedia framework.
* HAL - A specification and an implementation of a hardware abstraction layer.
* Poppler - A PDF rendering library.
* Tango Desktop Project - Which aims to provide a common visual standard across different platforms.
* Solid - Making a universal hardware layer is CRUCIAL. Given that both projects utilize Hal and DBus, taking it one step further isn't a huge stretch. Further developing Solid could tie into working with kernel developers to examine how to best handle hardware from the kernel into userspace, and reexaming exactly what portions belong in each space.
* Phonon - I hate to sound like a dissenter, but audio on the FreeDesktop leaves much to be desired. Phonon aims to fix this.
* Sonnet - An advanced dictionary that I believe will be the successor to ASpell
* Decibel - Project providing a service architecture to make chat and phone communication universally available to desktop applications
* Plasma - Plasma would have to be extended to support and operate like Gnome's deskbar and desktop, but it is a powerful tool to create widgets and plasmoids that would offer great flexibility to all parties.
* Strigi - I know there are many search technologies, and I'm assuming the best aspects of each could hopefully be factored into Strigi
* Semantic Desktop - I am familiar with NEOMUK, and perhaps there are other projects that could be brought to this table.
* Gnome VFS - The Gnome virtual file system.
* Gnome Keyring - For storing encryption keys and security information.
* Bonobo/KParts - Again, merge the best features of these two technologies to create a powerful universal component model
* LibXML - The XML library.
* ORBit - The CORBA ORB for software componentry.
* A merged composite technology for nifty eye-candy. Compiz and Beryl merged though many thought it wasn't possible. Now Kwin is being rewritten with many of the same features that Compiz would provide, but is duplicating efforts. No doubt Gnome, KDE, Xfce and all the rest will want to retain separate WM's, but a core unified underlying base for composite extensions should be established.
* Translation - Obviously different desktop projects each have different apps, and a bunch of different text, but many of the core terms and documents could be brought together to simply translation on the free desktop.
I know KDE is developing an icon-caching system given that KDE 4 is going to heavily utilize SVG to better scale everything on the desktop. I'm not sure if Gnome has a similar system.
Integrating core technologies involves on getting people who currently see things differently to come together. Some may dismiss this as an impossible goal, however that isn't the case. Ideally these technologies should be flexible enough to achieve the results that everyone is looking for while providing a unified base to avoid duplication of efforts.
Lastly, what I'm proposing is no small task. I fully understand that it involves a great deal of work, and in doing so, it would temporarily pause/strain development of projects like Gnome and KDE from moving forward in their current separate ways. However, the initial work may be daunting but imagine how much time and effort would be saved in the long run when we drastically cut down on duplicating efforts.
In many ways this is a win-win, and really such an obviously beneficial move, it should at the very least be revisited and given considerable thought. The sooner such a merge of core technologies takes place, the more time you save in the long run, and the easier such a merge takes place. As duplication in code continues, the more time consuming it will be to examine all the duplicate code and agree on how to merge the two.
At the very least, I hope existing efforts can continue and the FreeDesktop.org project should choose one or two new areas to focus on in bringing everyone together, like Strigi/Beagle or Solid. So please, before dismissing this out of hand, at the very least look over the above list and consider if any of those technologies could be or should be merged into a FreeDesktop standard library for everyone to use.
|
[
Reply To This | View ]
|
|
|
Great job!
by Pau Garcia i Quiles on Wednesday 04/Jul/2007, @01:51
|
Thank you for another great release of QtRuby! I hope we will see a lot of C# developers joining KDE development very soon.
|
[
Reply To This | View ]
|
Bindings
by Plopp on Wednesday 04/Jul/2007, @11:25
|
Stupid question, perhaps, but will any of the bindings be included by default with KDE 4.0? It would make writing in non-c++-languages more attractive, IMHO.
|
[
Reply To This | View ]
|
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|