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


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

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


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

示例1: setPids

bool DvbStream::setPids( DVBout *o )
{
	int i, dmx;
	struct dmx_pes_filter_params pesFilterParams;
	dmx_pes_type_t pestype = DMX_PES_OTHER;
	QValueList<int> pidList;

	pidList = o->pidsList();

	for ( i=0; i<(int)pidList.count(); i++ ) {
		if ( ( dmx = open( demuxName.ascii(), O_RDWR)) < 0 ) {
			fprintf(stderr,"FD %i: ",i);
			perror("DEMUX DEVICE: ");
			return false;
		}
		else
			o->dmx.append(dmx);
	}

	for ( i=0; i<(int)pidList.count(); i++ ) {
		pesFilterParams.pid = pidList[i];
		pesFilterParams.input = DMX_IN_FRONTEND;
		pesFilterParams.output = DMX_OUT_TS_TAP;
		pesFilterParams.pes_type = pestype;
		pesFilterParams.flags = DMX_IMMEDIATE_START;
		if ( ioctl( o->dmx[i], DMX_SET_PES_FILTER, &pesFilterParams) < 0)  {
			fprintf( stderr, "FILTER %i: ", pidList[i] );
			perror("DMX SET PES FILTER");
		}
	}

	ndmx +=pidList.count();

	return true;
}
开发者ID:iegor,项目名称:kdesktop,代码行数:35,代码来源:dvbstream.cpp

示例2: writeTransactionEntry

void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransaction& t, const QString& accountId)
{
  MyMoneyFile* file = MyMoneyFile::instance();
  MyMoneySplit split = t.splitByAccount(accountId);

  s << "D" << m_qifProfile.date(t.postDate()) << endl;

  switch(split.reconcileFlag()) {
    case MyMoneySplit::Cleared:
      s << "C*" << endl;
      break;

    case MyMoneySplit::Reconciled:
    case MyMoneySplit::Frozen:
      s << "CX" << endl;
      break;

    default:
      break;
  }

  if(split.memo().length() > 0) {
    QString m = split.memo();
    m.replace('\n', "\\n");
    s << "M" << m << endl;
  }

  s << "T" << m_qifProfile.value('T', split.value()) << endl;

  if(split.number().length() > 0)
    s << "N" << split.number() << endl;

  if(!split.payeeId().isEmpty()) {
    MyMoneyPayee payee = file->payee(split.payeeId());
    s << "P" << payee.name() << endl;
  }

  QValueList<MyMoneySplit> list = t.splits();
  if(list.count() > 1) {
    MyMoneySplit sp = t.splitByAccount(accountId, false);
    MyMoneyAccount acc = file->account(sp.accountId());
    if(acc.accountGroup() != MyMoneyAccount::Income
    && acc.accountGroup() != MyMoneyAccount::Expense) {
      s << "L" << m_qifProfile.accountDelimiter()[0]
              << MyMoneyFile::instance()->accountToCategory(sp.accountId())
              << m_qifProfile.accountDelimiter()[1] << endl;
    } else {
      s << "L" << file->accountToCategory(sp.accountId()) << endl;
    }
    if(list.count() > 2) {
      QValueList<MyMoneySplit>::ConstIterator it;
      for(it = list.begin(); it != list.end(); ++it) {
        if(!((*it) == split)) {
          writeSplitEntry(s, *it);
        }
      }
    }
  }
  s << "^" << endl;
}
开发者ID:sajidji94,项目名称:kmymoney2,代码行数:60,代码来源:mymoneyqifwriter.cpp

示例3: isParentof

bool AttachItem::isParentof(const QValueList<int>&path)
{
    /* if not set, then no parent */
    if (path.count()==0||_path.count()==0) return false;
    /* the parent must have one digit less then a child */
    if (path.count()!=_path.count()+1) return false;
    for (unsigned int i=0; i < _path.count();++i)
    {
        if (_path[i]!=path[i]) return false;
    }
    return true;
}
开发者ID:opieproject,项目名称:opie,代码行数:12,代码来源:viewmail.cpp

示例4: 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

示例5: reactToChanges

void PlaylistItem::reactToChanges( const QValueList<int> &columns )
{
    MetaBundle::reactToChanges(columns);
    bool totals = false, ref = false, length = false, url = false;
    for( int i = 0, n = columns.count(); i < n; ++i )
      {
        if( columns[i] == Mood )
          moodbar().reset();
	if ( !length && columns[i] == Length ) {
	    length = true;
	    incrementLengths();
	    listView()->countChanged();
	}
        switch( columns[i] )
        {
            case Artist: case Album: ref = true; //note, no breaks
            case Track: case Rating: case Score: case LastPlayed:
                totals = true; break;
            case Filename: case Directory: url = true;
        }
        updateColumn( columns[i] );
      }
    if ( url )
        Playlist::instance()->m_urlIndex.add(this);
    if( ref )
        refAlbum();
    if( totals )
        incrementTotals();
}
开发者ID:gms8994,项目名称:amarok-1.4,代码行数:29,代码来源:playlistitem.cpp

