Board index » kylix » Comming up: Qt3 support for Kylix

Comming up: Qt3 support for Kylix


2004-08-01 08:55:59 AM
kylix2
You had not heard something about new VisualCLX patches because I was
working on a Qt 3 C-wrapper shared object. Now the shared object is
created and my next step is to write/generate the Kylix import classes
(yes I want classes not only the global functions). The wrapper unit
supports all what Qt 3.3.2 offers. There is not only the visual stuff like
QWidget, QDialog, ... but also the tools (QString, QXml, ...) and internet
classes ( QUrl, QSocket, ... ) and last but not least the database support
(QSql, QSqlDatabase, ... ) in the C-Wrapper.
All signals can be "hook-connected" to functions and every
virtual/abstract method can be overriden by a Delphi function. Also the
C++ templates that are used by Qt classes like QWidgetList which derives
from QPtrList<QWidget>are available. In the case of QPtrList<QWidget>it
is QPtrList__tpl__QWidget. But there is no need to access the QWidgetList
(base class) methods by this ugly name, because you can use the up-comming
QWidgetList class. Most overloaded operators (like operator=, operator==,
...) are also accessibly through methods with special names (where the
names follow the Delphi 8 names).
The whole libqtc.so (that's the name of the shared object, sounds familar?
Yes there was a subproject of kdebindings but this subproject was removed
from the CVS server) is autogenerated without any hand written code (ok,
there is hand written code, but these are only the base classes for the
signal hooks and override hooks which is about 40 lines). The KDE import
is also planned but first I want a working Qt version. The size of the
shared object is 6.7 MB (but keep in mind: it contains all what Qt
offers). The shared object is not a stand alone file. It requires libqt-mt
(or libqt.so) (makes further 9 MB which are on all systems that use KDE).
So I hope I can release the first Kylix Qt 3 class framework on monday.
(depends on the bugs I will find).
Those who cannot wait can download the current C code from
CVS: :pserver: XXXX@XXXXX.COM :/cvsroot/qtcsharp
Module: Bugtussle
Now it is out. The source code is part of the Qt# project. The C-Writer is
now complete and the C#Writer must be overworked. But before I will do
this I must test the generated libqtc.so. And what would be better that
using Kylix for this task? :-)
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 
 

Re:Comming up: Qt3 support for Kylix

Andreas Hausladen wrote:
Quote
Those who cannot wait
Oh I forgot. You must have Mono 1.0 (or later) installed.
(www.go-mono.com)
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Comming up: Qt3 support for Kylix

Andreas Hausladen wrote:
Quote
You had not heard something about new VisualCLX patches because I was
working on a Qt 3 C-wrapper shared object. Now the shared object is
created and my next step is to write/generate the Kylix import classes
(yes I want classes not only the global functions). The wrapper unit
supports all what Qt 3.3.2 offers. There is not only the visual stuff like
QWidget, QDialog, ... but also the tools (QString, QXml, ...) and internet
classes ( QUrl, QSocket, ... ) and last but not least the database support
(QSql, QSqlDatabase, ... ) in the C-Wrapper.

All signals can be "hook-connected" to functions and every
virtual/abstract method can be overriden by a Delphi function. Also the
C++ templates that are used by Qt classes like QWidgetList which derives
from QPtrList<QWidget>are available. In the case of QPtrList<QWidget>it
is QPtrList__tpl__QWidget. But there is no need to access the QWidgetList
(base class) methods by this ugly name, because you can use the up-comming
QWidgetList class. Most overloaded operators (like operator=, operator==,
...) are also accessibly through methods with special names (where the
names follow the Delphi 8 names).

The whole libqtc.so (that's the name of the shared object, sounds familar?
Yes there was a subproject of kdebindings but this subproject was removed
from the CVS server) is autogenerated without any hand written code (ok,
there is hand written code, but these are only the base classes for the
signal hooks and override hooks which is about 40 lines). The KDE import
is also planned but first I want a working Qt version. The size of the
shared object is 6.7 MB (but keep in mind: it contains all what Qt
offers). The shared object is not a stand alone file. It requires libqt-mt
(or libqt.so) (makes further 9 MB which are on all systems that use KDE).

So I hope I can release the first Kylix Qt 3 class framework on monday.
(depends on the bugs I will find).

Those who cannot wait can download the current C code from
CVS: :pserver: XXXX@XXXXX.COM :/cvsroot/qtcsharp
Module: Bugtussle

Now it is out. The source code is part of the Qt# project. The C-Writer is
now complete and the C#Writer must be overworked. But before I will do
this I must test the generated libqtc.so. And what would be better that
using Kylix for this task? :-)

This is the best thing I've heard after K3 was out :)))
tnx andreas :)
 

{smallsort}

Re:Comming up: Qt3 support for Kylix

Quote
>Now it is out. The source code is part of the Qt# project. The C-Writer is
>now complete and the C#Writer must be overworked. But before I will do
>this I must test the generated libqtc.so. And what would be better that
>using Kylix for this task? :-)
>


This is the best thing I've heard after K3 was out :)))
tnx andreas :)
If I'm not mistaken: You have to GPL your application if you use this
new binding, right?
Willi
 

Re:Comming up: Qt3 support for Kylix

Willibald Krenn wrote:
Quote
If I'm not mistaken: You have to GPL your application if you use this
new binding, right?
Or buy a Qt licence. And ask the Qtcsharp project to release it under
GPL/QPL.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Comming up: Qt3 support for Kylix

