当前位置: 首页>>代码示例>>C++>>正文


C++ Property::GetID方法代码示例

本文整理汇总了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);
}
开发者ID:SebastienLussier,项目名称:Gamedesk,代码行数:30,代码来源:PropertyList.cpp

示例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));
}
开发者ID:SebastienLussier,项目名称:Gamedesk,代码行数:11,代码来源:PropertyList.cpp

示例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;
}
开发者ID:SebastienLussier,项目名称:Gamedesk,代码行数:14,代码来源:PropertyList.cpp

示例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);
}
开发者ID:SebastienLussier,项目名称:Gamedesk,代码行数:16,代码来源:PropertyList.cpp


注:本文中的Property::GetID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。