示例6: readConfig

void FavoriteFolderView::readConfig()
{
    mReadingConfig = true;
    clear();
    QValueList<int> folderIds = GlobalSettings::self()->favoriteFolderIds();
    QStringList folderNames = GlobalSettings::self()->favoriteFolderNames();
    QListViewItem *afterItem = 0;
    for(uint i = 0; i < folderIds.count(); ++i)
    {
        KMFolder *folder = kmkernel->folderMgr()->findById(folderIds[i]);
        if(!folder)
            folder = kmkernel->imapFolderMgr()->findById(folderIds[i]);
        if(!folder)
            folder = kmkernel->dimapFolderMgr()->findById(folderIds[i]);
        if(!folder)
            folder = kmkernel->searchFolderMgr()->findById(folderIds[i]);
        QString name;
        if(folderNames.count() > i)
            name = folderNames[i];
        afterItem = addFolder(folder, name, afterItem);
    }
    if(firstChild())
        ensureItemVisible(firstChild());

    // folder tree is not yet populated at this point
    QTimer::singleShot(0, this, SLOT(initializeFavorites()));

    readColorConfig();
    mReadingConfig = false;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:30,代码来源:favoritefolderview.cpp

示例7: slotLoadDays

void HistoryDialog::slotLoadDays()
{
		if(mInit.dateMCList.isEmpty())
		{
				if (!mMainWidget->searchLine->text().isEmpty())
					QTimer::singleShot(0, this, SLOT(slotSearch()));
				doneProgressBar();
				return;
		}
		
		DMPair pair(mInit.dateMCList.first());
		mInit.dateMCList.pop_front();
		HistoryLogger logger(pair.metaContact(), this);
		QValueList<int> dayList = logger.getDaysForMonth(pair.date());
		for (unsigned int i=0; i<dayList.count(); i++)
		{
				QDate c2Date(pair.date().year(),pair.date().month(),dayList[i]);
				if (mInit.dateMCList.find(pair) == mInit.dateMCList.end())
						new KListViewDateItem(mMainWidget->dateListView, c2Date, pair.metaContact());
		}
		mMainWidget->searchProgress->advance(1);
		QTimer::singleShot(0,this,SLOT(slotLoadDays()));


}
开发者ID:woodyplus,项目名称:kde3-kdenetwork,代码行数:25,代码来源:historydialog.cpp

示例8: testTaxReport

void QueryTableTest::testTaxReport()
{
  try {
    TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo );
    TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax );

    unsigned cols;
    MyMoneyReport filter;

    filter.setRowType( MyMoneyReport::eCategory );
    filter.setName("Tax Transactions");
    cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
    filter.setQueryColumns( static_cast<MyMoneyReport::EQueryColumns>(cols) );
    filter.setTax(true);

    XMLandback(filter);
    QueryTable qtbl_3(filter);

    writeTabletoHTML(qtbl_3,"Tax Transactions.html");

    QValueList<ListTable::TableRow> rows = qtbl_3.rows();

    QString html = qtbl_3.renderHTML();
    CPPUNIT_ASSERT(rows.count() == 1);
  } catch(MyMoneyException *e) {
    CPPUNIT_FAIL(e->what());
    delete e;
  }
}
开发者ID:yllohy,项目名称:kmymoney2,代码行数:29,代码来源:querytabletest.cpp

示例9: contentsMouseMoveEvent

