本文整理汇总了C++中Match::games_const方法的典型用法代码示例。如果您正苦于以下问题:C++ Match::games_const方法的具体用法?C++ Match::games_const怎么用?C++ Match::games_const使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Match
的用法示例。
在下文中一共展示了Match::games_const方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
MatchResDialog::MatchResDialog( Match match, QWidget* parent )
: QDialog( parent ),
_match( match ),
_okButton( new QPushButton( tr( "Save" ) ) )
{
setWindowTitle( tr( "Match score" ) );
_okButton->setEnabled( false );
QGridLayout* l = new QGridLayout( this );
QLabel* playerA = new QLabel( match.playerA().name(), this );
QLabel* playerB = new QLabel( match.playerB().name(), this );
l->addWidget( playerA, 0, 0, Qt::AlignJustify );
l->addWidget( playerB, 0, 1, Qt::AlignJustify );
unsigned int games = match.games_const().count();
for ( unsigned int i = 0; i < match.maxGames(); i ++ ) {
QLineEdit* ballsA = new QLineEdit( this );
QLineEdit* ballsB = new QLineEdit( this );
if ( i < games ) {
// this should be done before connecting of lineedits to textChanged
// slot
ballsA->setText( QString::number( match.games_const().at( i ).aBalls ) );
ballsB->setText( QString::number( match.games_const().at( i ).bBalls ) );
}
connect( ballsA, SIGNAL( textChanged( const QString& ) ),
this, SLOT( textChanged( ) ) );
connect( ballsB, SIGNAL( textChanged( const QString& ) ),
this, SLOT( textChanged( ) ) );
l->addWidget( ballsA, i + 1, 0 );
l->addWidget( ballsB, i + 1, 1 );
}
if ( games ) {
textChanged();
}
l->addWidget( _okButton, l->rowCount(), 0, 1, 2 );
connect( _okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
}
示例2: setMatchResults
void Group::setMatchResults( Match m )
{
setMatchResults( m.playerA(), m.playerB(), m.games_const() );
}