// 回放 auto widget = new QWidget; { auto checkbox = new QCheckBox("回放"); auto layout = new QHBoxLayout; layout->addWidget(checkbox); layout->setContentsMargins(5,1,5,1); widget->setLayout(layout); auto action = new QWidgetAction(playback); action->setDefaultWidget(widget); playback->addAction(action); // playback 菜单 }
标签:widget,layout,QT,auto,Qcheckbox,playback,action,new,复选框 From: https://www.cnblogs.com/RedWetPlace/p/17778535.html