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


C++ QMetaMethod::revision方法代码示例

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


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

示例1: metaData

QVariant ObjectMethodModel::metaData(const QModelIndex &index, const QMetaMethod &method,
                                     int role) const
{
    if (role == Qt::DisplayRole && index.column() == 0) {
        return Util::prettyMethodSignature(method);
    } else if (role == ObjectMethodModelRole::MetaMethod) {
        return QVariant::fromValue(method);
    } else if (role == ObjectMethodModelRole::MetaMethodType && index.column() == 1) {
        return QVariant::fromValue(method.methodType());
    } else if (role == ObjectMethodModelRole::MethodAccess && index.column() == 2) {
        return QVariant::fromValue(method.access());
    } else if (role == ObjectMethodModelRole::MethodSignature && index.column() == 0) {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
        return method.signature();
#else
        return method.methodSignature();
#endif
    } else if (role == ObjectMethodModelRole::MethodTag && index.column() == 0 && qstrlen(method.tag())) {
        return method.tag();
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    } else if (role == ObjectMethodModelRole::MethodRevision && index.column() == 0) {
        return method.revision();
#endif
    } else if (role == ObjectMethodModelRole::MethodIssues && index.column() == 0) {
        const QMetaObject *mo = m_metaObject;
        while (mo->methodOffset() > index.row())
            mo = mo->superClass();
        const auto r = QMetaObjectValidator::checkMethod(mo, method);
        return r == QMetaObjectValidatorResult::NoIssue ? QVariant() : QVariant::fromValue(r);
    }
    return QVariant();
}
开发者ID:iamsergio,项目名称:GammaRay,代码行数:32,代码来源:objectmethodmodel.cpp

示例2: while

void QDeclarativePropertyCache::Data::lazyLoad(const QMetaMethod &m)
{
    coreIndex = m.methodIndex();
    relatedIndex = -1;
    flags |= Data::IsFunction;
    if (m.methodType() == QMetaMethod::Signal)
        flags |= Data::IsSignal;
    propType = QVariant::Invalid;

    const char *returnType = m.typeName();
    if (returnType && *returnType) {
        propTypeName = returnType;
        flags |= Data::NotFullyResolved;
    }

    const char *signature = m.signature();
    while (*signature != '(') { Q_ASSERT(*signature != 0); ++signature; }

    ++signature;
    if (*signature != ')') {
        flags |= Data::HasArguments;
        if (0 == ::strcmp(signature, "QDeclarativeV8Function*)")) {
            flags |= Data::IsV8Function;
        }
    }

    revision = m.revision();
}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:28,代码来源:qdeclarativepropertycache.cpp

示例3: metaData

QVariant ObjectMethodModel::metaData(const QModelIndex &index,
                                 const QMetaMethod &method, int role) const
{
  if (role == Qt::DisplayRole) {
    if (index.column() == 0) {
      return Util::prettyMethodSignature(method);
    }
    if (index.column() == 1) {
      switch (method.methodType()) {
      case QMetaMethod::Method:
        return tr("Method");
      case QMetaMethod::Constructor:
        return tr("Constructor");
      case QMetaMethod::Slot:
        return tr("Slot");
      case QMetaMethod::Signal:
        return tr("Signal");
      default:
        return tr("Unknown");
      }
    }
    if (index.column() == 2) {
      switch (method.access()) {
      case QMetaMethod::Public:
        return tr("Public");
      case QMetaMethod::Protected:
        return tr("Protected");
      case QMetaMethod::Private:
        return tr("Private");
      default:
        return tr("Unknown");
      }
    }
    if (index.column() == 3) {
      return method.tag();
    }
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    if (index.column() == 4) {
      return QString::number(method.revision());
    }
#endif
  } else if (role == ObjectMethodModelRole::MetaMethod) {
    return QVariant::fromValue(method);
  } else if (role == ObjectMethodModelRole::MetaMethodType) {
    return QVariant::fromValue(method.methodType());
  } else if (role == ObjectMethodModelRole::MethodSignature) {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    return method.signature();
#else
    return method.methodSignature();
#endif
  }
  return QVariant();
}
开发者ID:dfries,项目名称:GammaRay,代码行数:54,代码来源:objectmethodmodel.cpp

示例4: metaData

QVariant ObjectMethodModel::metaData(const QModelIndex &index,
                                 const QMetaMethod &method, int role) const
{
  if (role == Qt::DisplayRole) {
    if (index.column() == 0) {
      return Util::prettyMethodSignature(method);
    }
    if (index.column() == 1) {
      switch (method.methodType()) {
      case QMetaMethod::Method:
        return tr("Method");
      case QMetaMethod::Constructor:
        return tr("Constructor");
      case QMetaMethod::Slot:
        return tr("Slot");
      case QMetaMethod::Signal:
        return tr("Signal");
      default:
        return tr("Unknown");
      }
    }
    if (index.column() == 2) {
      switch (method.access()) {
      case QMetaMethod::Public:
        return tr("Public");
      case QMetaMethod::Protected:
        return tr("Protected");
      case QMetaMethod::Private:
        return tr("Private");
      default:
        return tr("Unknown");
      }
    }
  } else if (role == Qt::ToolTipRole) {
    QString tt = Util::prettyMethodSignature(method);
    tt += tr("\nTag: %1\n").arg(qstrlen(method.tag()) > 0 ? method.tag() : tr("<none>"));
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    tt += tr("Revision: %1").arg(method.revision());
#endif
    return tt;
  } else if (role == ObjectMethodModelRole::MetaMethod) {
    return QVariant::fromValue(method);
  } else if (role == ObjectMethodModelRole::MetaMethodType) {
    return QVariant::fromValue(method.methodType());
  } else if (role == ObjectMethodModelRole::MethodSignature) {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    return method.signature();
#else
    return method.methodSignature();
#endif
  }
  return QVariant();
}
开发者ID:netrunner-debian-kde-extras,项目名称:gammaray,代码行数:53,代码来源:objectmethodmodel.cpp

示例5:

void QDeclarativePropertyCache::Data::load(const QMetaMethod &m)
{
    coreIndex = m.methodIndex();
    relatedIndex = -1;
    flags |= Data::IsFunction;
    if (m.methodType() == QMetaMethod::Signal)
        flags |= Data::IsSignal;
    propType = m.returnType();

    QList<QByteArray> params = m.parameterTypes();
    if (!params.isEmpty())
        flags |= Data::HasArguments;
    revision = m.revision();
}
开发者ID:mortenelund,项目名称:qt,代码行数:14,代码来源:qdeclarativepropertycache.cpp


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