本文整理汇总了C++中QtBrowserItem::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ QtBrowserItem::parent方法的具体用法?C++ QtBrowserItem::parent怎么用?C++ QtBrowserItem::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtBrowserItem
的用法示例。
在下文中一共展示了QtBrowserItem::parent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: unFixItem
void IqtFit::unFixItem() {
QtBrowserItem *item = m_ffTree->currentItem();
QtProperty *prop = item->property();
if (prop->subProperties().empty()) {
item = item->parent();
prop = item->property();
}
item->parent()->property()->addSubProperty(m_fixedProps[prop]);
item->parent()->property()->removeSubProperty(prop);
m_fixedProps.remove(prop);
QtProperty *proplbl = prop->subProperties()[0];
delete proplbl;
delete prop;
}
示例3: getSelectedLayerId
/** Utiltiy function for retrieving the selected layer id
@return int The id of the selected layer or -1
*/
int QtSpacescapeMainWindow::getSelectedLayerId()
{
// get the current selected item
QtBrowserItem* bi = ui->layerProperties->currentItem();
if(!bi) {
return -1;
}
// get the top level layer this item belongs to
if(bi->parent()) {
while(bi->parent()) {
bi = bi->parent();
}
}
int index = ui->layerProperties->topLevelItems().indexOf(bi);
if(index > -1) {
return ui->layerProperties->topLevelItems().size() - 1 - index;
}
return -1;
}
示例4: onPropertiesCurrentItemChanged
// The current property item is changed. Update the help box.
void GenericHID::onPropertiesCurrentItemChanged( QtBrowserItem * current )
{
// Set the help text
if ( current == NULL || current->property() == NULL )
ui.textBrowser->setSource( QString(":index.html") );
else
{
QString sText = current->property()->toolTip();
if ( sText.isEmpty() )
{
QtBrowserItem * item = current;
while ( (item = item->parent()) != NULL )
{
sText = item->property()->toolTip();
if ( !sText.isEmpty() )
break;
}
}
ui.textBrowser->setSource( sText );
}
}