本文整理汇总了C++中QValueVector::count方法的典型用法代码示例。如果您正苦于以下问题:C++ QValueVector::count方法的具体用法?C++ QValueVector::count怎么用?C++ QValueVector::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QValueVector
的用法示例。
在下文中一共展示了QValueVector::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: projectReady
void ConnectWizard::projectReady( const Project & p )
{
bool any_selected = 0;
d->project = p;
setFinishEnabled( SelectViewPage, false );
m_viewList->clear();
d->viewMap.clear();
QValueVector<QString> vv = p.views().keys();
for( unsigned i = 0; i < vv.count(); i++ ) {
QListBoxText* item = new QListBoxText( m_viewList,
p.localizator()->localizedMessage( vv[ i ] ) );
d->viewMap.insert( item, vv[ i ] );
// preselect view in listbox
if( d->viewId == vv[ i ] ) {
m_viewList->setSelected( item, true );
any_selected = true;
}
}
if( ! any_selected && p.views().count() > 0 ) {
m_viewList->setSelected( 0, true );
}
}
示例2: notifySetup
void MiniBar::notifySetup( const QValueVector< KPDFPage * > & pageVector, bool changed )
{
// only process data when document changes
if ( !changed )
return;
// if document is closed or has no pages, hide widget
int pages = pageVector.count();
if ( pages < 1 )
{
m_currentPage = -1;
static_cast<QWidget*>( parent() )->hide();
return;
}
// resize width of widgets
int numberWidth = 10 + fontMetrics().width( QString::number( pages ) );
m_pagesEdit->setMinimumWidth( numberWidth );
m_pagesEdit->setMaximumWidth( 2 * numberWidth );
m_pagesButton->setMinimumWidth( numberWidth );
m_pagesButton->setMaximumWidth( 2 * numberWidth );
// resize height of widgets
int fixedHeight = fontMetrics().height() + 2;
if ( fixedHeight < 18 )
fixedHeight = 18;
m_pagesEdit->setFixedHeight( fixedHeight );
m_pagesButton->setFixedHeight( fixedHeight );
m_prevButton->setFixedHeight( fixedHeight );
m_nextButton->setFixedHeight( fixedHeight );
// update child widgets
m_pagesEdit->setPagesNumber( pages );
m_pagesButton->setText( QString::number( pages ) );
m_prevButton->setEnabled( false );
m_nextButton->setEnabled( false );
static_cast<QWidget*>( parent() )->show();
}
示例3: notifySetup
//BEGIN DocumentObserver inherited methods
void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged )
{
// if there was a widget selected, save its pagenumber to restore
// its selection (if available in the new set of pages)
int prevPage = -1;
if ( !documentChanged && m_selected )
{
prevPage = m_selected->page()->number();
}
// delete all the Thumbnails
QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
for ( ; tIt != tEnd; ++tIt )
delete *tIt;
m_thumbnails.clear();
m_visibleThumbnails.clear();
m_selected = 0;
if ( pages.count() < 1 )
{
resizeContents( 0, 0 );
return;
}
// show pages containing hilighted text or bookmarked ones
//RESTORE THIS int flags = Settings::filterBookmarks() ? KPDFPage::Bookmark : KPDFPage::Highlight;
// if no page matches filter rule, then display all pages
QValueVector< KPDFPage * >::const_iterator pIt = pages.begin(), pEnd = pages.end();
bool skipCheck = true;
for ( ; pIt != pEnd ; ++pIt )
//if ( (*pIt)->attributes() & flags )
if ( (*pIt)->hasHighlights( SW_SEARCH_ID ) )
skipCheck = false;
// generate Thumbnails for the given set of pages
int width = clipper()->width(),
totalHeight = 0;
for ( pIt = pages.begin(); pIt != pEnd ; ++pIt )
//if ( skipCheck || (*pIt)->attributes() & flags )
if ( skipCheck || (*pIt)->hasHighlights( SW_SEARCH_ID ) )
{
ThumbnailWidget * t = new ThumbnailWidget( viewport(), *pIt, this );
t->setFocusProxy( this );
// add to the scrollview
addChild( t, 0, totalHeight );
// add to the internal queue
m_thumbnails.push_back( t );
// update total height (asking widget its own height)
t->resizeFitWidth( width );
totalHeight += t->heightHint() + 4;
if ( (*pIt)->number() == prevPage )
{
m_selected = t;
m_selected->setSelected( true );
}
t->show();
}
// update scrollview's contents size (sets scrollbars limits)
resizeContents( width, totalHeight );
// request for thumbnail generation
delayedRequestVisiblePixmaps( 200 );
}