本文整理汇总了C++中Property::GetID方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::GetID方法的具体用法?C++ Property::GetID怎么用?C++ Property::GetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::GetID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
void QPropertyDelegate::paint(QPainter* pPainter, const QStyleOptionViewItem& pOption, const QModelIndex& pIndex) const
{
Q_ASSERT(pIndex.isValid());
// We don't need any specialized display for the "Property" column
if( pIndex.column() == QPropertyModel::PROPERTY_COLUMN )
{
QItemDelegate::paint(pPainter, pOption, pIndex);
return;
}
const QPropertyModel* model = reinterpret_cast<const QPropertyModel*>(pIndex.model());
Property* baseProp = QPropertyModel::GetProperty(pIndex);
QPropertyHelper* propHelper = QPropertyHelpersManager::GetHelper(baseProp->GetID());
/*
if( !QPropertyModel::IsComponent(pIndex) )
printf("Painting %s\n", baseProp->GetName());
else
printf("Painting %s.%s\n", baseProp->GetName(), baseProp->GetComponentName(QPropertyModel::GetComponentIndex(pIndex)));
*/
if( propHelper && model )
{
if( propHelper->Paint(pPainter, pOption, model->GetEdited(), baseProp, QPropertyModel::GetComponentIndex(pIndex)) )
return;
}
QItemDelegate::paint(pPainter, pOption, pIndex);
}
示例2: setEditorData
void QPropertyDelegate::setEditorData(QWidget* pEditor, const QModelIndex& pIndex) const
{
GD_ASSERT(pEditor == mActiveEditor);
const QPropertyModel* model = reinterpret_cast<const QPropertyModel*>(pIndex.model());
Property* baseProp = QPropertyModel::GetProperty(pIndex);
QPropertyHelper* propHelper = QPropertyHelpersManager::GetHelper(baseProp->GetID());
if( propHelper && model )
propHelper->SetEditorData(pEditor, model->GetEdited(), baseProp, QPropertyModel::GetComponentIndex(pIndex));
}
示例3: createEditor
QWidget* QPropertyDelegate::createEditor(QWidget* pParent, const QStyleOptionViewItem& pOption, const QModelIndex& pIndex) const
{
Property* baseProp = QPropertyModel::GetProperty(pIndex);
QPropertyDelegate* self = const_cast<QPropertyDelegate*>(this);
QPropertyHelper* propHelper = QPropertyHelpersManager::GetHelper(baseProp->GetID());
if( propHelper )
self->mActiveEditor = propHelper->CreateEditor(self, pParent, pOption, baseProp, QPropertyModel::GetComponentIndex(pIndex));
if( self->mActiveEditor )
self->mActiveEditor->installEventFilter(self);
return self->mActiveEditor;
}
示例4: setModelData
void QPropertyDelegate::setModelData(QWidget* pEditor, QAbstractItemModel* pModel, const QModelIndex& pIndex) const
{
GD_ASSERT(pEditor == mActiveEditor);
if( !pIndex.isValid() )
return;
QPropertyModel* model = reinterpret_cast<QPropertyModel*>(pModel);
Property* baseProp = QPropertyModel::GetProperty(pIndex);
QPropertyHelper* propHelper = QPropertyHelpersManager::GetHelper(baseProp->GetID());
if( propHelper && model )
propHelper->SetModelData(pEditor, model->GetEdited(), baseProp, QPropertyModel::GetComponentIndex(pIndex));
model->setData(pIndex, QVariant(), Qt::DisplayRole);
}