[Kde-bindings] Default values?

Mauro Iazzi mauro.iazzi at gmail.com
Sun Jun 22 09:55:28 UTC 2008


Hi,

you may want to have a look at my lqt project. It contains Qt4 bindings for
Lua ( http://www.lua.org ), which is a language with ANSI C interface.

lqt is not part of the KDE project, and it does not have KDE bindings yet,
though I plan to include them at some point. It also does not use Smoke. I
only worked on it in Linux, so I don't know how it would work on other
platforms (though it should be quite portable).

You can find lqt in its git repository
http://repo.or.cz/w/lqt.git
The snapshots include a BUILD file which should help understanding how it
works.

One of the steps of the bindings generation is an XML description of the Qt
API, which includes the information you want. It does not create a separate
C binding before the Lua one, but it should not be too difficult to do.

It is not very well documented yet, so feel free to ask question if
something is not clear.

mauro

2008/6/22 Sohail Somani <sohail at taggedtype.net>:

> Hey,
>
> I'm part of the way through generating a C-API for Qt but am confused
> about Smoke and default values.
>
> The idea is that given the constructor:
>
> QLabel(QWidget* parent=0, Qt::WindowFlags f = 0);
>
> I would generate:
>
> q_label*
> q_label_0();
>
> q_label*
> q_label_1_widget(q_widget* parent);
>
> q_label*
> q_label_2_widget_window_flags(q_widget* parent, q_window_flags flags);
>
> This does not seem to be currently possible. For example, using rbqtapi,
> one sees the following constructors for QLabel:
>
> QLabel* QLabel::QLabel(QWidget*)
> QLabel* QLabel::QLabel(QWidget*, const char*)
> QLabel* QLabel::QLabel(QWidget*, const QString&, QWidget*)
> QLabel* QLabel::QLabel(QWidget*, const QString&, QWidget*, const char*)
> QLabel* QLabel::QLabel(QWidget*, const QString&, QWidget*, const char*,
>                        Qt::WFlags)
> QLabel* QLabel::QLabel(QWidget*, const char*, Qt::WFlags)
> QLabel* QLabel::QLabel(const QString&, QWidget*)
> QLabel* QLabel::QLabel(const QString&, QWidget*, const char*)
> QLabel* QLabel::QLabel(const QString&, QWidget*, const char*,
>                        Qt::WFlags)
>
> I would have expected QLabel::QLabel() to be one of these overloads.
>
> The reason I am doing this is that I want to generate bindings for a
> language that has only a C interface and I wanted to do as much as
> possible in the language rather than in C++. I foresee the definitions
> of each C function to be quite straightforward.
>
> Does anyone know if a C-binding for Qt has been developed (or am I doing
> it totally wrong?)
>
> --
> Sohail Somani
> http://uint32t.blogspot.com
>
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20080622/bc482e3e/attachment.html>


More information about the Kde-bindings mailing list