[Kde-bindings] Default values?

Sohail Somani sohail at taggedtype.net
Sun Jun 22 03:31:51 UTC 2008


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




More information about the Kde-bindings mailing list