Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-09

qt45 lclwebkit2

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thomas Moritz

Hello,
i have compiled lazarus r 21928 with qt45 and
bindings libqt4intf v1.72.

The demo "lclwebkit2" from the homepage of
libqt4intf gives 10 errors, what is going wrong?

settingsdlgu.pas(45,5) Warning: Destructor should be public
settingsdlgu.pas(44,17) Warning: An inherited method is hidden by "constructor TSettingsDlg.Create(TComponent);"
settingsdlgu.pas(33,46) Hint: Parameter "CloseAction" not used
main.pas(79,17) Warning: An inherited method is hidden by "constructor TWebPanel.Create(TWinControl, QNetworkAccessManagerH, TEdit, TProgressBar);"
main.pas(292,99) Error: Incompatible type for arg no. 2: Got "TMethod", expected "<procedure variable type of procedure of object;CDecl>"
qt45.pas(622,13) Hint: Found declaration: QObject_hook_hook_destroyed(QObject_hookH, QObject_destroyed_Event); CDecl;
main.pas(305,51) Error: Incompatible type for arg no. 2: Got "TMethod", expected "<procedure variable type of procedure(QUrlH) of object;CDecl>"
qt45.pas(13497,11) Hint: Found declaration: QWebView_hook_hook_urlChanged(QWebView_hookH, QWebView_urlChanged_Event); CDecl;
main.pas(308,52) Error: Incompatible type for arg no. 2: Got "TMethod", expected "<procedure variable type of procedure of object;CDecl>"

...and much more.

Regards Th. Moritz

Reply by email

Den Jean
to Thomas Moritz
Thomas Moritz wrote
The demo "lclwebkit2" from the homepage of libqt4intf gives 10 errors, what is going wrong?

Version 1.72 of the FreePascal Qt4 Binding improved Qt Signal hooking (more type safe). When hooking a pascal method to a Qt signal, the method type is checked now.

The LCL/Qt WebKit demo was updated together with the binding, you need to download the new version of the demo again. To accommodate for windows users, it is a zip file now.

The LCL/Qt WebKit demo is not meant to be full blown browser, it just provides a demonstration of cookie saving,tabbed browsing, proxy usage,server authentication,flash,printing, ...

http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

kind regards,

Den Jean

Reply by email

zeljko
to Den Jean
Den Jean wrote 7 lines
On Wednesday 30 September 2009 12:43:32 Thomas Moritz wrote: > The demo "lclwebkit2" from the homepage of > libqt4intf gives 10 errors, what is going wrong? Version 1.72 of the FreePascal Qt4 Binding improved Qt Signal hooking (more type safe). When hooking a pascal method to a Qt signal, the method type is checked now.

And I must tell you that some strange ide crashes (linux with pretty old Xorg 6.8.2) which happens before 1.72 just dissapeared with new hooks (yes, I can reproduce that each time before 1.72 , now I cannot - so it seem to be nice thing with new signal hooking) :))))

zeljko

Reply by email

Den Jean
to zeljko
And I must tell you that some strange ide crashes (linux with pretty old Xorg 6.8.2) which happens before 1.72 just dissapeared with new hooks

:-[ as already mentioned on the LCL/Qt ML I also fixed a bug (since V1.71)

The type safe calling should not change anything to existing correct code. It just verifies at compile time that the signature of the provided Pascal Method is of the correct type.

Hooking a signal of a Qt Object X to a Pascal Object Method, works by creating a hooking object HOOK written in Qt/C++, that stores the address of the Pascal Object Method and the address/handle of the Qt Object X.

The HOOK connects to the signal of X and calls the Pascal method when the signal occurs.

In the destructor of the hook, I disconnected from the Qt Object X. But in the mean time the stored handle to X could have become invalid, if the Qt Object X had been destroyed.

Now the HOOK also connects to the destroyed signal of X, and invalidates the handle to it, upon reception of that destroyed signal.

(yes, I can reproduce that each time before 1.72 , now I cannot - so it seem to be nice thing with new signal hooking) :))))

If you can reproduce it easily, you could enable the debugging printfs I left in qobject_hook.h and verify it is related to this bug fix. http://lists.lazarus.freepascal.org/pipermail/qt/2009-September/001272.html

regards,

Den Jean

Reply by email

zeljko
to Den Jean
Den Jean wrote 30 lines
> And I must tell you that some strange ide crashes (linux with pretty old > Xorg 6.8.2) which happens before 1.72 just dissapeared with new hooks > :-[ as already mentioned on the LCL/Qt ML I also fixed a bug (since V1.71) The type safe calling should not change anything to existing correct code. It just verifies at compile time that the signature of the provided Pascal Method is of the correct type. Hooking a signal of a Qt Object X to a Pascal Object Method, works by creating a hooking object HOOK written in Qt/C++, that stores the address of the Pascal Object Method and the address/handle of the Qt Object X. The HOOK connects to the signal of X and calls the Pascal method when the signal occurs. In the destructor of the hook, I disconnected from the Qt Object X. But in the mean time the stored handle to X could have become invalid, if the Qt Object X had been destroyed. Now the HOOK also connects to the destroyed signal of X, and invalidates the handle to it, upon reception of that destroyed signal. > (yes, I can > reproduce that each time before 1.72 , now I cannot - so it seem to be > nice thing with new signal hooking) :)))) If you can reproduce it easily, you could enable the debugging printfs I left in qobject_hook.h and verify it is related to this bug fix. http://lists.lazarus.freepascal.org/pipermail/qt/2009-September/001272.html

I think it is .... but now I cannot revert to older bindings ... no time for such tests .... new hooks done it's job definitelly.

Reply by email

Thomas Moritz
to Den Jean: Version 1.72 of the FreePascal Qt4 Binding improved Qt Signal hooking (more type safe).…

Am Mittwoch 30 September 2009 18:49:59 schrieb Den Jean:

Hello Den Jean,

Show quoted text 11 lines
On Wednesday 30 September 2009 12:43:32 Thomas Moritz wrote: > The demo "lclwebkit2" from the homepage of > libqt4intf gives 10 errors, what is going wrong? Version 1.72 of the FreePascal Qt4 Binding improved Qt Signal hooking (more type safe). When hooking a pascal method to a Qt signal, the method type is checked now. The LCL/Qt WebKit demo was updated together with the binding, you need to download the new version of the demo again. To accommodate for windows users, it is a zip file now.

Sorry! One day bevore, i have downloaded "lclwebkit2.tar.gz". The zip-file is a helpful demo. Thanks!

Regards Th. Moritz

Reply by email