本文整理汇总了C++中Style::categoryNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ Style::categoryNumber方法的具体用法?C++ Style::categoryNumber怎么用?C++ Style::categoryNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Style
的用法示例。
在下文中一共展示了Style::categoryNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTextFormat
QString RecipeFormatter::getTextFormat()
{
QString ret = "";
QString tmp = "";
if( rec == 0 )
return "";
Style* style = rec->style();
ret += QString("%1 - %2 (%3%4)\n").arg( rec->name())
.arg( style ? style->name() : tr("unknown style"))
.arg( style ? style->categoryNumber() : tr("N/A"))
.arg( style ? style->styleLetter() : "");
ret += getTextSeparator();
ret += buildStatTableTxt();
if((tmp = buildFermentableTableTxt()) != "")
{
ret += "\n" + tr("Fermentables") + "\n";
ret += getTextSeparator();
ret += tmp;
}
if((tmp = buildHopsTableTxt()) != "")
{
ret += "\n" + tr("Hops") + "\n";
ret += getTextSeparator();
ret += tmp;
}
if((tmp = buildMiscTableTxt()) != "")
{
ret += "\n" + tr("Miscs") + "\n";
ret += getTextSeparator();
ret += tmp;
}
if((tmp = buildYeastTableTxt()) != "")
{
ret += "\n" + tr("Yeasts") + "\n";
ret += getTextSeparator();
ret += tmp;
}
if((tmp = buildMashTableTxt()) != "")
{
ret += "\n" + tr("Mash") + "\n";
ret += getTextSeparator();
ret += tmp;
}
if( (tmp = rec->notes()) != "" )
{
ret += "\n" + tr("Notes") + "\n";
ret += getTextSeparator();
ret += tmp;
}
if((tmp = buildInstructionTableTxt()) != "")
{
ret += "\n" + tr("Instructions") + "\n";
ret += getTextSeparator();
ret += tmp;
}
return ret;
}
示例2: showChanges
void StyleEditor::showChanges(QMetaProperty* metaProp)
{
bool updateAll = false;
QString propName;
QVariant val;
Style *s = obsStyle;
if( s == 0 )
{
clear();
return;
}
if( metaProp == 0 )
updateAll = true;
else
{
propName = metaProp->name();
val = metaProp->read(s);
}
if( updateAll )
{
lineEdit_name->setText(s->name());
lineEdit_category->setText(s->category());
lineEdit_categoryNumber->setText(s->categoryNumber());
lineEdit_styleLetter->setText(s->styleLetter());
lineEdit_styleGuide->setText(s->styleGuide());
comboBox_type->setCurrentIndex(s->type());
lineEdit_ogMin->setText(s);
lineEdit_ogMax->setText(s);
lineEdit_fgMin->setText(s);
lineEdit_fgMax->setText(s);
lineEdit_ibuMin->setText(s);
lineEdit_ibuMax->setText(s);
lineEdit_colorMin->setText(s);
lineEdit_colorMax->setText(s);
lineEdit_carbMin->setText(s);
lineEdit_carbMax->setText(s);
lineEdit_abvMin->setText(s);
lineEdit_abvMax->setText(s);
textEdit_profile->setText(s->profile());
textEdit_ingredients->setText(s->ingredients());
textEdit_examples->setText(s->examples());
textEdit_notes->setText(s->notes());
return;
}
if( propName == "name" )
lineEdit_name->setText(val.toString());
else if( propName == "category" )
lineEdit_category->setText(val.toString());
else if( propName == "categoryNumber" )
lineEdit_categoryNumber->setText(val.toString());
else if( propName == "styleLetter" )
lineEdit_styleLetter->setText(val.toString());
else if( propName == "styleGuide" )
lineEdit_styleGuide->setText(val.toString());
else if( propName == "type" )
comboBox_type->setCurrentIndex(val.toInt());
else if( propName == "ogMin" )
lineEdit_ogMin->setText(val);
else if( propName == "ogMax" )
lineEdit_ogMax->setText(val);
else if( propName == "fgMin" )
lineEdit_fgMin->setText(val);
else if( propName == "fgMax" )
lineEdit_fgMax->setText(val);
else if( propName == "ibuMin" )
lineEdit_ibuMin->setText(val);
else if( propName == "ibuMax" )
lineEdit_ibuMax->setText(val);
else if( propName == "colorMin_srm" )
lineEdit_colorMin->setText(val);
else if( propName == "colorMax_srm" )
lineEdit_colorMax->setText(val);
else if( propName == "carbMin_vol" )
lineEdit_carbMin->setText(val);
else if( propName == "carbMax_vol" )
lineEdit_carbMax->setText(val);
else if( propName == "abvMin_pct" )
lineEdit_abvMin->setText(val);
else if( propName == "abvMax_pct" )
lineEdit_abvMax->setText(val);
else if( propName == "profile" )
textEdit_profile->setText(val.toString());
else if( propName == "ingredients" )
textEdit_ingredients->setText(val.toString());
else if( propName == "examples" )
textEdit_examples->setText(val.toString());
else if( propName == "notes" )
textEdit_notes->setText(val.toString());
}