Hotel booked – check, flight booked – check!
Author: Johan Thelin
Nordic Free Software Award
The Nordic Free Software Award given to people, projects or organisations in the Nordic countries that have made a prominent contribution to the advancement of Free Software. The award will be announced during FSCONS 2010 in Gothenburg.
If you want to nominate someone or something, you can find more information here.
Smart Installer for Symbian
Could anyone enlighten me as to where one files bugs in the Smart Installer for Symbian? Apparently it does not play well without a SIM-card…
DLLs from Qt SDK
When installing the Qt SDK for Windows you get a set of pre-compiled Qt libraries as well as Qt Creator.
When using this Qt version for building an installer, it is important to pick the correct Qt dlls to ship with your application.
The SDK comes with two sets of dlls. One set resides in $BASEDIR/bin and the other in $BASEDIR/qt/bin. The former contains the dlls used by Qt Creator, while the latter are the dlls that you want to ship with your executable.
Thanks to Marcus for this tip!
QFtp needs login
First post with WordPress 3.0 – fingers crossed but so far it looks good!
I’ve learned a small detail today – QFtp requires login even if you do not have any username or password to give the server. Saves some time from debugging time knowing that calling login once fixes this. (Yes, me stupid)
For those of you learning Qt or wanting to get started with Qt, I will hold a session on the Kubuntu Tutorial Day. I hope to see you there!
Also, great rainy weekend. Got loads of stuff done ranging from catching up on some work to restructuring parts of the garage.
Pre-vacation Stress
It has been a long time since I blogged last. Life has been chaotic, and as June closes to an end, it is getting worse. However, I’ve promised myself to clear all current projects during June (apart from some continuously ongoing stuff) to have a fresh start after my summer vacation.
Loads of exciting things are happening this fall. Some highlights are:
- I will start working full-time at my new employer, Pelagicore.
- FSCONS will take place, and this year with more technical contents than ever and a specialized embedded track which I’m co-organizing.
- I will continue with my QtLunch concept. If you are in the vicinity of Gothenburg and want to learn more about Qt and enjoy a good meal with fellow Qt users, drop me a mail!
- I will blog more frequently… :-)
Package names
Dear lazy web,
>Overload
>It has been quite some time since I last blogged. Lots of things are going on, so the time to sit down and reflect has been… let’s say limited.
Qt as GTK, again
Another set of night hours spent hacking on making the GTK API wrap Qt. I focused on adding functionality and not on cleaning up, so no code this time either. I just want to show the progress.
- Replaced the gtk/gtk.h headerfile with my substitute.
The next example, table packing, simply demonstrates the grid layout abilities of GTK. There seems to be a couple of pixels between the rows for some reason (I will investigate at a later point), but apart from that, everything works. The changes made are the same as for the first example.
- Replaced the gtk/gtk.h header with my substitute.
Robin Burchell (w00t) has attempted something similar in the gqt project (gitorious link). We will discuss how we can join forces ASAP (I’ve been sort of unavailable this weekend). The gqt project has clean code – look great. It employs a different approach than I when it comes to mapping signals/slots/events and for handling the construction of menus.
- Replaces the gtk/gtk.h header file with my substitute.
- The popup is always shown at (100, 100) as the GdkEvent structure cannot be cast to a GdkEventButton structure.
void gtk_container_set_border_width(QObject *o_w, int spacing) { QT_WIDGET_ASSERT(w)w->setContentsMargins(spacing,spacing,spacing,spacing); }
>GTK+ made Qt
>Disclaimer! First of all – this is not an attack on any toolkit, nor critique. Rather, it is a hacker sitting down and trying out an idea.
- Event handling functions get NULL instead of a GdkEvent pointer.
- Packing flags (e.g. homogenus and spacing when calling gtk_hbox_new) ignored – I simply use QVBoxLayout, QHBoxLayout and QGridLayout where they fit best.
- Only a minimalist part of the API has been implemented (the process is build, add missing symbols, repeat)
- Most GtkXxx classes are defined to a QWidget. Objects are casted up and down all over the place to work around this.
However, the problem isn’t really matching the APIs to each other and getting every pixel right. At least, that is not the current problem. Instead, matching Qt’s C++ style OO to GTK+’s is the problem. What are the differences? I hear you ask.
#define G_OBJECT(obj) ((QObject*)(obj))
#define G_CALLBACK(func) ((void*)(func))
typedef void* gpointer;
typedef bool gboolean;
typedef char gchar;
#define g_print qDebug
...
#define GtkWidget QWidget
void gtk_widget_show(QWidget *w) { w->show(); }
#define GTK_WINDOW_TOPLEVEL (0)
QWidget *gtk_window_new(int) { return new QWidget(); }
void gtk_window_set_title(GtkWindow *w, const char *t) { w->setWindowTitle(QString(t)); }
...
#define GTK_BOX(obj) (obj->layout())
void gtk_box_pack_start(QLayout *l, QWidget *w, bool expand, bool fill, int padding) { l->addWidget(w); }
void g_signal_connect(QObject *src, const char *cstrEventName, void *f, void *data)
{
QString eventName = QString(cstrEventName);
if (eventName.endsWith("_event"))
{ // This is an event, f is an eventFuncPtr
QObject *o = QGtkEventFilter::createFilter(eventName, eventFuncPtr(f), data);
if(o)
src->installEventFilter(o);
else
qWarning("Failed to match GTK event '%s' to a Qt event filter.", cstrEventName);
}
else
{ // This is a callback, f is an callbackFuncPtr
QObject *o = new QGtkCallbackBridge(src, callbackFuncPtr(f), data);
const char *signalName = 0;
if(eventName == "clicked")
signalName = SIGNAL(clicked());
if (signalName)
QObject::connect(src, signalName, o, SLOT(trigger()));
else
qWarning("Failed to match GTK signal '%s' to a Qt signal.", cstrEventName);
}
}