[Top][All Lists]

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

[Libqtlua-list] Accessing QObject inside a property in Lua

From: Gustavo de Sá Carvalho Honorato
Subject: [Libqtlua-list] Accessing QObject inside a property in Lua
Date: Tue, 11 Jan 2011 12:27:53 -0200


I'm trying to access my MainWindow class throught a property which is
declared inside my Application class in Lua. I've declared the
MainWindow using Q_DECLARE_METATYPE(MainWindow*) and
qRegisterMetaType<MainWindow*>(). I've exposed my application class
using state["app"] = QtLua::Value(state, qApp, false).

The problem occurs when I try to access the MainWindow by typing
app.mainWindow:close() in Lua Console, and I got the error "error:
[string ""]:1: attempt to index field 'mainWindow' (a nil value)".

It's quite weird because when I type list(app) I can see that the
property mainWindow has a value QtLua::Property<MainWindow*>
mainWindow = Application::mainWindow.

Any help?

Thanks in advance,

reply via email to

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