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


C++ QTreeWidgetItem::isDisabled方法代码示例

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


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

示例1: isDisabled

bool QTreeWidgetItemProto::isDisabled()	        const
{
  QTreeWidgetItem *item = qscriptvalue_cast<QTreeWidgetItem*>(thisObject());
  if (item)
    return item->isDisabled();
  return false;
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例2:

dmz::V8Value
dmz::JsModuleUiV8QtBasic::_tree_item_disable (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QTreeWidgetItem *item = self->_to_qtreewidgetitem (Args.This ());
      if (item) {

         if (Args.Length ()) { item->setDisabled (v8_to_boolean (Args[0])); }
         result = v8::Boolean::New (item->isDisabled ());
      }
   }

   return scope.Close (result);
}
开发者ID:bstewart33,项目名称:js,代码行数:19,代码来源:dmzJsModuleUiV8QtBasicTreeWidget.cpp

示例3: _syncXCCDFItemChildrenDisabledState

/**
 * This only handles changes in selection of just one tree item!
 */
void _syncXCCDFItemChildrenDisabledState(QTreeWidgetItem* treeItem, bool enabled)
{
    for (int i = 0; i < treeItem->childCount(); ++i)
    {
        QTreeWidgetItem* childTreeItem = treeItem->child(i);
        const bool childEnabled = !childTreeItem->isDisabled();

        if (!enabled && childEnabled)
        {
            childTreeItem->setDisabled(true);
            _syncXCCDFItemChildrenDisabledState(childTreeItem, false);
        }
        else if (enabled && !childEnabled)
        {
            childTreeItem->setDisabled(false);
            _syncXCCDFItemChildrenDisabledState(childTreeItem, true);
        }
    }
}
开发者ID:Nanonid,项目名称:scap-workbench,代码行数:22,代码来源:TailoringWindow.cpp

示例4: it

QSet<QTreeWidgetItem*> TreeWidgetSearch(QTreeWidget *treeWidget, int column, const QStringList &filters,
    bool exactMatch, Qt::CaseSensitivity sensitivity, bool expandItems)
{
    QSet<QTreeWidgetItem *> handled;
    QSet<QTreeWidgetItem *> matched;
    
    foreach(QString filter, filters)
    {
        filter = filter.trimmed();

        // Negation search?
        const bool negation = (!filter.isEmpty() && filter[0] == '!');
        if (negation)
            filter = filter.mid(1);

        QTreeWidgetItemIterator it(treeWidget);
        while(*it)
        {
            QTreeWidgetItem *item = *it;

            // This item has been already handled with a previous filter
            // but we need to check its children matching this filter.
            if (handled.contains(item))
            {
                if (!filter.isEmpty())
                    TreeWidgetSearchHelper(item, handled, matched, negation, column, filter, exactMatch, sensitivity, expandItems);
                continue;
            }

            if (filter.isEmpty())
            {
                if (!item->isDisabled())
                    item->setHidden(false); // No filter, show everything.
            }
            else if ((!exactMatch && item->text(column).contains(filter, sensitivity)) ||
                (exactMatch && item->text(column).compare(filter, sensitivity) == 0))
            {
                // Hit with filter to column text
                if (!item->isDisabled())
                    item->setHidden(negation);
                handled << item;
                matched << item;

                if (expandItems && !item->isHidden())
                    item->setExpanded(true);

                // Make sure that all the parent items are visible too
                QTreeWidgetItem *parent = 0, *child = item;
                while((parent = child->parent()) != 0)
                {
                    if (!item->isDisabled())
                        parent->setHidden(negation);
                    handled << parent;
                    if (expandItems && !parent->isHidden())
                        parent->setExpanded(true);
                    child = parent;
                }
            }
            else // No hit
            {
                if (!item->isDisabled())
                    item->setHidden(!negation);
            }

            ++it;
        }
    }
开发者ID:360degrees-fi,项目名称:tundra,代码行数:67,代码来源:TreeWidgetUtils.cpp


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