本文整理汇总了C++中model::Model::yearDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::yearDescription方法的具体用法?C++ Model::yearDescription怎么用?C++ Model::yearDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model::Model
的用法示例。
在下文中一共展示了Model::yearDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MainTabController
LocationTabController::LocationTabController(const model::Model & model,
const QString& modelTempDir)
: MainTabController(new LocationTabView(model,modelTempDir))
{
LocationView * locationView = new LocationView(model, modelTempDir);
mainContentWidget()->addSubTab("Weather File && Design Days",locationView,WEATHER_FILE);
LifeCycleCostsView * lifeCycleCostsView = new LifeCycleCostsView(model);
mainContentWidget()->addSubTab("Life Cycle Costs",lifeCycleCostsView,LIFE_CYCLE_COSTS);
QLabel * label;
label = new QLabel();
label->setPixmap(QPixmap(":/images/utility_calibration_warning.png"));
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
m_utilityBillsController = std::shared_ptr<UtilityBillsController>(new UtilityBillsController(model));
m_utilityBillsStackedWidget = new QStackedWidget();
m_warningWidgetIndex = m_utilityBillsStackedWidget->addWidget(label);
m_visibleWidgetIndex = m_utilityBillsStackedWidget->addWidget(m_utilityBillsController->subTabView());
mainContentWidget()->addSubTab("Utility Bills",m_utilityBillsStackedWidget,UTILITY_BILLS);
// Determine if the utility bill sub-tab is shown
boost::optional<model::YearDescription> yearDescription = model.yearDescription();
if (yearDescription){
boost::optional<int> calendarYear = yearDescription.get().calendarYear();
if (calendarYear){
boost::optional<model::WeatherFile> weatherFile = model.weatherFile();
if (weatherFile){
boost::optional<model::RunPeriod> runPeriod = model.getOptionalUniqueModelObject<model::RunPeriod>();
if (runPeriod.is_initialized()){
m_utilityBillsStackedWidget->setCurrentIndex(m_visibleWidgetIndex);
}
else {
m_utilityBillsStackedWidget->setCurrentIndex(m_warningWidgetIndex);
}
}
}
}
// Hack code to remove when tab active
label = new QLabel();
label->setPixmap(QPixmap(":/images/coming_soon_utility_rates.png"));
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
mainContentWidget()->addSubTab("Utility Rates",label,UTILITY_RATES);
// Hack code to remove when tab active
//label = new QLabel();
//label->setPixmap(QPixmap(":/images/coming_soon_ground_temperature.png"));
//label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
//mainContentWidget()->addSubTab("Ground Temperature",label,GROUND_TEMPERATURE);
// Hack code to remove when tab active
//label = new QLabel();
//label->setPixmap(QPixmap(":/images/coming_soon_water_mains_temperature.png"));
//label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
//mainContentWidget()->addSubTab("Water Mains Temperature",label,WATER_MAINS_TEMPERATURE);
}