当前位置: 首页>>代码示例>>C++>>正文


C++ WComboBox::sactivated方法代码示例

本文整理汇总了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;
}
开发者ID:StevenFarley,项目名称:wt,代码行数:28,代码来源:FormWidgets.C

示例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;
}
开发者ID:ReWeb3D,项目名称:wt,代码行数:23,代码来源:StyleLayout.C


注:本文中的WComboBox::sactivated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。