Ejemplo n.º 1
0
QWidget *VBoxSettingsTreeViewSelector::addItem (const QString & /* strBigIcon */,
                                                const QString &strMediumIcon ,
                                                const QString & /* strSmallIcon */,
                                                int aId,
                                                const QString &aLink,
                                                UISettingsPage* aPage /* = NULL */,
                                                int aParentId /* = -1 */)
{
    QWidget *result = NULL;
    if (aPage != NULL)
    {
        QIcon icon = UIIconPool::iconSet(strMediumIcon);

        SelectorItem *item = new SelectorItem (icon, "", aId, aLink, aPage, aParentId);
        mItemList.append (item);

        QTreeWidgetItem *twitem = new QTreeWidgetItem (mTwSelector, QStringList() << QString ("")
                                                                                  << idToString (aId)
                                                                                  << aLink);
        twitem->setIcon (treeWidget_Category, item->icon());
        aPage->setContentsMargins (0, 0, 0, 0);
        aPage->layout()->setContentsMargins(0, 0, 0, 0);
        result = aPage;
    }
    return result;
}
Ejemplo n.º 2
0
QWidget *VBoxSettingsTreeViewSelector::addItem (const QString & /* aBigIcon */,
                                                const QString & /* aBigIconDisabled */,
                                                const QString &aSmallIcon,
                                                const QString &aSmallIconDisabled,
                                                int aId,
                                                const QString &aLink,
                                                UISettingsPage* aPage /* = NULL */,
                                                int aParentId /* = -1 */)
{
    QWidget *result = NULL;
    if (aPage != NULL)
    {
        QIcon icon (aSmallIcon);
        if (aSmallIconDisabled.isEmpty())
            icon.addFile (aSmallIconDisabled, QSize(), QIcon::Disabled);

        SelectorItem *item = new SelectorItem (icon, "", aId, aLink, aPage, aParentId);
        mItemList.append (item);

        QTreeWidgetItem *twitem = new QTreeWidgetItem (mTwSelector, QStringList() << QString ("")
                                                                                  << idToString (aId)
                                                                                  << aLink);
        twitem->setIcon (treeWidget_Category, item->icon());
        aPage->setContentsMargins (0, 0, 0, 0);
        aPage->layout()->setContentsMargins(0, 0, 0, 0);
        result = aPage;
    }
    return result;
}
Ejemplo n.º 3
0
int VBoxSettingsToolBarSelector::linkToId (const QString &aLink) const
{
    int id = -1;
    SelectorItem *item = VBoxSettingsSelector::findItemByLink (aLink);
    if (item)
        id = item->id();
    return id;
}