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


C++ QObject::name方法代码示例

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


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

示例1: setTopLevelObjects

void QuickInterpreter::setTopLevelObjects( QObjectList *l )
{
    QSEngine::init();
    if( toplevel )
	for( QObject *o = toplevel->first(); o; o = toplevel->next() )
	    disconnect( o, SIGNAL( destroyed( QObject* ) ),
			this, SLOT( topLevelDestroyed( QObject* ) ) );
    delete toplevel;
    toplevel = new QObjectList;

    kids.clear();
    if ( !l ) {
	toplevel->clear();
	return;
    }
    QSObject global( env()->globalObject() );
    QObject *o = l->first();
    while ( o ) {
	if ( hasTopLevelParent( o ) ) {
	    o = l->next();
	    continue;
	}
	kids.append( QString::fromLatin1(o->name()) );
	connect( o, SIGNAL( destroyed( QObject * ) ),
		 this, SLOT( topLevelDestroyed( QObject * ) ) );
	global.put( QString::fromLatin1(o->name()), wrap( o ) );
	staticGlobals << QString::fromLatin1(o->name());
	toplevel->append( o );
	o = l->next();
    }
    delete l;
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:32,代码来源:quickinterpreter.cpp

示例2: calcIndicatorPos

QPoint QDesignerToolBar::calcIndicatorPos( const QPoint &pos )
{
    if ( orientation() == Horizontal ) {
	QPoint pnt( width() - 2, 0 );
	insertAnchor = 0;
	afterAnchor = TRUE;
	if ( !children() )
	    return pnt;
	pnt = QPoint( 13, 0 );
	QObjectListIt it( *children() );
	QObject * obj;
	while( (obj=it.current()) != 0 ) {
	    ++it;
	    if ( obj->isWidgetType() &&
		 qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
		QWidget *w = (QWidget*)obj;
		if ( w->x() < pos.x() ) {
		    pnt.setX( w->x() + w->width() + 1 );
		    insertAnchor = w;
		    afterAnchor = TRUE;
		}
	    }
	}
	return pnt;
    } else {
	QPoint pnt( 0, height() - 2 );
	insertAnchor = 0;
	afterAnchor = TRUE;
	if ( !children() )
	    return pnt;
	pnt = QPoint( 0, 13 );
	QObjectListIt it( *children() );
	QObject * obj;
	while( (obj=it.current()) != 0 ) {
	    ++it;
	    if ( obj->isWidgetType() &&
		 qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
		QWidget *w = (QWidget*)obj;
		if ( w->y() < pos.y() ) {
		    pnt.setY( w->y() + w->height() + 1 );
		    insertAnchor = w;
		    afterAnchor = TRUE;
		}
	    }
	}
	return pnt;
    }
}
开发者ID:app,项目名称:ananas-labs,代码行数:48,代码来源:actiondnd.cpp

示例3: it

static inline void objectChildrenXml(AQSObject *o, QDomNode *doc,
                                     bool includeComplexTypes)
{
    const QObjectList *children = static_cast<QObject *>(o->o())->children();
    if (!children)
        return;
    QObjectListIt it(*children);
    QObject *obj;
    AQSObject *ito;
    QDomNode *itd;

    while ((obj = it.current())) {
        ++it;

        ito = ::qt_cast<AQSObject *>(AQSWrapperFactory::staticCreate(obj->className(), obj));
        if (!ito)
            continue;

        ito->setObjectName(obj->name());
        itd = ito->toXml(includeComplexTypes);
        objectChildrenXml(ito, itd, includeComplexTypes);
        doc->firstChild().appendChild(itd->firstChild());
        delete ito;
    }
}
开发者ID:vamoros,项目名称:eneboo,代码行数:25,代码来源:AQSWrapperFactory.cpp

示例4: printChildren

void Tools::printChildren(QObject* parent)
{
	const QObjectList objs = parent->children();
    QObject * obj;
    for(int i = 0 ; i < objs.size() ; i++) {
        obj = objs.at(i);
        kDebug() << k_funcinfo << obj->className() << ": " << obj->name() << endl;
    }

}
开发者ID:perihelion,项目名称:basket,代码行数:10,代码来源:tools.cpp

示例5: qualifiedName

QString Project::qualifiedName( QObject *o )
{
    QString name = o->name();
    QObject *p = o->parent();
    while ( p ) {
	name.prepend( QString( p->name() ) + "." );
	if ( objs.findRef( p ) != -1 )
	    break;
	p = p->parent();
    }
    return name;
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:12,代码来源:project.cpp

示例6: addTopLevelObject

void QuickInterpreter::addTopLevelObject( QObject *o )
{
    QSEngine::init();
    if ( !toplevel )
	toplevel = new QObjectList;
    if ( toplevel->findRef( o ) != -1 )
	return;
    if ( hasTopLevelParent( o ) )
	return;

    for( QObject *cur = toplevel->first(); cur; cur = toplevel->next() ) {
	if( cur == o ) {
	    return;
	} else if ( cur && o && QString::fromLatin1( cur->name() ) == QString::fromLatin1( o->name() ) ) {
	    return;
	}
    }


    toplevel->append( o );

    kids.clear();
    if ( !toplevel )
	return;
    QObject *obj = toplevel->first();
    while ( obj ) {
	kids.append( QString::fromLatin1(obj->name()) );
	obj = toplevel->next();
    }
    connect( o, SIGNAL( destroyed( QObject * ) ), this, SLOT( topLevelDestroyed( QObject * ) ) );

    QSObject global = env()->globalObject();
    const_cast<QSClass *>(global.objectType())->deleteMember(o->name());
    env()->globalObject().put( QString::fromLatin1(o->name()), wrap( o ) );
    staticGlobals << QString::fromLatin1(o->name());
}
开发者ID:AliYousuf,项目名称:pdfedit-ng-,代码行数:36,代码来源:quickinterpreter.cpp

示例7: pages

QStringList KoDocumentInfo::pages() const
{
    QStringList ret;

    const QObjectList *list = children();
    if ( list )
    {
        QObjectListIt it( *list );
        QObject *obj;
        while ( ( obj = it.current() ) )
        {
            ret.prepend( obj->name() );
            ++it;
        }
    }

    return ret;
}
开发者ID:,项目名称:,代码行数:18,代码来源:


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