本文整理汇总了C++中QQueue::removeAt方法的典型用法代码示例。如果您正苦于以下问题:C++ QQueue::removeAt方法的具体用法?C++ QQueue::removeAt怎么用?C++ QQueue::removeAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQueue
的用法示例。
在下文中一共展示了QQueue::removeAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finish
void SBusController::finish()
{
QStringList keys;
keys = queued_buses->keys();
for( int i=0 ; i<keys.count() ; i++ )
{
const QString & bus = keys.at(i);
if( !queued_buses->contains(bus) )
continue;
QQueue<SBusController*> *queue = queued_buses->value(bus);
if( queue == 0 )
continue;
for( int j=0 ; j<queue->count() ; j++ )
if( queue->at(j) == this )
{
queue->removeAt( j );
j--;
}
if( queued_buses->value(bus)->isEmpty() )
delete queued_buses->take( bus );
}
keys = active_buses->keys();
for( int i=0 ; i<keys.count() ; i++ )
{
const QString & bus = keys.at(i);
if( !active_buses->contains(bus) )
continue;
if( active_buses->value(bus) == this )
finish( bus );
}
}
示例2: setPassUpAndWait
void SBusController::setPassUpAndWait( bool state )
{
if( p->pass_up_and_wait == state )
return;
p->pass_up_and_wait = state;
if( state )
{
/*! ----------------- Find Active Buses ---------------- */
QStringList keys = active_buses->keys();
for( int i=0 ; i<keys.count() ; i++ )
{
const QString & bus = keys.at(i);
if( !active_buses->contains(bus) )
continue;
SBusController *controller = active_buses->value( bus );
if( controller == this )
{
finish( bus );
getAccess( bus );
}
}
}
else
{
/*! ----------------- Find Disabled Buses ---------------- */
QStringList keys = queued_buses->keys();
for( int i=0 ; i<keys.count() ; i++ )
{
const QString & bus = keys.at(i);
if( active_buses->contains(bus) )
continue;
/*! ---------- Find First Deactived Processes to Active --------- */
if( !queued_buses->contains(bus) )
continue;
QQueue<SBusController*> *queue = queued_buses->value(bus);
if( queue == 0 )
continue;
for( int j=0 ; j<queue->count() ; j++ )
{
if( queue->at(j) != this )
continue;
queue->removeAt( j );
if( queue->isEmpty() )
delete queued_buses->take( bus );
active_buses->insert( bus , this );
emit go();
break;
}
}
}
}