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


C++ QSObject::shVal方法代码示例

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


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

示例1: refScope

ScopeChain QSFuncRefClass::refScope( const QSObject &ref )
{
    if( ref.isFunction() ) {
	return ( (QSReferenceData*) ref.shVal() )->context;
    }
    qWarning( "QSFuncRefClass::refScope() - not a reference" );
    return ScopeChain();
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:8,代码来源:qsfuncref.cpp

示例2: refBase

QSObject QSFuncRefClass::refBase( const QSObject &ref )
{
    if( ref.isFunction() ) {
	return ( (QSReferenceData*) ref.shVal() )->base;
    }
    qWarning( "QSFuncRefClass::refBase() - not a reference" );
    return ref.env()->createUndefined();
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:8,代码来源:qsfuncref.cpp

示例3: refMember

QSMember QSFuncRefClass::refMember( const QSObject &ref )
{
    if( ref.isFunction() ) {
	return ( (QSReferenceData*) ref.shVal() )->member;
    }
    qWarning( "QSFuncRefClass::refMember() - not a reference" );
    return QSMember();
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:8,代码来源:qsfuncref.cpp

示例4: convertToArgument

QSArgument QuickInterpreter::convertToArgument( const QSObject &o )
{
    if( !o.isValid() )
	return QSArgument();
    const QSClass *cl = o.objectType();
    if( cl->name() == QString::fromLatin1("QObject") ) {
	QSWrapperShared *shared = (QSWrapperShared*) o.shVal();
	if (shared->objects.isEmpty())
            return QSArgument();
	return QSArgument( shared->objects[0] );
    } else if( cl == ptrClass ) {
	Q_ASSERT( ptrClass->pointer( &o ) );
	return QSArgument( ptrClass->pointer( &o ) );
    } else {
	return QSArgument( o.toVariant( QVariant::Invalid ) );
    }
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:17,代码来源:quickinterpreter.cpp

示例5: convertToArgument

QVariant QuickInterpreter::convertToArgument(const QSObject &o)
{
    if(!o.isValid())
	return QVariant();
    const QSClass *cl = o.objectType();
    if(cl->name() == QString::fromLatin1("QObject")) {
	QSWrapperShared *shared = (QSWrapperShared*) o.shVal();
	if (shared->objects.isEmpty())
            return QVariant();
        QVariant v(QMetaType::QObjectStar, static_cast<QObject *>(0));
        qVariantSetValue<QObject *>(v, shared->objects[0]);
        return v;
    } else if(cl == ptrClass) {
	Q_ASSERT(ptrClass->pointer(&o));
        QVariant v(QMetaType::VoidStar, static_cast<void *>(0));
        qVariantSetValue<void *>(v, ptrClass->pointer(&o));
        return v;
    } else {
	return QVariant(o.toVariant(QVariant::Invalid));
    }
}
开发者ID:aschet,项目名称:qsaqt5,代码行数:21,代码来源:quickinterpreter.cpp

示例6: doObjectCompletion

void QSAEditor::doObjectCompletion()
{
    QTextCursor cursor = textCursor();
    cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor);
    QString objectName = cursor.selectedText();
    if (objectName.endsWith(QLatin1Char('-')))
        objectName.chop(1);

    objectName = objectName.simplified();

    QString object = resolveFullyQualifiedValue(objectName, parseAssignments(functionCode()));

    bool assumedStatic = false;
    QSCompletionObject o;
    if(objectName == object) {
        QSObject stobj = env()->globalObject().get(object);
        if(stobj.isValid() && stobj.objectType()->valueType() == TypeClass) {
#if defined ( QSA_COMPLETION_DEBUG )
            printf(" -> assuming static\n");
#endif
            o = stobj;
            assumedStatic = true;
        }
    }
    if(o.type == QSCompletionObject::TNull) {
        o = queryObject(object);
    }

#if defined ( QSA_COMPLETION_DEBUG )
    printf(" -> type is: %d\n", o.type);
#endif

    o.resolve();
    if (o.isNull())
        return;

    QVector<CompletionEntry> res;

    QSObject nullObject;
    switch (o.type) {
    case QSCompletionObject::TQSObject:
#if defined ( QSA_COMPLETION_DEBUG )
        printf(" -> objectType is: %s\n", o.qsobj.objectType()->name().latin1());
#endif
        if(o.qsobj.objectType()->name() == QString::fromLatin1("FactoryObject")){
            QSObject sinst = ( (QSFactoryObjectProxy*) o.qsobj.objectType() )->staticInstance();
            if(!sinst.isValid())
                return;
            QSWrapperShared *shared = (QSWrapperShared*) sinst.shVal();
            completeQObject( shared->objects, object, res );
            break;
        }
        completeQSObject(o.qsobj, res, !assumedStatic);
        break;
    case QSCompletionObject::TQMetaObject:
        completeQMetaObject(o.meta, object, res, IncludeSuperClass, nullObject);
        break;
    case QSCompletionObject::TQObject:
        completeQObject(o.qobj, object, res);
        break;
    case QSCompletionObject::TNull:
        break;
    }

    if (!res.isEmpty()) {
        QFrame *f = new QFrame(0, Qt::Popup);
        f->setAttribute(Qt::WA_DeleteOnClose);

        QWidget *box = new CompletionBox(this, res);

        QVBoxLayout *layout = new QVBoxLayout;
        layout->addWidget(box);
        layout->setMargin(0);
        f->setLayout(layout);

        f->move(mapToGlobal(cursorRect().bottomLeft()));
        f->show();
        box->setFocus();
    }
}
开发者ID:aschet,项目名称:qsaqt5,代码行数:80,代码来源:qsaeditor.cpp

示例7: regExp

QRegExp* QSRegExpClass::regExp( QSEnv *e )
{
    QSObject t = e->thisValue();
    Q_ASSERT( t.isA( e->regexpClass() ) );
    return &((QSRegExpShared*)t.shVal())->reg;
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:6,代码来源:qsregexp_object.cpp


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