本文整理汇总了C++中WComboBox::sactivated方法的典型用法代码示例。如果您正苦于以下问题:C++ WComboBox::sactivated方法的具体用法?C++ WComboBox::sactivated怎么用?C++ WComboBox::sactivated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WComboBox
的用法示例。
在下文中一共展示了WComboBox::sactivated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WContainerWidget
WWidget *FormWidgets::wComboBox()
{
WContainerWidget *result = new WContainerWidget();
topic("WComboBox", result);
addText(tr("formwidgets-WComboBox"), result);
WComboBox *cb = new WComboBox(result);
cb->addItem("Heavy");
cb->addItem("Medium");
cb->addItem("Light");
cb->setCurrentIndex(1); // select 'Medium'
ed_->showSignal(cb->sactivated(), "Combo-box 1 activated: ");
addText(tr("formwidgets-WComboBox-model"), result);
addText(tr("formwidgets-WComboBox-style"), result);
WComboBox *colorCb = new WComboBox(result);
WStandardItemModel* model = new WStandardItemModel(colorCb);
model->insertColumns(0, 3);
addColorElement(model, "Red", "combo-red");
addColorElement(model, "Blue", "combo-blue");
addColorElement(model, "Green", "combo-green");
colorCb->setModel(model);
colorCb->setCurrentIndex(0); // select 'Red'
ed_->showSignal(colorCb->sactivated(), "Combo-box 2 activated: ");
return result;
}
示例2: WBreak
WWidget *StyleLayout::wLoadingIndicator()
{
WContainerWidget *result = new WContainerWidget();
topic("WLoadingIndicator", result);
addText(tr("style-WLoadingIndicator"), result);
//fix for the WOverlayLoadingIndicator
WApplication::instance()->styleSheet().addRule("body", "margin: 0px");
addText("Select a loading indicator: ", result);
WComboBox *cb = new WComboBox(result);
cb->addItem("WDefaultLoadingIndicator");
cb->addItem("WOverlayLoadingIndicator");
cb->addItem("EmwebLoadingIndicator");
cb->setCurrentIndex(0);
cb->sactivated().connect(this, &StyleLayout::loadingIndicatorSelected);
new WBreak(result);
WPushButton *load = new WPushButton("Load!", result);
load->clicked().connect(this, &StyleLayout::load);
return result;
}