当前位置: 首页>>代码示例>>C++>>正文


C++ QtBrowserItem类代码示例

本文整理汇总了C++中QtBrowserItem的典型用法代码示例。如果您正苦于以下问题:C++ QtBrowserItem类的具体用法?C++ QtBrowserItem怎么用?C++ QtBrowserItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QtBrowserItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: renamePropertyTo

void ObjectTypesEditor::renamePropertyTo(const QString &name)
{
    if (name.isEmpty())
        return;

    QtBrowserItem *item = mUi->propertiesView->currentItem();
    if (!item)
        return;

    const QString oldName = item->property()->propertyName();
    if (oldName == name)
        return;

    const auto selectionModel = mUi->objectTypesTable->selectionModel();
    const auto selectedRows = selectionModel->selectedRows();

    for (const QModelIndex &index : selectedRows) {
        Properties properties = mObjectTypesModel->objectTypeAt(index).defaultProperties;
        if (properties.contains(oldName))
            properties.insert(name, properties.take(oldName));
        mObjectTypesModel->setObjectTypeProperties(index.row(), properties);
    }

    applyObjectTypes();
    updateProperties();
}
开发者ID:ihuangx,项目名称:tiled,代码行数:26,代码来源:objecttypeseditor.cpp

示例2: it

void MainWindow::updateExpandState()
{
    QList<QtBrowserItem *> list = propertyEditor->topLevelItems();
    QListIterator<QtBrowserItem *> it(list);
    while (it.hasNext()) {
        QtBrowserItem *item = it.next();
        QtProperty *prop = item->property();
        idToExpanded[propertyToId[prop]] = propertyEditor->isExpanded(item);
    }
}
开发者ID:Felipeasg,项目名称:QtPropertyBrowser,代码行数:10,代码来源:mainwindow.cpp

示例3: it

void PropertyBrowser::updateExpandState()
{
    QList<QtBrowserItem *> list = QtTreePropertyBrowser::topLevelItems();
    QListIterator<QtBrowserItem *> it(list);
    while (it.hasNext())
    {
        QtBrowserItem *item = it.next();
        QtProperty *prop = item->property();
        m_idToExpanded[m_propertyToId[prop]] = QtTreePropertyBrowser::isExpanded(item);
    }
}
开发者ID:OSLL,项目名称:sca,代码行数:11,代码来源:PropertyBrowser.cpp

示例4: itItem

void PropertyEditor::updateColors()
{
    if (m_treeBrowser && m_currentBrowser == m_treeBrowser) {
        QList<QtBrowserItem *> items = m_treeBrowser->topLevelItems();
        QListIterator<QtBrowserItem *> itItem(items);
        while (itItem.hasNext()) {
            QtBrowserItem *item = itItem.next();
            m_treeBrowser->setBackgroundColor(item, propertyColor(item->property()));
        }
    }
}
开发者ID:Fale,项目名称:qtmoko,代码行数:11,代码来源:propertyeditor.cpp

示例5: applyPropertiesFilter

void PropertyEditor::applyFilter()
{
    const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
    if (m_sorting) {
        applyPropertiesFilter(items);
    } else {
        QListIterator<QtBrowserItem *> itTopLevel(items);
        while (itTopLevel.hasNext()) {
            QtBrowserItem *item = itTopLevel.next();
            setItemVisible(item, applyPropertiesFilter(item->children()));
        }
    }
}
开发者ID:Fale,项目名称:qtmoko,代码行数:13,代码来源:propertyeditor.cpp

示例6: removeProperty

void PropertiesDock::removeProperty()
{
    QtBrowserItem *item = mPropertyBrowser->currentItem();
    Object *object = mMapDocument->currentObject();
    if (!item || !object)
        return;

    const QString name = item->property()->propertyName();
    QUndoStack *undoStack = mMapDocument->undoStack();
    undoStack->push(new RemoveProperty(mMapDocument, mMapDocument->currentObjects(), name));

    // TODO: Would be nice to automatically select the next property
}
开发者ID:WaylandGod,项目名称:tiled,代码行数:13,代码来源:propertiesdock.cpp

