本文整理汇总了C++中PropertyItem::boundingRect方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyItem::boundingRect方法的具体用法?C++ PropertyItem::boundingRect怎么用?C++ PropertyItem::boundingRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyItem
的用法示例。
在下文中一共展示了PropertyItem::boundingRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: foreach
foreach(const Property property, component()->propertyMap()) {
if(property.isVisible()) {
bool newlyCreated = false;
//Create new property item if it doesn't exist.
if(!m_propertyItemsMap.contains(property.name())) {
PropertyItem *item = new PropertyItem(property.name(),
schematicScene());
QFont font = item->font();
if(font.pointSize() != m_pointSize) {
font.setPointSize(m_pointSize);
item->setFont(font);
}
m_propertyItemsMap.insert(property.name(), item);
newlyCreated = true;
}
PropertyItem *item = m_propertyItemsMap[property.name()];
visibleItemsCount++;
QList<QGraphicsItem*> _children = QGraphicsItemGroup::children();
if(!_children.isEmpty()) {
//Place the new item at bottom, properly aligned with group.
QPointF itemPos = mapToScene(boundingRect().bottomLeft());
itemPos.rx() -= item->boundingRect().left();
item->setPos(itemPos);
}
else {
savePos.rx() -= item->boundingRect().left();
item->setPos(savePos);
}
addToGroup(item);
if(newlyCreated) {
item->updateValue();
}
}
else {
// Delete item if it existed before as it is being hidden now.
if(m_propertyItemsMap.contains(property.name())) {
PropertyItem *item = m_propertyItemsMap[property.name()];
m_propertyItemsMap.remove(property.name());
delete item;
}
}
}