Willibald Krenn wrote:
Quote

>>Now it is out. The source code is part of the Qt# project. The C-Writer
>>is now complete and the C#Writer must be overworked. But before I will do
>>this I must test the generated libqtc.so. And what would be better that
>>using Kylix for this task? :-)
>>
>
>
>This is the best thing I've heard after K3 was out :)))
>tnx andreas :)

If I'm not mistaken: You have to GPL your application if you use this
new binding, right?
yes.
 

Re:Comming up: Qt3 support for Kylix

Quote
>If I'm not mistaken: You have to GPL your application if you use this
>new binding, right?

yes.
Now, this also implies that Andreas is not allowed to create a design-time
Visual CLX version with the QT 3.3 wrapper..
Hmm,
Willi
 

Re:Comming up: Qt3 support for Kylix

willi krenn wrote:
Quote
Now, this also implies that Andreas is not allowed to create a
design-time Visual CLX version with the QT 3.3 wrapper..
From the Qt 3.3 wrapper it would be a long way to a VisualCLX version. I
will not say it is impossible (to write the code) but at the moment I have
other things to manage. And a Qt 2.3 application (=VisualCLX) cannot be
ported in with search&replace to Qt 3.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Comming up: Qt3 support for Kylix

I have a design question: How should the destruction of a Qt 3 object look?
var
w: QWidgetH;
begin
w := QWidgetH.New(nil, nil, 0);
w.resize(100, 200);
w.show();
// 1. destruction. Delete is a reserved word on C++ so
// there will be no name conflict. The New() and Delete()
// are the C++ way.
w.Delete;
// 2. destruction. The .NET way and this would match the
// QWidgetH.New() construction class procedure.
w.Dispose;
// 3. destruction. The Delphi way.
w.Free;
end;
You cannot inherit from these Qt wrapper classes because the Delphi VMT
would be used a a field by the C++ code. For inheritance I will write a
second unit that uses the Qt3Library.pas unit.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Comming up: Qt3 support for Kylix

How about a similar thing for wxWidgets ? Will it be very hard ?
-Kathire
 

Re:Comming up: Qt3 support for Kylix

Quote

Oh I forgot. You must have Mono 1.0 (or later) installed.
(www.go-mono.com)

I don't understand. What has the Qt 3 C-wrapper shared object to do with
Mono ? What has Kylix (crating native code and not CIL assemblies) to do
with a .NET framework ? Does this open a path for having Delphi code
running on Linux via CIL ?
Moreover what can the Qt 3 C-wrapper offer to Delphi and Kylix users ?
Please explain !
-Michael
 

Re:Comming up: Qt3 support for Kylix

Michael Schnell wrote:
Quote
I don't understand. What has the Qt 3 C-wrapper shared object to do with
Mono ?
The libqtc.so and Qt3Library.pas generator program is written in C#. So
you need Mono to compile the libqtc.so and the Qt3Library.pas unit.
Quote
Moreover what can the Qt 3 C-wrapper offer to Delphi and Kylix users ?
It offers all Qt classes with all methods, global functions and global
variables (QApplication* qApp). Furthermore it allows you to write your
own signals and connect them to yours or Qt's slots through an SignalHook.
And it allows you to override every virtual method through OverrideHooks.
How to override a virtual method (at the moment it is not really clear how
it will be done in Qt3Libraray.pas, but here is the code that would be
hidden by something else):
procedure QWidgetOverrideResize(Handle: QWidgetH; x, y: Integer); cdecl;
begin
if DoNotAllowResize then
ShowMessage('You want to resize me? That is not possible at the
moment.')
else
QWidgetH.baseResize(Handle, x, y);
end;
var
w: QWidgetH;
begin
w := QWidget.New(nil, nil, 0);
w.OverrideHook.overrideResize(@QWidgetOverrideResize);
DoNotAllowResize := False;
w.resize(100, 100);
DoNotAllowResize := True;
w.resize(10, 10); // shows up the messagebox
w.Delete;
end;
My plan is to write a second unit (if the Qt3Library compiles without an
error, what it not does at the moment) that is a wrapper for the
Qt3Library classes and allows normal inheritance. The Qt3Library classes
do not allow Delphi inheritance and instantiation. The second wrapper
would also replace the QStringH parameters by WideString (what makes live
easier in Delphi because operator overloading does not exist in pre Delphi
8).
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Comming up: Qt3 support for Kylix

kathire wrote:
Quote
How about a similar thing for wxWidgets ? Will it be very hard ?
I have not tried it yet. But the less templates are used, the more is the
possibility to get it working. And it depends on doxygen that generates
the xml files that are used the libqtc generater. But first I will try to
get Qt3 working.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
 

Re:Comming up: Qt3 support for Kylix

Andreas Hausladen wrote:
Quote
Michael Schnell wrote:

>I don't understand. What has the Qt 3 C-wrapper shared object to do
>with Mono ?

The libqtc.so and Qt3Library.pas generator program is written in C#.
So you need Mono to compile the libqtc.so and the Qt3Library.pas unit.
[...]
What was the point in that?
 

Re:Comming up: Qt3 support for Kylix

Bob Goddard wrote:
Quote
What was the point in that?
The reason was, that I have joined the Qt# project. And the APILoader that
loads the xml files, generates C and C# code is written in C#. I have
almost rewritten all methods and added a KylixWriter.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)