RibbonGroup添加QCheckBox

RibbonGroup添加 QCheckBox:

 QCheckBox* pCheck = new QCheckBox(tr("Check"));
  pCheck->setToolTip(tr("Check"));
 groupClipboard->addWidget(pCheck);
 connect(pCheck, SIGNAL(stateChanged(int)), this, SLOT(checkClick(int)));

点击事件:

protected slots:
    void checkClick(int state);

void QRibbonDemo::checkClick(int state)
{
    QMessageBox messageBox(QMessageBox::Information, windowTitle(),
        QLatin1String(""), QMessageBox::Ok, this);
    messageBox.setInformativeText(QLatin1String("check click."));
    messageBox.exec();
}

RibbonGroup添加QCheckBox_第1张图片

RibbonGroup添加QCheckBox_第2张图片

你可能感兴趣的:(QT,c++,Ribbon,QCheckBox)