[Qt] QT application without libQt4Pas
Den Jean
Den.Jean at telenet.be
Tue Jun 28 22:13:56 CEST 2011
On Tuesday 28 June 2011 21:00:39 Krzysztof wrote:
> "It is being reported that it may be possible to link to Qt 4 directly,
> using some tricks. Many think it is not. This is yet to be tested. It is
> expected that any such binding will be compatible with the currently
> utilized one, so the interface code won´t have to be changed."
>
> Where can I find this tricks? Are plans to add this feature?
There are no such plans as it is useless.
There is much more to a binding than only
calling methods of a C++ class.
A function available in the Qt C++ library like
QWidget::setMaximumWidth(int)
is directly available under
_ZN7QWidget15setMaximumWidthEi
This mangled name is however C++ compiler dependant.
Some of the functionality of Qt C++ is available to the C++ programmer
via the header and not via the dll. Namely all inline code and template stuff.
These things cannot be solved by directly calling the C++ library
from Pascal.
e.g You will not find the QWidget::width function in the Qt libtrary(dll)
as it is inlined.
qwidget.h extract:
inline int QWidget::width() const
{ return data->crect.width(); }
Furthermore this binding alleviates some of the problems of dealing with
C++ types by auto converting between pascal and C++.
binding source extract:
C_EXPORT void QWidget_setWindowTitle(QWidgetH handle, PWideString p1)
{
QString t_p1;
copyPWideStringToQString(p1, t_p1);
((QWidget *)handle)->setWindowTitle(t_p1);
}
Here the Pascal programmer can provide a Pascal string type (WideString)
and the binding source code converts it to a QString C++ class.
regards,
Den Jean
More information about the Qt
mailing list