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


C++ PropertyItem::isReadOnly方法代码示例

本文整理汇总了C++中PropertyItem::isReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyItem::isReadOnly方法的具体用法?C++ PropertyItem::isReadOnly怎么用?C++ PropertyItem::isReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyItem的用法示例。


在下文中一共展示了PropertyItem::isReadOnly方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: flags

Qt::ItemFlags PropertyModel::flags(const QModelIndex & index) const
{
    if (!index.isValid())
        return 0;
    
    PropertyItem * item = retrieveItem(index);

    Qt::ItemFlags flags = Qt::ItemIsSelectable;

    if (index.column() == 1 && item->property()->isValue() && !item->isReadOnly())
        flags |= Qt::ItemIsEditable;

    if (item->isEnabled())
        flags |= Qt::ItemIsEnabled;
    
    return flags;
}
开发者ID:dgimb89,项目名称:libzeug,代码行数:17,代码来源:PropertyModel.cpp

示例2: if

QWidget * PropertyItemDelegate::createEditor (QWidget * parent, const QStyleOptionViewItem & /*option*/, 
                                              const QModelIndex & index ) const
{
    if (!index.isValid())
        return 0;

    PropertyItem *childItem = static_cast<PropertyItem*>(index.internalPointer());
    if (!childItem)
        return 0;
    QWidget* editor = childItem->createEditor(parent, this, SLOT(valueChanged()));
    if (editor) // Make sure the editor background is painted so the cell content doesn't show through
        editor->setAutoFillBackground(true);
    if (editor && childItem->isReadOnly())
        editor->setDisabled(true);
    else if (editor && this->pressed)
        editor->setFocus();
    this->pressed = false;
    return editor;
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:19,代码来源:PropertyItemDelegate.cpp

示例3: if

QWidget * PropertyItemDelegate::createEditor (QWidget * parent, const QStyleOptionViewItem & /*option*/, 
                                              const QModelIndex & index ) const
{
    if (!index.isValid())
        return 0;

    PropertyItem *childItem = static_cast<PropertyItem*>(index.internalPointer());
    if (!childItem)
        return 0;
    QWidget* editor = childItem->createEditor(parent, this, SLOT(valueChanged()));
    if (editor) // Make sure the editor background is painted so the cell content doesn't show through
        editor->setAutoFillBackground(true);
    if (editor && childItem->isReadOnly())
        editor->setDisabled(true);
    else if (editor /*&& this->pressed*/) {
        // We changed the way editor is activated in PropertyEditor (in response
        // of signal activated and clicked), so now we should grab focus
        // regardless of "pressed" or not (e.g. when activated by keyboard
        // enter)
        editor->setFocus();
    }
    this->pressed = false;
    return editor;
}
开发者ID:DevJohan,项目名称:FreeCAD_sf_master,代码行数:24,代码来源:PropertyItemDelegate.cpp


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