bool QUiBuilder::InitializeLoader( QString strUiResName, QWidget* pkParent, QString strPluginPath ) { if ( !pkParent ) { return false; } QUiLoader kLoader; if ( false == strPluginPath.isEmpty() ) { kLoader.addPluginPath( strPluginPath ); } QFile kFile( strUiResName ); if( !kFile.open( QFile::ReadOnly ) ) { return false; } m_pkLoadedWidget = kLoader.load( &kFile, pkParent ); if ( !m_pkLoadedWidget ) { return false; } kFile.close(); return true; }
static int qtuiloader_addPluginPath(lua_State *L) { QUiLoader *loader = luaQ_checkqobject<QUiLoader>(L, 1); const char *path = luaL_checkstring(L, 2); loader->addPluginPath(QFile::decodeName(path)); return 0; }