示例7: fixItem

void IqtFit::fixItem() {
  QtBrowserItem *item = m_ffTree->currentItem();

  // Determine what the property is.
  QtProperty *prop = item->property();

  QtProperty *fixedProp = m_stringManager->addProperty(prop->propertyName());
  QtProperty *fprlbl = m_stringManager->addProperty("Fixed");
  fixedProp->addSubProperty(fprlbl);
  m_stringManager->setValue(fixedProp, prop->valueText());

  item->parent()->property()->addSubProperty(fixedProp);
  m_fixedProps[fixedProp] = prop;
  item->parent()->property()->removeSubProperty(prop);
}
开发者ID:dezed,项目名称:mantid,代码行数:15,代码来源:IqtFit.cpp

示例8: renameProperty

void PropertiesDock::renameProperty()
{
    QtBrowserItem *item = mPropertyBrowser->currentItem();
    if (!mPropertyBrowser->isCustomPropertyItem(item))
        return;

    const QString oldName = item->property()->propertyName();

    QInputDialog *dialog = new QInputDialog(mPropertyBrowser);
    dialog->setInputMode(QInputDialog::TextInput);
    dialog->setLabelText(tr("Name:"));
    dialog->setTextValue(oldName);
    dialog->setWindowTitle(tr("Rename Property"));
    dialog->open(this, SLOT(renamePropertyTo(QString)));
}
开发者ID:ihuangx,项目名称:tiled,代码行数:15,代码来源:propertiesdock.cpp

示例9: renameProperty

void ObjectTypesEditor::renameProperty()
{
    QtBrowserItem *item = mUi->propertiesView->currentItem();
    if (!item)
        return;

    const QString oldName = item->property()->propertyName();

    QInputDialog *dialog = new QInputDialog(mUi->propertiesView);
    dialog->setInputMode(QInputDialog::TextInput);
    dialog->setLabelText(tr("Name:"));
    dialog->setTextValue(oldName);
    dialog->setWindowTitle(tr("Rename Property"));
    dialog->open(this, SLOT(renamePropertyTo(QString)));
}
开发者ID:ihuangx,项目名称:tiled,代码行数:15,代码来源:objecttypeseditor.cpp

示例10: renameProperty

void PropertiesDock::renameProperty(const QString &name)
{
    if (name.isEmpty())
        return;

    QtBrowserItem *item = mPropertyBrowser->currentItem();
    if (!item)
        return;

    const QString oldName = item->property()->propertyName();
    if (oldName == name)
        return;

    QUndoStack *undoStack = mMapDocument->undoStack();
    undoStack->push(new RenameProperty(mMapDocument, mMapDocument->currentObjects(), oldName, name));
}
开发者ID:WaylandGod,项目名称:tiled,代码行数:16,代码来源:propertiesdock.cpp

示例11: itProperty

int PropertyEditor::applyPropertiesFilter(const QList<QtBrowserItem *> &items)
{
    int showCount = 0;
    const bool matchAll = m_filterPattern.isEmpty();
    QListIterator<QtBrowserItem *> itProperty(items);
    while (itProperty.hasNext()) {
        QtBrowserItem *propertyItem = itProperty.next();
        QtProperty *property = propertyItem->property();
        const QString propertyName = property->propertyName();
        const bool showProperty = matchAll || propertyName.contains(m_filterPattern, Qt::CaseInsensitive);
        setItemVisible(propertyItem, showProperty);
        if (showProperty)
            showCount++;
    }
    return showCount;
}
开发者ID:Fale,项目名称:qtmoko,代码行数:16,代码来源:propertyeditor.cpp

示例12: currentItem

