RibbonGroup添加QRadioButton:
QRadioButton * pRadio = new QRadioButton(tr("Radio"));
pRadio->setToolTip(tr("Radio"));
groupClipboard->addWidget(pRadio);
connect(pRadio, SIGNAL(clicked(bool)), this, SLOT(RadioClicked(bool)));
添加事件:
protected slots:
void RadioClicked(bool checked = false);
void QRibbonDemo::RadioClicked(bool checked)
{
QMessageBox messageBox(QMessageBox::Information, windowTitle(),
QLatin1String(""), QMessageBox::Ok, this);
messageBox.setInformativeText(QLatin1String("radio click."));
messageBox.exec();
}
效果如下: