Things i've made

Looking for more? See a list of everything i've made.

Saturday, December 3, 2011

Qt-Wrapper for Gtk nearly done

If you have been following my progress with the Gtk to Qt porting wrapper I am working on then you will be pleased to know that it has reached to %90-%95 functionality milestone. The large application I am porting works quite well for most workflows. Along the way I ended up creating a Gtk wrapper for the Qt wrapper on Scintilla so applications using the Gtk interface to Scintilla will compile and run without modification.

The most recent completed challenge was to perfectly emulate Gtk's hide/show mechanism. In Gtk, widgets are created hidden, you can then show them, or use show all which will show all child widgets as well. Additionally, Gtk widgets have a dont-show-all flag which will prevent a widget from being shown if its parent is part of a show-all operation. In Qt, a widget can be shown which will implicitly also show its children widgets unless they have been explicitly hidden in which case they will only become visible if explicit shown.  To emulate Gtk I simply hid each widget on creation and added a flag to indicate dont-show-all. When show is called, children widgets won't be shown because they were hidden. When showing all, it iterate through all child widgets and if the dont-show-all flag is not set, then I show all on those.

With the currently implemented in the wrapper, it is pleasing to take a Gtk application, compile it against the wrapper, and actually be able to use the compiled application.

Some nagging issues remain like event ordering or exact widget state which is not documented in Gtk. Its not possible to know every detail since some are specific to how Gtk is implemented rather than its intended functionality. This causes some headaches but with good debugging tools and some patience, the number of these issues is being reduced.

Want to see your Gtk application running in Qt?


  1. YES, this I have beeen waiting for, how can I join?

  2. Hi Ryan, I am highly interested, can you please contact me. Thanks in advance, Werner.

    1. Hi Werner. You can contact my via my profile.


Note: Only a member of this blog may post a comment.