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


C++ QValueList::isEmpty方法代码示例

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


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

示例1: okClicked

void VariableDialog::okClicked()
{
    QValueList<MetaDataBase::Variable> lst;

    QListViewItemIterator it( varView );
    while ( it.current() != 0 ) {
	MetaDataBase::Variable v;
	v.varName = it.current()->text( 0 ).simplifyWhiteSpace();
	if ( v.varName[ (int)v.varName.length() - 1 ] != ';' )
	    v.varName += ";";
	v.varAccess = it.current()->text( 1 );
	lst << v;
	++it;
    }

    if ( !lst.isEmpty() ) {
	QValueList<MetaDataBase::Variable> invalidLst;
	QValueList<MetaDataBase::Variable>::Iterator it1 = lst.begin();
	QValueList<MetaDataBase::Variable>::Iterator it2;
	for ( ; it1 != lst.end(); ++it1 ) {
	    it2 = it1;
	    ++it2;
	    for ( ; it2 != lst.end(); ++it2 ) {
		if ( MetaDataBase::extractVariableName( (*it1).varName ) ==
		     MetaDataBase::extractVariableName( (*it2).varName ) ) {
		    invalidLst << (*it1);
		    break;
		}
	    }
	}
	if ( !invalidLst.isEmpty() ) {
	    if ( QMessageBox::information( this, tr( "Edit Variables" ),
					   tr( "One variable has been declared twice.\n"
					   "Remove this variable?" ), tr( "&Yes" ), tr( "&No" ) ) == 0 ) {
		for ( it2 = invalidLst.begin(); it2 != invalidLst.end(); ++it2 ) {
		    it = varView->firstChild();
		    while ( it.current() != 0 ) {
			if ( MetaDataBase::extractVariableName( (*it)->text( 0 ).simplifyWhiteSpace() ) ==
			     MetaDataBase::extractVariableName( (*it2).varName ) ) {
			    delete (*it);
			    break;
			}
			++it;
		    }
		}
	    }
	    formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
	    return;
	}
    }
    Command *cmd = new SetVariablesCommand( "Edit variables", formWindow, lst );
    formWindow->commandHistory()->addCommand( cmd );
    cmd->execute();
    accept();
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:55,代码来源:variabledialogimpl.cpp

示例2: dailyType

/******************************************************************************
 * Check if the rule is a daily rule with or without BYDAYS specified.
 */
bool KARecurrence::dailyType(const RecurrenceRule *rrule)
{
    if(rrule->recurrenceType() != RecurrenceRule::rDaily
            ||  !rrule->bySeconds().isEmpty()
            ||  !rrule->byMinutes().isEmpty()
            ||  !rrule->byHours().isEmpty()
            ||  !rrule->byWeekNumbers().isEmpty()
            ||  !rrule->byMonthDays().isEmpty()
            ||  !rrule->byMonths().isEmpty()
            ||  !rrule->bySetPos().isEmpty()
            ||  !rrule->byYearDays().isEmpty())
        return false;
    QValueList<RecurrenceRule::WDayPos> days = rrule->byDays();
    if(days.isEmpty())
        return true;
    // Check that all the positions are zero (i.e. every time)
    bool found = false;
    for(QValueList<RecurrenceRule::WDayPos>::ConstIterator it = days.begin();  it != days.end();  ++it)
    {
        if((*it).pos() != 0)
            return false;
        found = true;
    }
    return found;

}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:29,代码来源:karecurrence.cpp

示例3: moveClustersToArtefact

void ClusterPalette::moveClustersToArtefact() {
    QValueList<int> selected = selectedClusters();
    if(!selected.isEmpty()) {
        emit moveClustersToArtefact(selected);
        isUpToDate = true;
    }
}
开发者ID:caffeine-xx,项目名称:klusters,代码行数:7,代码来源:clusterPalette.cpp

示例4: validDateRange

void MyMoneyReport::validDateRange ( QDate& _db, QDate& _de )
{
  _db = fromDate();
  _de = toDate();

  // if either begin or end date are invalid we have one of the following
  // possible date filters:
  //
  // a) begin date not set - first transaction until given end date
  // b) end date not set   - from given date until last transaction
  // c) both not set       - first transaction until last transaction
  //
  // If there is no transaction in the engine at all, we use the current
  // year as the filter criteria.

  if ( !_db.isValid() || !_de.isValid() ) {
    QValueList<MyMoneyTransaction> list = MyMoneyFile::instance()->transactionList ( *this );
    QDate tmpBegin, tmpEnd;

    if ( !list.isEmpty() ) {
      qHeapSort ( list );
      tmpBegin = list.front().postDate();
      tmpEnd = list.back().postDate();
    } else {
      tmpBegin = QDate ( QDate::currentDate().year(), 1, 1 ); // the first date in the file
      tmpEnd = QDate ( QDate::currentDate().year(), 12, 31 );// the last date in the file
    }
    if ( !_db.isValid() )
      _db = tmpBegin;
    if ( !_de.isValid() )
      _de = tmpEnd;
  }
  if ( _db > _de )
    _db = _de;
}
开发者ID:sajidji94,项目名称:kmymoney2,代码行数:35,代码来源:mymoneyreport.cpp

示例5: setMessageStatus

void MessageActions::setMessageStatus(KMMsgStatus status, bool toggle)
{
    QValueList<Q_UINT32> serNums = mVisibleSernums;
    if(serNums.isEmpty() && mCurrentMessage)
        serNums.append(mCurrentMessage->getMsgSerNum());
    if(serNums.empty())
        return;
    KMCommand *command = new KMSetStatusCommand(status, serNums, toggle);
    command->start();
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:10,代码来源:messageactions.cpp

示例6: qListToIterator

void qListToIterator(DBusMessageIter* it, const QValueList<QDBusData>& list)
{
    if (list.isEmpty()) return;

    QValueList<QDBusData>::ConstIterator listIt    = list.begin();
    QValueList<QDBusData>::ConstIterator listEndIt = list.end();
    for (; listIt != listEndIt; ++listIt)
    {
        qDBusDataToIterator(it, *listIt);
    }
}
开发者ID:opieproject,项目名称:opie,代码行数:11,代码来源:qdbusmarshall.cpp

示例7: args

PluginFactory::PluginFactory( PConfigArgs& args ): args(args), d(new PluginFactoryPrivate)
{
    pluginFactory = this;

    QValueList<int> keys = ancaConf->readIntListEntry( "onStartupMapKeys" );
    QValueList<int> values = ancaConf->readIntListEntry( "onStartupMapValues" );
    if( !keys.isEmpty() && keys.count() == values.count() ) {
        QValueList<int>::iterator it1 = keys.begin();
        QValueList<int>::iterator it2 = values.begin();
        for( ; it1 != keys.end() /* && it2 != values.end() */; ++it1, ++it2 )
            onStartupMap[*it1] = *it2;
    }
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:13,代码来源:pluginfactory.cpp

示例8: d

QDBusDataList::QDBusDataList(const QValueList<Q_UINT64>& other) : d(new Private())
{
    d->type = QDBusData::UInt64;

    if (other.isEmpty()) return;

    QValueList<Q_UINT64>::ConstIterator it    = other.begin();
    QValueList<Q_UINT64>::ConstIterator endIt = other.end();
    for (; it != endIt; ++it)
    {
        d->list << QDBusData::fromUInt64(*it);
    }
}
开发者ID:opieproject,项目名称:opie,代码行数:13,代码来源:qdbusdatalist.cpp

示例9: d

QDBusDataList::QDBusDataList(const QValueList<Q_INT32>& other) : d(new Private())
{
    d->type = QDBusData::Int32;

    if (other.isEmpty()) return;

    QValueList<Q_INT32>::const_iterator it    = other.begin();
    QValueList<Q_INT32>::const_iterator endIt = other.end();
    for (; it != endIt; ++it)
    {
        d->list << QDBusData::fromInt32(*it);
    }
}
开发者ID:IIracotII,项目名称:policykit-kde,代码行数:13,代码来源:qdbusdatalist.cpp

示例10: dnsLookupHelper

void Smtp::dnsLookupHelper()
{
    QValueList<QDns::MailServer> s = mxLookup->mailServers();
    if ( s.isEmpty() ) {
	if ( !mxLookup->isWorking() )
	    emit status( tr( "Error in MX record lookup" ) );
	return;
    }

    emit status( tr( "Connecting to %1" ).arg( s.first().name ) );

    socket->connectToHost( s.first().name, 25 );
    t = new QTextStream( socket );
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:14,代码来源:smtp.cpp

示例11: updateKeyTree

void EditorView::updateKeyTree ( )
{
	QValueList<QString> temp = openedKeys;
	openedKeys.clear ( );
	keyTree->clear ( );
		
	KeySet *roots = ksNew ( );
	if ( kdbGetRootKeys ( roots ) )
	{
		perror ( "opening roots" );
	}
	
	
	ksSort ( roots );
	ksRewind ( roots );
	
	::Key *k = ksNext ( roots );
	
	while ( k )
	{
		addRootItem( k );
		k = ksNext ( roots );
	}
	
	ksDel ( roots );

	if ( temp.isEmpty ( ) )
		return;
	
	QValueList<QString>::iterator it = temp.begin ( );
	
	while ( it != temp.end ( ) )
	{
		QListViewItem * item = getItem ( *it );
		if ( item )
		{
			if ( *it == keyName ( item ) )
			{
				keyTree->setOpen ( item, true );
				//cout << "ok" << endl;
			}
			else
				cout << "fuck " << keyName ( item ) << " != " << *it << endl;
		}
		/*if ( item->isOpen ( ) )
			cout << "not open" << endl;*/
		//openKeyDir ( item );
		++it;
	}
}
开发者ID:BackupTheBerlios,项目名称:tlr-regedit-svn,代码行数:50,代码来源:editorview.cpp

示例12: d

QDBusDataList::QDBusDataList(const QValueList< QDBusObjectPath > &other) : d(new Private())
{
    d->type = QDBusData::ObjectPath;

    if(other.isEmpty())
        return;

    QValueList< QDBusObjectPath >::const_iterator it = other.begin();
    QValueList< QDBusObjectPath >::const_iterator endIt = other.end();
    for(; it != endIt; ++it)
    {
        d->list << QDBusData::fromObjectPath(*it);
    }
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:14,代码来源:qdbusdatalist.cpp

示例13: signalChanged

void ConnectionEditor::signalChanged()
{
    QCString signal = signalBox->currentText().latin1();
    if ( !signal.data() )
	return;
    signal = normalizeSignalSlot( signal.data() );
    slotBox->clear();
    if ( signalBox->currentText().isEmpty() )
	return;
    int n = receiver->metaObject()->numSlots( TRUE );
    for( int i = 0; i < n; ++i ) {
	// accept only public slots. For the form window, also accept protected slots
	QMetaData* md =  receiver->metaObject()->slot( i, TRUE  );
	if ( ( (receiver->metaObject()->slot_access( i, TRUE ) == QMetaData::Public) ||
	       ( formWindow->isMainContainer( (QWidget*)receiver ) &&
		 receiver->metaObject()->slot_access(i, TRUE) == QMetaData::Protected) ) &&
	     !ignoreSlot( md->name ) &&
	     checkConnectArgs( signal.data(), receiver, md->name ) )
	    slotBox->insertItem( md->name );
    }

    if ( formWindow->isMainContainer( (QWidget*)receiver ) ) {
	QValueList<MetaDataBase::Slot> moreSlots = MetaDataBase::slotList( formWindow );
	if ( !moreSlots.isEmpty() ) {
	    for ( QValueList<MetaDataBase::Slot>::Iterator it = moreSlots.begin(); it != moreSlots.end(); ++it ) {
		QCString s = (*it).slot;
		if ( !s.data() )
		    continue;
		s = normalizeSignalSlot( s.data() );
		if ( checkConnectArgs( signal.data(), receiver, s ) )
		    slotBox->insertItem( QString( (*it).slot ) );
	    }
	}	
    }

    if ( receiver->inherits( "CustomWidget" ) ) {
	MetaDataBase::CustomWidget *w = ( (CustomWidget*)receiver )->customWidget();
	for ( QValueList<MetaDataBase::Slot>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
	    QCString s = (*it).slot;
	    if ( !s.data() )
		continue;
	    s = normalizeSignalSlot( s.data() );
 	    if ( checkConnectArgs( signal.data(), receiver, s ) )
		slotBox->insertItem( QString( (*it).slot ) );
	}
    }

    slotsChanged();
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:49,代码来源:connectioneditorimpl.cpp

示例14: performQuery

// emits the given QDomDocument for eventual plugins, checks after that
// if there are any relevance elements. If there are none, random search is
// implied and performed.
// finally, the search is actually started
void MrmlPart::performQuery( QDomDocument& doc )
{
    QDomElement mrml = doc.documentElement();

    emit aboutToStartQuery( doc ); // let plugins play with it :)

    // no items available? All "neutral"? -> random search

    QDomElement queryStep = KMrml::firstChildElement( mrml, "query-step" );
    bool randomSearch = false;

    if ( !queryStep.isNull() )
    {
        QDomElement relevanceList =
            KMrml::firstChildElement(queryStep, "user-relevance-element-list");
        QValueList<QDomElement> relevanceElements =
            KMrml::directChildElements( relevanceList,
                                        "user-relevance-element" );

        randomSearch = relevanceElements.isEmpty();

        if ( randomSearch )
        {
            m_random->setChecked( true );
            m_random->setEnabled( false );
            queryStep.setAttribute("query-type", "at-random");

            // remove user-relevance-element-list element for random search
            relevanceList.parentNode().removeChild( relevanceList );
        }
    }
    else
    {
        KMessageBox::error( m_view, i18n("Error formulating the query. The "
                                         "\"query-step\" element is missing."),
                            i18n("Query Error") );
    }

    m_job = transferJob( url() );
    slotSetStatusBar( randomSearch ? i18n("Random search...") :
                                     i18n("Searching...") );
    m_job->addMetaData( MrmlShared::kio_task(), MrmlShared::kio_startQuery() );
    qDebug("\n\nSending XML:\n%s", doc.toString().latin1());
    m_job->addMetaData( MrmlShared::mrml_data(), doc.toString() );
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:49,代码来源:mrml_part.cpp

示例15: if

QDBusDataList::QDBusDataList(const QValueList< QDBusData > &other) : d(new Private())
{
    if(other.isEmpty())
        return;

    QValueList< QDBusData >::const_iterator it = other.begin();
    QValueList< QDBusData >::const_iterator endIt = other.end();

    d->type = (*it).type();

    QCString elementSignature;
    if(hasContainerItemType())
    {
        d->containerItem = other[0]; // would be nice to get an empty one
        elementSignature = d->containerItem.buildDBusSignature();
    }

    for(++it; it != endIt; ++it)
    {
        if(d->type != (*it).type())
        {
            d->type = QDBusData::Invalid;
            d->containerItem = QDBusData();

            return;
        }
        else if(hasContainerItemType())
        {
            if((*it).buildDBusSignature() != elementSignature)
            {
                d->type = QDBusData::Invalid;
                d->containerItem = QDBusData();

                return;
            }
        }
    }

    d->list = other;
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:40,代码来源:qdbusdatalist.cpp


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