本文整理汇总了C++中QValueList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ QValueList::append方法的具体用法?C++ QValueList::append怎么用?C++ QValueList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QValueList
的用法示例。
在下文中一共展示了QValueList::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
const QValueList<KAboutTranslator>
KAboutData::translators() const
{
QValueList<KAboutTranslator> personList;
if (d->translatorName == 0)
return personList;
QStringList nameList;
QStringList emailList;
QString names = i18n(d->translatorName);
if (names != QString::fromUtf8(d->translatorName)) {
nameList = QStringList::split(',',names);
}
if (d->translatorEmail) {
QString emails = i18n(d->translatorEmail);
if (emails != QString::fromUtf8(d->translatorEmail)) {
emailList = QStringList::split(',',emails,true);
}
}
QStringList::Iterator nit;
QStringList::Iterator eit=emailList.begin();
for (nit = nameList.begin(); nit != nameList.end(); ++nit) {
QString email;
if (eit != emailList.end()) {
email=*eit;
++eit;
}
QString name=*nit;
personList.append(KAboutTranslator(name.stripWhiteSpace(), email.stripWhiteSpace()));
}
return personList;
}
示例2: slotInsertRow
void TableEditor::slotInsertRow()
{
int num = m_dataTable->numRows();
if (m_row >= 0)
num = m_row;
m_dataTable->insertRows(num);
m_dataTable->setRowHeight(num, 50);
if (m_createNodes) {
TableNode tableNode;
tableNode.merged = false;
tableNode.node = new Node(0L);
newNum++;
tableNode.node->tag = new Tag();
tableNode.node->tag->setDtd(m_dtd);
tableNode.node->tag->parse("<tr>", m_write);
QValueList<TableNode>::Iterator rowIt = m_tableRows->at(num);
if (rowIt != m_tableRows->end())
m_tableRows->insert(rowIt, tableNode);
else
m_tableRows->append(tableNode);
QValueList<TableNode> tableRowTags;
for (int i = 0; i < m_dataTable->numCols(); i++) {
tableNode.merged = false;
tableNode.node = new Node(0L);
newNum++;
tableNode.node->tag = new Tag();
tableNode.node->tag->setDtd(m_dtd);
if (m_tableTags == m_tableHeaderTags) {
tableNode.node->tag->parse("<th>", m_write);
} else {
tableNode.node->tag->parse("<td>", m_write);
}
tableRowTags.append(tableNode);
setCellText(m_dataTable, num, i, "");
}
QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->at(num);
if (it != m_tableTags->end())
m_tableTags->insert(it, tableRowTags);
else
m_tableTags->append(tableRowTags);
}
m_rowSpin->setValue(m_dataTable->numRows());
}
示例3: while
QValueList<DebuggerBreakpoint*> BreakpointListView::breakpointsFrom(const KURL& url)
{
QValueList<DebuggerBreakpoint*> list;
BreakpointListViewItem* item =
dynamic_cast<BreakpointListViewItem*>(firstChild());
while(item)
{
if(item->breakpoint()->url() == url)
{
list.append(item->breakpoint());
}
item =
dynamic_cast<BreakpointListViewItem*>(item-> nextSibling());
}
return list;
}
示例4: xmlCharStrdup
QValueList<int> KlustersXmlReader::getNbChannelsByGroup(int electrodeGroupID)const{
QValueList<int> channels;
xmlXPathObjectPtr result;
xmlChar* searchPath = xmlCharStrdup("//" + SPIKE + "/" + CHANNEL_GROUPS + "/" + GROUP);
//Evaluate xpath expression
result = xmlXPathEvalExpression(searchPath,xpathContex);
if(result != NULL){
xmlNodeSetPtr nodeset = result->nodesetval;
if(!xmlXPathNodeSetIsEmpty(nodeset)){
//loop on all the GROUP until reaching the electrodeGroupID one.
int nbGroups = nodeset->nodeNr;
for(int i = 0; i < nbGroups; ++i){
if((i + 1) != electrodeGroupID) continue;
xmlNodePtr child;
for(child = nodeset->nodeTab[i]->children;child != NULL;child = child->next){
//skip the carriage return (text node named text and containing /n)
if(child->type == XML_TEXT_NODE) continue;
if(QString((char*)child->name) == CHANNELS){
//Should be only one CHANNELS element
xmlNodePtr channel;
for(channel = child->children;channel != NULL;channel = channel->next){
//skip the carriage return (text node named text and containing /n)
if(channel->type == XML_TEXT_NODE) continue;
if(QString((char*)channel->name) == CHANNEL){
xmlChar* sId = xmlNodeListGetString(doc,channel->children, 1);
int channelId = QString((char*)sId).toInt();
xmlFree(sId);
channels.append(channelId);
}
}
}
}
if((i + 1) == electrodeGroupID) break;
}
}
}
xmlFree(searchPath);
xmlXPathFreeObject(result);
return channels;
}
示例5: initializeFavorites
void FavoriteFolderView::initializeFavorites()
{
QValueList<int> seenInboxes = GlobalSettings::self()->favoriteFolderViewSeenInboxes();
KMFolderTree *ft = mainWidget()->folderTree();
assert(ft);
for(QListViewItemIterator it(ft); it.current(); ++it)
{
KMFolderTreeItem *fti = static_cast<KMFolderTreeItem *>(it.current());
if(fti->type() == KFolderTreeItem::Inbox && fti->folder() && !seenInboxes.contains(fti->folder()->id()))
{
seenInboxes.append(fti->folder()->id());
if(fti->folder() == kmkernel->inboxFolder() && hideLocalInbox())
continue;
if(kmkernel->iCalIface().hideResourceFolder(fti->folder()))
continue;
addFolder(fti->folder(), prettyName(fti));
}
}
GlobalSettings::self()->setFavoriteFolderViewSeenInboxes(seenInboxes);
}
示例6:
QValueList<int> ClusterPalette::selectedClusters() {
//Get the list of clusters with their color
ItemColors& clusterColors = doc->clusterColors();
QValueList<int> selectedClusters;
ClusterPaletteIconViewItem* clusterPaletteItem;
for(QIconViewItem* item = iconView->firstItem(); item; item = item->nextItem()) {
clusterPaletteItem = static_cast<ClusterPaletteIconViewItem*>(item);
if(item->isSelected()) {
selectedClusters.append(clusterColors.itemId(item->index()));
}
}
//Selection has just changed
isUpToDate = false;
return selectedClusters;
}
示例7: forecastBalance
QValueList<QDate> MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAccount& acc)
{
QValueList<QDate> minBalanceList;
int daysToBeginDay;
daysToBeginDay = QDate::currentDate().daysTo(beginForecastDate());
for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) {
MyMoneyMoney minBalance = forecastBalance(acc, (t_cycle * accountsCycle() + daysToBeginDay));
QDate minDate = QDate::currentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay);
for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) {
if( minBalance > forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) {
minBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day );
minDate = QDate::currentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day);
}
}
minBalanceList.append(minDate);
}
return minBalanceList;
}
示例8: QWidget
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// DccCanvasWidget
//
DccCanvasWidget::DccCanvasWidget(QWidget * par)
: QWidget(par,"canvas_widget")
{
m_pCanvas = new QCanvas(this);
//#warning "Make this size as parameter of Dcc ?"
m_pCanvas->resize(648,480);
m_pMenuBar = new QMenuBar(this);
m_pSplitter = new QSplitter(QSplitter::Horizontal,this);
m_pCanvasView = new KviCanvasView(m_pCanvas,this,m_pSplitter);
m_pStatusLabel = new QLabel(this);
m_pPropertiesWidget = new KviCanvasItemPropertiesWidget(m_pSplitter);
QValueList<int> l;
l.append(80);
l.append(20);
m_pSplitter->setSizes(l);
connect(m_pPropertiesWidget,SIGNAL(propertyChanged(const QString &,const QVariant &)),m_pCanvasView,SLOT(propertyChanged(const QString &,const QVariant &)));
QMenu * add = new QMenu(m_pMenuBar);
QMenu * shapes = new QMenu(add);
QMenu * polygons = new QMenu(add);
QMenu * items = new QMenu(add);
shapes->addAction(__tr2qs_ctx("&Line","dcc"),m_pCanvasView,SLOT(insertLine()));
shapes->addAction(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,SLOT(insertRectangle()));
shapes->addAction(__tr2qs_ctx("&Ellipse","dcc"),m_pCanvasView,SLOT(insertEllipse()));
shapes->addAction(__tr2qs_ctx("&Pie","dcc"),m_pCanvasView,SLOT(insertPie()));
shapes->addAction(__tr2qs_ctx("&Chord","dcc"),m_pCanvasView,SLOT(insertChord()));
items->addAction(__tr2qs_ctx("&Rich text (html)","dcc"),m_pCanvasView,SLOT(insertRichText()));
polygons->addAction(__tr2qs_ctx("&Triangle","dcc"),m_pCanvasView,SLOT(insertPolygonTriangle()));
polygons->addAction(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,SLOT(insertPolygonRectangle()));
polygons->addAction(__tr2qs_ctx("&Pentagon","dcc"),m_pCanvasView,SLOT(insertPolygonPentagon()));
polygons->addAction(__tr2qs_ctx("&Hexagon","dcc"),m_pCanvasView,SLOT(insertPolygonHexagon()));
add->addAction(__tr2qs_ctx("&Shape","dcc"),shapes);
add->addAction(__tr2qs_ctx("&Item","dcc"),items);
add->addAction(__tr2qs_ctx("&Polygons","dcc"),polygons);
m_pMenuBar->addAction(__tr2qs_ctx("&Insert","dcc"),add);
}
示例9: kdDebug
QValueList<KTextEditor::CompletionEntry> BashCodeCompletion::getVars(const QString &startText)
{
kdDebug() << "getVars for " << startText << endl;
QValueList<KTextEditor::CompletionEntry> varList;
QValueList<QString>::ConstIterator it;
for (it = m_vars.begin(); it != m_vars.end(); ++it) {
QString var = "$" + (*it);
kdDebug() << "Compair " << var << endl;
if( var.startsWith( startText ))
{
KTextEditor::CompletionEntry e;
e.text = var;
//e.postfix ="";
//e.prefix ="";
kdDebug() << "getVar: " << var << endl;
varList.append(e);
}
}
return varList;
}
示例10: dir
/*!
Constructs a DocLnkSet that contains DocLnk objects representing all
the files in the \a directory (and any subdirectories, recursively).
If \a mimefilter is not null,
only documents with a MIME type matching \a mimefilter are selected.
The value may contain multiple wild-card patterns separated by ";",
such as \c{*o/mpeg;audio/x-wav}.
See also \link applnk.html#files-and-links Files and Links\endlink.
*/
DocLnkSet::DocLnkSet( const QString &directory, const QString& mimefilter ) :
AppLnkSet()
{
QDir dir( directory );
mFile = dir.dirName();
QDict<void> reference(1021);
QStringList subFilter = QStringList::split(";", mimefilter);
QValueList<QRegExp> mimeFilters;
for( QStringList::Iterator it = subFilter.begin(); it != subFilter.end(); ++ it )
mimeFilters.append( QRegExp(*it, FALSE, TRUE) );
findChildren(directory, mimeFilters, reference);
const QList<DocLnk> &list = children();
for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) {
reference.remove( (*it)->file() );
}
for ( QDictIterator<void> dit(reference); dit.current(); ++dit ) {
if ( dit.current() == (void*)2 ) {
// Unreferenced, make an unwritten link
DocLnk* dl = new DocLnk;
QFileInfo fi( dit.currentKey() );
dl->setFile(fi.filePath());
dl->setName(fi.baseName());
// #### default to current path?
// dl->setCategories( ... );
bool match = mimefilter.isNull();
if ( !match )
for( QValueList<QRegExp>::Iterator it = mimeFilters.begin(); it != mimeFilters.end() && !match; ++ it )
if ( (*it).match(dl->type()) >= 0 )
match = TRUE;
if ( match /* && dl->type() != "application/octet-stream" */
&& !!dl->exec() )
add(dl);
else
delete dl;
}
}
}
示例11: shrink
void ButtonBar::shrink(int preferredDimension, int actualDimension)
{
if (!preferredDimension)
return;
m_shrinked = true;
uint textLength = 0;
QValueList<uint> texts;
uint maxLength = 0;
for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it)
{
uint length = (*it)->text().length();
maxLength = length > maxLength ? length : maxLength ;
texts.append(length);
textLength += length;
}
uint newPreferredLength = actualDimension * textLength / preferredDimension;
uint newMaxLength = maxLength;
uint newTextLength;
do {
newMaxLength -= 1;
newTextLength = 0;
for (QValueList<uint>::iterator it = texts.begin(); it != texts.end(); ++it)
{
if (*it > newMaxLength)
*it = newMaxLength;
newTextLength += *it;
}
} while (newTextLength > newPreferredLength);
int i = 0;
for (ButtonList::iterator it = m_buttons.begin(); it != m_buttons.end(); ++it)
{
(*it)->setText(KStringHandler::rsqueeze((*it)->realText(), texts[i++]));
(*it)->updateSize();
}
}
示例12: MHFolder
QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
{
QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
/* this is needed! */
if (m_storage) mailstorage_disconnect(m_storage);
init_storage();
if (!m_storage) {
return folders;
}
mail_list*flist = 0;
clistcell*current=0;
int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
if (r != MAIL_NO_ERROR || !flist) {
odebug << "error getting folder list" << oendl;
return folders;
}
for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) {
QString t = (char*)current->data;
t.replace(0,MHPath.length(),"");
folders->append(new MHFolder(t,MHPath));
}
mail_list_free(flist);
return folders;
}
示例13: d
QValueList<KURL> MessagesSource::filesInDir(KURL url,bool recursive)
{
QValueList<KURL> result;
QDir d(url.path());
d.setMatchAllDirs(true);
kdDebug(0) << d.count() << " files in dir "<< url.path()<<endl;
const QFileInfoList* files = d.entryInfoList();
kdDebug(0) << files << endl;
// QPtrListIterator<QFileInfo> it(*files);
if(files){
for (QPtrListIterator<QFileInfo> fileit(*files); !fileit.atLast(); ++fileit )
{
if ((*fileit)->isDir())
{
if(recursive)
{
if((*fileit)->fileName()!="." && (*fileit)->fileName() !="..")
{
result+=filesInDir(KURL((*fileit)->absFilePath()),recursive);
kdDebug(0) << "Recursion done for " << (*fileit)->fileName() << endl;
}
}
}
else
{
kdDebug(0) << (*fileit)->fileName() << endl;
result.append(KURL((*fileit)->absFilePath()));
}
}
}
kdDebug(0) << result.count() << endl;
return result;
}
示例14: sortedVersionList
/**
* Return a list of PackageVersion objects sorted by their version numbers,
* with the oldest version at the beginning and the latest version at the end
* of the list.
*/
QValueList<PackageVersion*> Package::sortedVersionList()
{
QValueList<PackageVersion*> sortedVersions;
QValueList<PackageVersion*>::iterator sortedVersionIterator;
PackageVersionMap::iterator versionIterator;
for( versionIterator = m_versions.begin();
versionIterator != m_versions.end(); versionIterator++ )
{
if( versionIterator == m_versions.begin() ) {
sortedVersions.append( *versionIterator );
continue; // if there is only one version, it can't be compared
}
// reverse iteration through the sorted version list
sortedVersionIterator = sortedVersions.end();
while( true )
{
if( sortedVersionIterator == sortedVersions.begin() )
{
sortedVersions.prepend( *versionIterator );
break;
}
sortedVersionIterator--;
if( (*versionIterator)->isNewerThan(
(*sortedVersionIterator)->version() ) )
{
sortedVersionIterator++; // insert after the compared one, not before
sortedVersions.insert( sortedVersionIterator, *versionIterator );
break;
}
}
}
return sortedVersions;
} // end of sortedVersionList()
示例15: setTableArea
bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser *docParser )
{
const uint pInitialTableSize = 20;
m_bLine = bLine;
m_bCol = bCol;
m_eLine = eLine;
m_eCol = eCol;
m_createNodes = false; //don't create the cell and row content when adding a new cell/row
Node *node = docParser->nodeAt(bLine, bCol + 1);
Node *lastNode = docParser->nodeAt(eLine, eCol);
if (node)
kdDebug(24000) << "node = " << node->tag->name << endl;
if (lastNode)
kdDebug(24000) << "lastnode = " << lastNode->tag->name << endl;
if (!node || !lastNode)
return false;
m_write = node->tag->write();
m_dtd = node->tag->dtd();
if ( !QuantaCommon::closesTag(node->tag, lastNode->tag) ) {
return false;
}
int nCol, nRow, maxCol;
nCol = nRow = maxCol = 0;
bool countRows = false;
bool missingBody = false;
m_rowSpin = 0L;
m_colSpin = 0L;
m_dataTable = 0L;
QValueList<TableNode> tableRowTags;
QValueVector< QValueVector<TableNode> > mergeMatrix;
mergeMatrix.resize(pInitialTableSize);
for (uint i = 0; i < pInitialTableSize; i++)
mergeMatrix[i].resize(pInitialTableSize);
TableNode tableNode;
Node *n = node;
while (n != lastNode->nextSibling())
{
QString tagName = n->tag->name.lower();
if (tagName == "table")
{
if (m_table && m_dataTable && nRow > 0 && nCol > 0) //nested table!
{
int line, col;
n->tag->beginPos(line, col);
NestedTable table;
table.row = nRow -1;
table.col = nCol - 1;
table.bLine = line;
table.bCol = col;
if (n->next && QuantaCommon::closesTag(n->tag, n->next->tag)) {
n->next->tag->endPos(table.eLine, table.eCol);
table.node = n;
table.nestedData = m_write->text(table.bLine, table.bCol, table.eLine, table.eCol);
m_nestedTables.append(table);
m_dataTable->item(nRow -1, nCol -1)->setPixmap(QIconSet(UserIcon("quick_table")).pixmap());
m_dataTable->updateCell(nRow - 1, nCol - 1);
}
n = n->next;
} else
{
m_table = new Tag(*(n->tag));
newNum++;
}
}
else if (tagName == "thead")
{
headerCheckBox->setChecked(true);
countRows = true;
m_rowSpin = headerRowSpinBox;
m_colSpin = headerColSpinBox;
m_dataTable= headerTableData;
m_tableTags = m_tableHeaderTags;
m_tableRows = m_tableHeaderRows;
if (m_thead) { //there was already a <thead> tag in the area
nRow = m_dataTable->numRows();
} else {
m_thead = new Tag(*(n->tag));
newNum++;
}
}
else if (tagName == "/thead")
{
headerRowSpinBox->setValue(nRow);
headerColSpinBox->setValue(maxCol);
countRows = false;
nCol = nRow = maxCol = 0;
m_rowSpin = 0L;
m_colSpin = 0L;
m_dataTable = 0L;
}
else if (tagName == "tfoot")
{
footerCheckBox->setChecked(true);
m_rowSpin = footerRowSpinBox;
m_colSpin = footerColSpinBox;
m_tableTags = m_tableFooterTags;
m_tableRows = m_tableFooterRows;
m_dataTable = footerTableData;
countRows = true;
//.........这里部分代码省略.........