[Top][All Lists]

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

Re: [Libqtlua-list] Qt API's available in QtLua

From: Gustavo de Sá Carvalho Honorato
Subject: Re: [Libqtlua-list] Qt API's available in QtLua
Date: Tue, 11 Jan 2011 23:39:47 -0200

On Tue, Jan 11, 2011 at 9:08 PM, Alexandre Becoulet
<address@hidden> wrote:
> On Monday, January 10, 2011 07:54:07 pm Gustavo de Sá Carvalho Honorato wrote:
> Hi,
>> I would like to know if the following tasks can be done in using Lua code:
>> 1) Implementing Custom Delegates
> This feature could be added, we just have to define a way to wrap the API in
> lua. The best way would probably be to have a ItemDelegate class which inherit
> from UserData or UserObject to expose lua callback functions for the
> createEditor, setEditorData, setModelData and updateEditorGeometry C++
> functions. I never used custom delegates yet, let me know what you think.

I'm thinking to implement my core application model and the
Supervising Controller Pattern
( using Lua.
I've made this decision because Lua has a lot of dynamic features such
easiness of implement aspect oriented programming through functional
programming which facilitates to implement the business logic. Also,
it's easier to mock and test the Supervising Controllers in Lua than
in C++. Finally, we are planning to make possible to extend the
application using plugins written in Lua.

>> 2) Drawing with QPainter API

I asked about the Qt Drawing API because the application which I'm
writting makes a heavy use QGraphicsView API. To create custom items
in QGraphicsView and Custom Delegates is often necessary to use
QPainter and other things related to drawing. To leverage the
extensibility of my application, it would be good to support extension
of QGraphicsView using Lua code.

>> 3) Access QUndoFramework (implementing QUndoCommand and using
>> QUndoStack in Lua code)
> QtLua was not designed to provide wrapping for the whole Qt API but rather to
> let the Qt application developper choose, and provide features to easily wrap
> what is needed and keep other things away from script access.
> Some important Qt UI features are wrapped in the "qt" lua table though.
> QtLua::Function must be used to wrap more (Have a look to src/
> A question remain about which Qt features are of general use and which are too
> specific to be wrapped in the library. Parts of the Qt API which allow
> extending application interface with the script language are of interest to
> me.

I thought and decided that the best place to put commands is in
Supervising Controllers. Because we plan to write Supervising
Controllers in Lua, it will be necessary to have access Qt Undo
Framework in Lua. Also, plugins written in Lua might need to declare
new commands to permit the user undo and redo specific tasks available
by the plugin.

> --
> Alexandre

reply via email to

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