QT 菜单中添加Qcheckbox复选框

// 回放
    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 菜单
    }

 

posted @ 2023-10-21 10:07  雾枫  阅读(142)  评论(0编辑  收藏  举报