/******************************************************************************
*  Called when the mouse is moved.
*  Creates a drag object when the mouse drags one or more selected items.
*/
void AlarmListView::contentsMouseMoveEvent(QMouseEvent *e)
{
    QListView::contentsMouseMoveEvent(e);
    if(mMousePressed
            && (mMousePressPos - e->pos()).manhattanLength() > QApplication::startDragDistance())
    {
        // Create a calendar object containing all the currently selected alarms
        kdDebug(5950) << "AlarmListView::contentsMouseMoveEvent(): drag started" << endl;
        mMousePressed = false;
        KCal::CalendarLocal cal(QString::fromLatin1("UTC"));
        cal.setLocalTime();    // write out using local time (i.e. no time zone)
        QValueList<EventListViewItemBase *> items = selectedItems();
        if(!items.count())
            return;
        for(QValueList<EventListViewItemBase *>::Iterator it = items.begin();  it != items.end();  ++it)
        {
            const KAEvent &event = (*it)->event();
            KCal::Event *kcalEvent = new KCal::Event;
            event.updateKCalEvent(*kcalEvent, false, true);
            kcalEvent->setUid(event.id());
            cal.addEvent(kcalEvent);
        }

        // Create the drag object for the destination program to receive
        mDragging = true;
        KCal::ICalDrag *dobj = new KCal::ICalDrag(&cal, this);
        dobj->dragCopy();       // the drag operation will copy the alarms
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:33,代码来源:alarmlistview.cpp

示例10: setSchedules

void KMyMoneyBriefSchedule::setSchedules(QValueList<MyMoneySchedule> list, const QDate& date)
{
  m_scheduleList = list;
  m_date = date;

  m_index = 0;
  if (list.count() >= 1)
  {
    loadSchedule();
  }
}
开发者ID:sajidji94,项目名称:kmymoney2,代码行数:11,代码来源:kmymoneybriefschedule.cpp

示例11: findChildren

void DocLnkSet::findChildren(const QString &dr, const QValueList<QRegExp> &mimeFilters, QDict<void> &reference, int depth)
{
    depth++;
    if ( depth > 10 )
  return;

    QDir dir( dr );

    /* Opie got a different approach
     * I guess it's geek vs. consumer
     * in this case to be discussed
     */
    if ( dir.exists( ".Qtopia-ignore" ) )
  return;

    const QFileInfoList *list = dir.entryInfoList();
    if ( list ) {
  QFileInfo* fi;
  for ( QFileInfoListIterator it(*list); (fi=*it); ++it ) {
      QString bn = fi->fileName();
      if ( bn[0] != '.' ) {
    if ( fi->isDir()  ) {
        if ( bn != "CVS" && bn != "Qtopia" && bn != "QtPalmtop" )
      findChildren(fi->filePath(), mimeFilters, reference, depth);
    } else {
        if ( fi->extension(FALSE) == "desktop" ) {
      DocLnk* dl = new DocLnk( fi->filePath() );
      QFileInfo fi2(dl->file());
      bool match = FALSE;
      if ( !fi2.exists() ) {
          dir.remove( dl->file() );
      }
      if ( mimeFilters.count() == 0 ) {
          add( dl );
          match = TRUE;
      } else {
          for( QValueList<QRegExp>::ConstIterator it = mimeFilters.begin(); it != mimeFilters.end(); ++ it ) {
        if ( (*it).match(dl->type()) >= 0 ) {
            add(dl);
            match = TRUE;
        }
          }
      }
      if ( !match )
          delete dl;
        } else {
      if ( !reference.find(fi->fileName()) )
          reference.insert(fi->filePath(), (void*)2);
        }
    }
      }
  }
    }
}
开发者ID:opieproject,项目名称:opie,代码行数:54,代码来源:applnk.cpp

示例12: saveReactivates

void Undo::saveReactivates(const QValueList<KAEvent> &events)
{
    int count = events.count();
    if(count == 1)
        saveReactivate(events.first());
    else if(count > 1)
    {
        new UndoReactivates(UNDO, events);
        emitChanged();
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:11,代码来源:undo.cpp

示例13: saveSplitterSize

void RcFile::saveSplitterSize (Parm name, QSplitter *sp, const QString &n)
{
  QStringList stringList;
  QValueList<int> sizeList = sp->sizes();
  
  int loop;
  for (loop = 0; loop < (int) sizeList.count(); loop++)
    stringList.append(QString::number(sizeList[loop]));
  
  QString s(stringList.join(","));
  saveData(name, s, n);
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:12,代码来源:RcFile.cpp

示例14: loadConfig

void CdWidget::loadConfig( KConfig* config )
{
	QValueList<int> sl;

	config->setGroup("DVBClient");
	sl = config->readIntListEntry("SplitSizes");
	if ( !sl.count() ) {
		sl.append( 200 );
		sl.append( 200 );
	}
	split->setSizes( sl );
}
开发者ID:iegor,项目名称:kdesktop,代码行数:12,代码来源:cdwidget.cpp

示例15:

FNTextDialog::FNTextDialog(const QString& fontname, FNColorDialog* dlg, QWidget* parent, const char* name )
	:FNTextDialogBase(parent, name, true, 0), _pen(1), _colorSelector(dlg)
{
	static QFontDatabase fbase;
	QValueList<int> sizes = fbase.pointSizes(fontname);
	char buf[10];
	for (uint i = 0; i < sizes.count(); ++i) {
		sprintf(buf, "%d", sizes[i]);
		cboFontSize->insertItem(buf);
	}
	lines->setFont(QFont(fontname, 20));
}
开发者ID:4doe,项目名称:openembedded,代码行数:12,代码来源:FNTextDialog.cpp


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