本文整理汇总了C++中QCString::detach方法的典型用法代码示例。如果您正苦于以下问题:C++ QCString::detach方法的具体用法?C++ QCString::detach怎么用?C++ QCString::detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCString
的用法示例。
在下文中一共展示了QCString::detach方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSlotBinding
void JSObjectProxy::addSlotBinding( const QCString &name, KJS::ExecState *exec, KJS::Object &object ) {
// Lookup and bind slot
QMetaObject * mo = obj->metaObject();
int slotid = mo->findSlot( name.data(), true );
if ( slotid == -1 )
return ;
const QMetaData *md = mo->slot( slotid, true );
if ( md->access != QMetaData::Public )
return ;
// Find signature
int id = Bindings::JSSlotUtils::findSignature( name );
// kdDebug( 80001 )<<"JSObjectProxy::addSlotBinding()::slot:"<<name<<" id:"<<id<<endl;
if ( id < 0 )
return ;
QCString jsname = name;
jsname.detach();
jsname.replace( QRegExp( "\\([^\\)]*\\)" ), "" );
// Find the return type, we only care if it is a pointer type
const QUMethod *m = md->method;
const char *retclass = 0;
QCString ptr( "ptr" );
if ( m->count && ( m->parameters->inOut == QUParameter::Out )
&& ( ptr == m->parameters->type->desc() ) ) {
retclass = ( const char * ) m->parameters->typeExtra;
// kdDebug(80001) << "Return type is a pointer, type " << retclass << endl;
}
// Create the Imp
JSObjectProxyImp *imp = new JSObjectProxyImp( exec, JSObjectProxyImp::MethodSlot,
retclass ? retclass : "", id, name, this );
if ( !object.hasProperty( exec, KJS::Identifier( jsname ) ) ) {
// The identifier is unused
object.put( exec, KJS::Identifier( jsname.data() ), KJS::Object( imp ) );
} else {
// The identifier has already been used
QString s( name );
QCString cs = QString( "%1%2" ).arg( jsname ).arg( s.contains( ',' ) + 1 ).ascii();
//kdDebug(80001) << "Method " << jsname << " exists, using " << cs << " for " << s << endl;
object.put( exec, KJS::Identifier( cs.data() ), KJS::Object( imp ) );
}
}