本文整理汇总了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();
}
示例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);
}
}
示例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);
}
}
示例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()));
}
}
}
示例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()));
}
}
}
示例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
}
示例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);
}
示例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)));
}
示例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)));
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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());
}
}
}