Beispiel #1
0
QStackedWidgetEventFilter *QStackedWidgetEventFilter::eventFilterOf(const QStackedWidget *stackedWidget)
{
    // Look for 1st order children only..otherwise, we might get filters of nested widgets
    const QObjectList children = stackedWidget->children();
    const QObjectList::const_iterator cend = children.constEnd();
    for (QObjectList::const_iterator it = children.constBegin(); it != cend; ++it) {
        QObject *o = *it;
        if (!o->isWidgetType())
            if (QStackedWidgetEventFilter *ef = qobject_cast<QStackedWidgetEventFilter *>(o))
                return ef;
    }
    return 0;
}
QToolBoxHelper *QToolBoxHelper::helperOf(const QToolBox *toolbox)
{
    // Look for 1st order children only..otherwise, we might get filters of nested widgets
    const QObjectList children = toolbox->children();
    const QObjectList::const_iterator cend = children.constEnd();
    for (QObjectList::const_iterator it = children.constBegin(); it != cend; ++it) {
        QObject *o = *it;
        if (!o->isWidgetType())
            if (QToolBoxHelper *h = qobject_cast<QToolBoxHelper *>(o))
                return h;
    }
    return 0;
}
Beispiel #3
0
ButtonGroupList ButtonGroupCommand::managedButtonGroups(const QDesignerFormWindowInterface *formWindow)
{
    const QDesignerMetaDataBaseInterface *mdb = formWindow->core()->metaDataBase();
    ButtonGroupList bl;
    // Check 1st order children for managed button groups
    const QObjectList children = formWindow->mainContainer()->children();
    const QObjectList::const_iterator cend =  children.constEnd();
    for (QObjectList::const_iterator it =  children.constBegin(); it != cend; ++it) {
        if (!(*it)->isWidgetType())
            if (QButtonGroup *bg = qobject_cast<QButtonGroup *>(*it))
                if (mdb->item(bg))
                    bl.push_back(bg);
    }
    return bl;
}