本文整理汇总了C++中Pattern::name方法的典型用法代码示例。如果您正苦于以下问题:C++ Pattern::name方法的具体用法?C++ Pattern::name怎么用?C++ Pattern::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pattern
的用法示例。
在下文中一共展示了Pattern::name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showDetails
void Window::showDetails() {
Pattern* pattern = m_board->pattern();
if (!pattern) {
return;
}
QString patternid = QSettings().value("Current/Pattern", 0).toString();
static const QStringList sizes = QStringList() << NewGameDialog::tr("Low")
<< NewGameDialog::tr("Medium")
<< NewGameDialog::tr("High")
<< NewGameDialog::tr("Very High");
QString number = "4"
+ m_board->words()->language()
+ patternid
+ QString::number(pattern->wordCount())
+ QString("%1").arg(int(pattern->wordLength() - 4), 2, 16, QLatin1Char('0'))
+ QString::number(pattern->seed(), 16);
QMessageBox dialog(QMessageBox::Information,
tr("Details"),
QString("<p><b>%1</b> %2<br><b>%3</b> %4<br><b>%5</b> %6<br><b>%7</b> %8<br><b>%9</b> %10</p>")
.arg(tr("Pattern:")).arg(pattern->name())
.arg(NewGameDialog::tr("Language:")).arg(LocaleDialog::languageName(m_board->words()->language()))
.arg(NewGameDialog::tr("Amount of Words:")).arg(sizes.value(pattern->wordCount()))
.arg(NewGameDialog::tr("Word Length:")).arg(NewGameDialog::tr("%n letter(s)", "", pattern->wordLength() + 1))
.arg(tr("Game Number:")).arg(number),
QMessageBox::NoButton,
this);
dialog.setIconPixmap(QIcon(QString(":/patterns/%1.png").arg(patternid)).pixmap(96,96));
dialog.exec();
}
示例2: findPattern
// Find pattern by name
Pattern* Model::findPattern(QString name) const
{
Messenger::enter("Model::findPattern");
Pattern* p = NULL;
for (p = patterns_.first(); p != NULL; p = p->next) if (p->name() == name) break;
if (p == NULL) Messenger::print("Pattern '%s' does not exist in model '%s'.", qPrintable(name), qPrintable(name_));
Messenger::exit("Model::findPattern");
return p;
}
示例3: setName
void InstrumentTrack::setName( const QString & _new_name )
{
// when changing name of track, also change name of those patterns,
// which have the same name as the instrument-track
for( int i = 0; i < numOfTCOs(); ++i )
{
Pattern* p = dynamic_cast<Pattern*>( getTCO( i ) );
if( ( p != NULL && p->name() == name() ) || p->name() == "" )
{
p->setName( _new_name );
}
}
Track::setName( _new_name );
m_midiPort.setName( name() );
m_audioPort.setName( name() );
emit nameChanged();
}
示例4: printPatterns
// Print patterns
void Model::printPatterns() const
{
Messenger::enter("Model::printPatterns");
Pattern* p = patterns_.first();
if (p == NULL) Messenger::print("No patterns defined for model '%s'.", qPrintable(name_));
else
{
Messenger::print("Pattern info for model '%s':", qPrintable(name_));
Messenger::print(" ID NMols StartId EndId Name Forcefield");
while (p != NULL)
{
Messenger::print(" %2i %-5i %-6i %-6i %-16s %s", p->id(), p->nMolecules(), p->startAtom()+1, p->endAtom()+1, qPrintable(p->name()), p->forcefield() ? qPrintable(p->forcefield()->name()) : "< Inherited >");
p = p->next;
}
}
Messenger::exit("Model::printPatterns");
}