本文整理汇总了C++中QScrollArea::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::parent方法的具体用法?C++ QScrollArea::parent怎么用?C++ QScrollArea::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::parent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createEditor
//-----------------------------------------------------------------------------
// Function: RemapConditionDelegate::createEditor()
//-----------------------------------------------------------------------------
QWidget* RemapConditionDelegate::createEditor(QWidget* parent, QStyleOptionViewItem const& option,
QModelIndex const& index) const
{
if (index.column() == RemapConditionColumns::NAME_COLUMN)
{
ReferenceSelector* referenceSelector = new ReferenceSelector(parent);
QStringList visiblePortNames = availablePortNames_;
QString selectedName = index.model()->data(index, Qt::DisplayRole).toString();
if (componentPortNames_.contains(selectedName))
{
visiblePortNames.append(selectedName);
}
referenceSelector->refresh(visiblePortNames);
return referenceSelector;
}
else if (index.column() == RemapConditionColumns::VALUE_COLUMN && valueIsArray(index))
{
ArrayView* editor = new ArrayView(parent);
QScrollArea* scrollingWidget = new QScrollArea(parent);
scrollingWidget->setWidgetResizable(true);
scrollingWidget->setWidget(editor);
scrollingWidget->parent()->installEventFilter(editor);
return scrollingWidget;
}
else
{
return ExpressionDelegate::createEditor(parent, option, index);
}
}
示例2: createEditor
//-----------------------------------------------------------------------------
// Function: ParameterDelegate::createEditor()
//-----------------------------------------------------------------------------
QWidget* ParameterDelegate::createEditor(QWidget* parent, QStyleOptionViewItem const& option,
QModelIndex const& index ) const
{
if (index.column() == nameColumn())
{
QWidget* editor = QStyledItemDelegate::createEditor(parent, option, index);
QLineEdit* lineEditor = qobject_cast<QLineEdit*>(editor);
if (lineEditor)
{
lineEditor->setValidator(new NameValidator(lineEditor));
}
return editor;
}
if (index.column() == choiceColumn())
{
return createChoiceSelector(parent);
}
else if (index.column() == formatColumn())
{
return createFormatSelector(parent);
}
else if (index.column() == resolveColumn())
{
return createResolveSelector(parent);
}
else if (index.column() == usageCountColumn())
{
QModelIndex valueIdIndex = index.sibling(index.row(), idColumn());
QString targetId = valueIdIndex.data(Qt::DisplayRole).toString();
emit(openReferenceTree(targetId));
return 0;
}
else if (index.column() == valueColumn() && valueIsArray(index))
{
ArrayView* editor = new ArrayView(parent);
QScrollArea* scrollingWidget = new QScrollArea(parent);
scrollingWidget->setWidgetResizable(true);
scrollingWidget->setWidget(editor);
scrollingWidget->parent()->installEventFilter(editor);
return scrollingWidget;
}
else if (isIndexForValueUsingChoice(index))
{
return createEnumerationSelector(parent, index);
}
else if (index.column() == descriptionColumn())
{
QTextEdit* editor = new QTextEdit(parent);
editor->setMinimumHeight(120);
return editor;
}
else
{
return ChoiceCreatorDelegate::createEditor(parent, option, index);
}
}