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


C++ Identifier::qstring方法代码示例

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


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

示例1: get

Value MimeTypes::get(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
    kdDebug(6070) << "MimeTypes::get " << propertyName.qstring() << endl;
#endif
    if(!pluginsEnabled())
    {
        if(propertyName == lengthPropertyName)
            return Number(0);
    }
    else
    {
        if(propertyName == lengthPropertyName)
            return Number(mimes->count());

        // mimeTypes[#]
        bool ok;
        unsigned int i = propertyName.toULong(&ok);
        if(ok && i < mimes->count())
            return Value(new MimeType(exec, mimes->at(i)));

        // mimeTypes[name]
        Value val = mimeTypeByName(exec, propertyName.qstring());
        if(!val.isA(UndefinedType))
            return val;
    }

    return lookupGet< MimeTypesFunc, MimeTypes, ObjectImp >(exec, propertyName, &MimeTypesTable, this);
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: tryPut

void DOMCSSStyleDeclaration::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr )
{
#ifdef KJS_VERBOSE
  kdDebug(6070) << "DOMCSSStyleDeclaration::tryPut " << propertyName.qstring() << endl;
#endif
  if (propertyName == "cssText") {
    styleDecl.setCssText(value.toString(exec).string());
  }
  else {
    bool pxSuffix;
    QString prop = cssPropertyName(propertyName, pxSuffix);
    QString propvalue = value.toString(exec).qstring();

    if (pxSuffix)
      propvalue += "px";
#ifdef KJS_VERBOSE
    kdDebug(6070) << "DOMCSSStyleDeclaration: prop=" << prop << " propvalue=" << propvalue << endl;
#endif
    // Look whether the property is known.d In that case add it as a CSS property.
    if (DOM::getPropertyID(prop.latin1(), prop.length())) {
      if (propvalue.isEmpty())
        styleDecl.removeProperty(prop);
      else {
        int important = propvalue.find("!important", 0, false);
        if (important == -1)
            styleDecl.setProperty(prop, DOM::DOMString(propvalue), "");
        else
            styleDecl.setProperty(prop, DOM::DOMString(propvalue.left(important - 1)), "important");
      }
    }
    else
      // otherwise add it as a JS property
      DOMObject::tryPut( exec, propertyName, value, attr );
  }
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例3: getOwnPropertySlot

bool KeyboardEventConstructor::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
#ifdef KJS_VERBOSE
  kDebug(6070) << "DOMKeyboardEvent::getOwnPropertySlot " << propertyName.qstring();
#endif
  return getStaticValueSlot<KeyboardEventConstructor, DOMObject>(exec,&KeyboardEventConstructorTable,this,propertyName,slot);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例4: tryGet

Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
    kdDebug(6070) << "DOMCSSStyleDeclaration::tryGet " << propertyName.qstring() << endl;
#endif
    const HashEntry *entry = Lookup::findEntry(&DOMCSSStyleDeclarationTable, propertyName);
    if(entry)
        switch(entry->value)
        {
            case CssText:
                return String(styleDecl.cssText());
            case Length:
                return Number(styleDecl.length());
            case ParentRule:
                return getDOMCSSRule(exec, styleDecl.parentRule());
            default:
                break;
        }

    // Look in the prototype (for functions) before assuming it's a name
    Object proto = Object::dynamicCast(prototype());
    if(proto.isValid() && proto.hasProperty(exec, propertyName))
        return proto.get(exec, propertyName);

    bool ok;
    long unsigned int u = propertyName.toULong(&ok);
    if(ok)
        return String(DOM::CSSStyleDeclaration(styleDecl).item(u));

    // pixelTop returns "CSS Top" as number value in unit pixels
    // posTop returns "CSS top" as number value in unit pixels _if_ its a
    // positioned element. if it is not a positioned element, return 0
    // from MSIE documentation ### IMPLEMENT THAT (Dirk)
    bool asNumber;
    QString p = cssPropertyName(propertyName, asNumber);

#ifdef KJS_VERBOSE
    kdDebug(6070) << "DOMCSSStyleDeclaration: converting to css property name: " << p << (asNumber ? "px" : "") << endl;
#endif

    if(asNumber)
    {
        DOM::CSSValue v = styleDecl.getPropertyCSSValue(p);
        if(!v.isNull() && v.cssValueType() == DOM::CSSValue::CSS_PRIMITIVE_VALUE)
            return Number(static_cast< DOM::CSSPrimitiveValue >(v).getFloatValue(DOM::CSSPrimitiveValue::CSS_PX));
    }

    DOM::DOMString str = const_cast< DOM::CSSStyleDeclaration & >(styleDecl).getPropertyValue(p);
    if(!str.isNull())
        return String(str);

    // see if we know this css property, return empty then
    if(DOM::getPropertyID(p.latin1(), p.length()))
        return String(DOM::DOMString(""));

    return DOMObject::tryGet(exec, propertyName);
}
开发者ID:,项目名称:,代码行数:57,代码来源:

示例5: put

KDE_NO_EXPORT
void EmbedLiveConnect::put(ExecState *exec, const Identifier &prop, const Value &value, int)
{
    if(m_liveconnect)
        m_liveconnect->put(objid, prop.qstring(), value.toString(exec).qstring());
}
开发者ID:,项目名称:,代码行数:6,代码来源:


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