示例#1
0
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;
}
示例#2
0
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;
}