本文整理汇总了C++中QRadioButton::property方法的典型用法代码示例。如果您正苦于以下问题:C++ QRadioButton::property方法的具体用法?C++ QRadioButton::property怎么用?C++ QRadioButton::property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRadioButton
的用法示例。
在下文中一共展示了QRadioButton::property方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LayerSelected
void QMwMaterialLayersWidget::LayerSelected()
{
QRadioButton *sender = (QRadioButton*)QObject::sender();
int layerIndex = sender->property("layerIndex").toInt();
this->selectedLayerIndex = layerIndex;
}
示例2: fillInMetadata
bool PEUtils::fillInMetadata(int senderIndex, QWidget * parent, ConnectorMetadata & cmd)
{
bool result = false;
QList<QWidget *> widgets = parent->findChildren<QWidget *>();
foreach (QWidget * widget, widgets) {
bool ok;
int index = widget->property("index").toInt(&ok);
if (!ok) continue;
if (index != senderIndex) continue;
QString type = widget->property("type").toString();
if (type == "name") {
QLineEdit * lineEdit = qobject_cast<QLineEdit *>(widget);
if (lineEdit == NULL) continue;
cmd.connectorName = lineEdit->text();
cmd.connectorID = widget->property("id").toString();
result = true;
}
else if (type == "radio") {
QRadioButton * radioButton = qobject_cast<QRadioButton *>(widget);
if (radioButton == NULL) continue;
if (!radioButton->isChecked()) continue;
cmd.connectorType = (Connector::ConnectorType) radioButton->property("value").toInt();
}
else if (type == "description") {
QLineEdit * lineEdit = qobject_cast<QLineEdit *>(widget);
if (lineEdit == NULL) continue;
cmd.connectorDescription = lineEdit->text();
}
}
示例3: ChangeLanguage
void MainWindow::ChangeLanguage()
{
std::clog<<"MainWindow::ChangeLanguage()"<<std::endl;
QList<QRadioButton*> list = ui->groupBox->findChildren<QRadioButton*>();
for(int i=0;i<list.size();i++)
{
QRadioButton* rb = list.at(i);
if(rb->isChecked())
{
lang->ChangeLanguage(rb->property(("lang_file")).toString()); // lang_file is dynamic property
break;
}
}
ui->retranslateUi(this);
}