[Top][All Lists]

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

[Libqtlua-list] Extract QObject from Lua

From: David Palacio
Subject: [Libqtlua-list] Extract QObject from Lua
Date: Thu, 29 Sep 2011 17:21:02 -0500
User-agent: Mutt/1.5.21 (2010-09-15)


I have exposed some QObjects to the Lua enviroment to let the automatic
bindings to properties and slots do most of the work. I also want to use those
QObjects as arguments tin Lua functions written in C++. I have found this
difficult to get. Right now I use this on a function meta_call:

QtLua::Value val = get_arg<QtLua::Value>(args,0);
QObjectWrapper::ptr optr = 
Plasma::Containment *c = 

1. Get a generic Value 
2. Cast the generic Value to a QObjectWrapper. I need the
   QObjectWrapper internal header to do this.
3. Cast the qobject to the desired class.

It works but, I would like to do it with the public API.
I can not use UserData derived classes because these objects are not created in
my application but in a KDE library.

It is good to be able to wrap a QObject in a Value. I think it would be great
to get it back with a Value::to_qobject function.


reply via email to

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