libqtlua-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libqtlua-list] Lua namespace does not fit in with Qt reference


From: Alexandre Becoulet
Subject: Re: [Libqtlua-list] Lua namespace does not fit in with Qt reference
Date: Tue, 09 Sep 2014 02:00:16 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 Emacs/24.3 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

> Hello everybody,

Hi,

> I recently discovered some issues using libqtlua-2.0 with Qt
> 4.6.3. My goal was to call a QDialog in modal (!!!) mode from within
> an MFC application using Lua.

Nice! I'am only working under GNU/Linux and never used MFC, but I'll
try to help out. I'am glade you are able to use QtLua this way.
 
> 1) Why is there no "setModal"-property even though it is documented
> in the Qt references?

Not all functions and members of the Qt API are exposed by the Qt meta
objects system (see the Qt manual on this topic). QtLua is only able
to provide what is dynamically exposed by Qt. Only properties, signals
and slots are. Regular methods are not. 'setModal' is a regular method
designed to access the 'modal' property.

> 3) Why do you even rename things and therefore leave the Qt
> specification? In the file "qtluametacache.cc", there are three
> lines where you are doing that: for methods, enumerations and
> properties.

Renamming occurs when there are multiple members with the same name
defined in parent classes. It is not possible to distinguish between
parent members of inherited classes in Lua as you could do in C++.
QtLua has to do some renaming when there are name colisions, so that
members from parent classes are not shadowed.

> 2) Why do you rename the property "modal" to "modal_p"?

Those are two different properties. The 'modal' property is defined
twice in C++, in the QWidget class and in the QDialog class. Check the
manual.

> And as far as I could figure out, all these things above also come
> up when trying to use another property of QDialog called
> "setSizeGripEnabled". This leads me to the assumption that the
> property-handling of QtLua in general has some bugs.

Not the one you may think actually.:)

> I've commented out those lines in "qtluametacache.cc" mentioned
> above and have called the modal-property like: "myQtDialog.modal =
> true" in Lua and: The dialog now displayed is modal!

What if you used myQtDialog.modal_p = true instead? Please let me know.
 
> I don't know what you are going to do with this information. I hope
> it will contribute to an improvement of the QtLua-project as this is
> really a great tool to work with.

Thanks for your report.
 
Best,

> P.S.: Modality of Qt-Widgets and MFC/win32-applications is a really
> tricky thing. A central element is the QWinWidget in the Qt/MFC
> migration framework. This widget MUST be the parent of all other
> QWidgets you create; even of those being created in the Lua script!
> I was not able to find any information about how to achieve this
> parenting-stuff using standard mechanisms. I, too, had to modify the
> code here and there, but this is another issue. I just wanted to add
> this for the sake of completeness.

-- 
Alexandre



reply via email to

[Prev in Thread] Current Thread [Next in Thread]