Esempio n. 1
0
/*!
    \internal
*/
void QFormBuilder::updateCustomWidgets()
{
    d->m_customWidgets.clear();

    foreach (const QString &path, d->m_pluginPaths) {
        const QDir dir(path);
        const QStringList candidates = dir.entryList(QDir::Files);

        foreach (const QString &plugin, candidates) {
            if (!QLibrary::isLibrary(plugin))
                continue;

            QString loaderPath = path;
            loaderPath += QLatin1Char('/');
            loaderPath += plugin;

            QPluginLoader loader(loaderPath);
            if (loader.load())
                insertPlugins(loader.instance(), &d->m_customWidgets);
        }
    }
    // Check statically linked plugins
    const QObjectList staticPlugins = QPluginLoader::staticInstances();
    if (!staticPlugins.empty())
        foreach (QObject *o, staticPlugins)
            insertPlugins(o, &d->m_customWidgets);
}
Esempio n. 2
0
void QuadTree<Element,Comparator>::clearSubs() {
    QObjectList subs = QObject::children();
    while(!subs.empty())
    {
        QObject* qo = subs.front();
        subs.pop_front();
        delete qo;
    }
}