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