下拉列表和菜单-创新互联

1,QComboBox




connect(ui.load_combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(load_sel(int)));

bool ar_editor_window,::load_sel(int index)
{
//int seleitem = ui.load_combobox->currentIndex();
bool rt = false;
switch (index)
{
case 0:
;
break;
case 1:
;
break;
default:
break;
}
return rt;
}

2,按钮菜单
_load_button = new QPushButton()
_load_menu = new QMenu();

海珠网站建设公司创新互联,海珠网站设计制作,有大型网站制作公司丰富经验。已为海珠成百上千提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的海珠做网站的公司定做!

_load_model_action = new QAction(_load_menu);

_load_pack_action = new QAction(_load_menu);

_load_menu->addAction(_load_model_action);

_load_menu->addAction(_load_pack_action);

_load_button->setMenu(_load_menu);
//remove_watermarks_button->setStyleSheet("QPushButton::menu-indicator{image:None;}");//去掉下拉三角

_load_button->setText(QStringLiteral ("导入"));
_load_model_action->setText(QStringLiteral("导入模型"));

_load_pack_action->setText(QStringLiteral("导入资源包"));

connect(_load_model_action, SIGNAL(triggered()), this, SLOT(load_model()));

connect(_load_pack_action, SIGNAL(triggered()), this, SLOT(load_pack()));


分享题目:下拉列表和菜单-创新互联
网站网址:http://pwwzsj.com/article/dssesi.html