void GeneralTreeBrowser::contextMenuEvent(QContextMenuEvent *evt)
{
    QtBrowserItem *citem = currentItem();
    if(citem == 0)
        return;

    CBaseEditor *e = OgitorsRoot::getSingletonPtr()->GetSelection()->getAsSingle();

    LastProperty = static_cast<GeneralPropertiesViewWidget*>(parent())->getOgitorProperty(citem->property());

    if(!LastProperty)
        LastPropertyName = citem->property()->propertyName();
    else
        LastPropertyName = LastProperty->getName().c_str();

    if(e != 0)
    {
        UTFStringVector menuList;
        e->getPropertyContextMenu(LastPropertyName.toStdString(), menuList);
        
        if(menuList.size() > 0)
        {
            UTFStringVector vList;
            int counter = 0;
            QMenu* contextMenu = new QMenu(this);
            QSignalMapper *signalMapper = new QSignalMapper(this);

            for(unsigned int i = 0;i < menuList.size();i++)
            {
                OgitorsUtils::ParseUTFStringVector(menuList[i], vList);
                if(vList.size() > 0 && vList[0] != "")
                {                 
                    QAction *item = contextMenu->addAction( ConvertToQString(vList[0]), signalMapper, SLOT(map()), 0);
                    if(vList.size() > 1)
                        item->setIcon(QIcon(ConvertToQString(vList[1])));
                    signalMapper->setMapping(item, i);
                    counter++;
                }
            }
            if(counter)
            {
                connect(signalMapper, SIGNAL(mapped( int )), this, SLOT(contextMenu( int )));
                contextMenu->exec(QCursor::pos());
            }
            delete contextMenu;
            delete signalMapper;
        }
开发者ID:ZelconGames,项目名称:Ogitor-Facade,代码行数:47,代码来源:propertiesviewgeneral.cpp

示例13: QLatin1Char

void PropertyEditor::storePropertiesExpansionState(const QList<QtBrowserItem *> &items)
{
    const QChar bar = QLatin1Char('|');
    QListIterator<QtBrowserItem *> itProperty(items);
    while (itProperty.hasNext()) {
        QtBrowserItem *propertyItem = itProperty.next();
        if (!propertyItem->children().empty()) {
            QtProperty *property = propertyItem->property();
            const QString propertyName = property->propertyName();
            const QMap<QtProperty *, QString>::const_iterator itGroup = m_propertyToGroup.constFind(property);
            if (itGroup != m_propertyToGroup.constEnd()) {
                QString key = itGroup.value();
                key += bar;
                key += propertyName;
                m_expansionState[key] = isExpanded(propertyItem);
            }
        }
    }
}
开发者ID:Fale,项目名称:qtmoko,代码行数:19,代码来源:propertyeditor.cpp

示例14: storePropertiesExpansionState

void PropertyEditor::storeExpansionState()
{
    const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
    if (m_sorting) {
        storePropertiesExpansionState(items);
    } else {
        QListIterator<QtBrowserItem *> itGroup(items);
        while (itGroup.hasNext()) {
            QtBrowserItem *item = itGroup.next();
            const QString groupName = item->property()->propertyName();
            QList<QtBrowserItem *> propertyItems = item->children();
            if (!propertyItems.empty())
                m_expansionState[groupName] = isExpanded(item);

            // properties stuff here
            storePropertiesExpansionState(propertyItems);
        }
    }
}
开发者ID:Fale,项目名称:qtmoko,代码行数:19,代码来源:propertyeditor.cpp

示例15: applyPropertiesExpansionState

void PropertyEditor::applyExpansionState()
{
    const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
    if (m_sorting) {
        applyPropertiesExpansionState(items);
    } else {
        QListIterator<QtBrowserItem *> itTopLevel(items);
        const QMap<QString, bool>::const_iterator excend = m_expansionState.constEnd();
        while (itTopLevel.hasNext()) {
            QtBrowserItem *item = itTopLevel.next();
            const QString groupName = item->property()->propertyName();
            const QMap<QString, bool>::const_iterator git = m_expansionState.constFind(groupName);
            if (git != excend)
                setExpanded(item, git.value());
            else
                setExpanded(item, true);
            // properties stuff here
            applyPropertiesExpansionState(item->children());
        }
    }
}
开发者ID:Fale,项目名称:qtmoko,代码行数:21,代码来源:propertyeditor.cpp


注:本文中的QtBrowserItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。