本文整理汇总了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);
}
示例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 );
}
}
示例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);
}
示例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);
}
示例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());
}