本文整理汇总了C++中QRadioButton::text方法的典型用法代码示例。如果您正苦于以下问题:C++ QRadioButton::text方法的具体用法?C++ QRadioButton::text怎么用?C++ QRadioButton::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRadioButton
的用法示例。
在下文中一共展示了QRadioButton::text方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeCondition
void btEditorNodeType::changeCondition(bool state)
{
qRegisterMetaType<btParallelConditions>("btParallelConditions");
QRadioButton * radioButton = qobject_cast<QRadioButton*>(QObject::sender());
foreach(const QString &name, this->parentNode()->parentNode()->type()->dynamicPropertyNames())
{
if(this->parentNode()->parentNode()->type()->property(name.toUtf8()).type() == QVariant::UserType && name == "conditions")
{
btParallelConditions list = this->parentNode()->parentNode()->type()->property(name.toUtf8()).value<btParallelConditions>();
double value = 0;
if(radioButton->text() == "Succeeded")
{
value = 1;
}
else if(radioButton->text() == "Failed")
{
value = 0;
}
else
{
value = -1;
}
list.parallelConditions[this->parentNode()->parentNode()->children().indexOf(this->parentNode())] = value;
QVariant v;
v.setValue(list);
this->parentNode()->parentNode()->type()->setProperty(name.toUtf8(), v);
break;
}
}
}
示例2: getSelectedPortName
// Figure out which port was selected and return it, or nothing if none are
QString ChoosePortDialog::getSelectedPortName()
{
QListIterator<QRadioButton*> i(m_portButtonList);
while(i.hasNext()) {
QRadioButton *button = i.next();
if(button->isChecked())
return button->text();
}
return QString();
}
示例3: updateAddresses
void SettingsWidget::updateAddresses(const Protos::Common::Interface& interfaceMess, QWidget* container)
{
QVBoxLayout* layout = container->findChild<QVBoxLayout*>();
if (!layout)
{
layout = new QVBoxLayout(container);
QMargins margins = layout->contentsMargins();
margins.setTop(3);
layout->setContentsMargins(margins);
}
QList<QRadioButton*> addressesNotUpdated = container->findChildren<QRadioButton*>();
for (int i = 0; i < interfaceMess.address_size(); i++)
{
const QString& addresseName = Common::ProtoHelper::getStr(interfaceMess.address(i), &Protos::Common::Interface::Address::address);
for (QListIterator<QRadioButton*> j(container->findChildren<QRadioButton*>()); j.hasNext();)
{
QRadioButton* addressButton = j.next();
if (addressButton->text() == addresseName)
{
addressesNotUpdated.removeOne(addressButton);
if (interfaceMess.address(i).listened())
addressButton->setChecked(true);
goto nextAddress;
}
}
{
// Address not found -> add a new one.
QRadioButton* newAddressButton = new QRadioButton(addresseName, container);
this->ui->grpAddressesToListenTo->addButton(newAddressButton);
if (interfaceMess.address(i).listened())
newAddressButton->setChecked(true);
layout->addWidget(newAddressButton);
}
nextAddress:
;
}
// Remove the non-existant addresses.
for (QListIterator<QRadioButton*> i(container->findChildren<QRadioButton*>()); i.hasNext();)
{
QRadioButton* current = i.next();
if (addressesNotUpdated.contains(current))
{
layout->removeWidget(current);
this->ui->grpAddressesToListenTo->removeButton(current);
delete current;
}
}
}
示例4: buildRadioButton
static inline
QRadioButton* buildRadioButton(QString text,
QString icon,
int mode,
QGroupBox *groupBox,
QHBoxLayout *hbox,
LogWidgetModel *m_viewmodel)
{
QRadioButton *build = new QRadioButton(text, groupBox);
build->setIcon(QIcon(QString(":/in/%0").arg(icon)));
build->setProperty("mode", mode);
build->setToolTip(build->text());
hbox->addWidget(build);
QObject::connect(build, SIGNAL(toggled(bool)), m_viewmodel, SLOT(changeMode(bool)));
return build;
}
示例5: slotRadioChanged
void Motion::slotRadioChanged()
{
QRadioButton* button = dynamic_cast<QRadioButton*>(sender());
if (button)
{
QString str = button->text();
if (!str.compare("OutQuadMotion"))
m_pMotion->setMotion<osgAnimation::OutQuadMotion>()
;
else if (!str.compare("InQuadMotion"))
m_pMotion->setMotion<osgAnimation::InQuadMotion>()
;
else if (!str.compare("InOutQuadMotion"))
m_pMotion->setMotion<osgAnimation::InOutQuadMotion>()
;
else if (!str.compare("OutCubicMotion"))
m_pMotion->setMotion<osgAnimation::OutCubicMotion>()
;
else if (!str.compare("InCubicMotion"))
m_pMotion->setMotion<osgAnimation::InCubicMotion>()
;
else if (!str.compare("InOutCubicMotion"))
m_pMotion->setMotion<osgAnimation::InOutCubicMotion>()
;
else if (!str.compare("OutQuartMotion"))
m_pMotion->setMotion<osgAnimation::OutQuartMotion>()
;
else if (!str.compare("InQuartMotion"))
m_pMotion->setMotion<osgAnimation::InQuartMotion>()
;
else if (!str.compare("InOutQuartMotion"))
m_pMotion->setMotion<osgAnimation::InOutQuartMotion>()
;
else if (!str.compare("OutBounceMotion"))
m_pMotion->setMotion<osgAnimation::OutBounceMotion>()
;
else if (!str.compare("InBounceMotion"))
m_pMotion->setMotion<osgAnimation::InBounceMotion>()
;
else if (!str.compare("InOutBounceMotion"))
m_pMotion->setMotion<osgAnimation::InOutBounceMotion>()
;
else if (!str.compare("OutElasticMotion"))
m_pMotion->setMotion<osgAnimation::OutElasticMotion>()
;
else if (!str.compare("InElasticMotion"))
m_pMotion->setMotion<osgAnimation::InElasticMotion>()
;
else if (!str.compare("InOutElasticMotion"))
m_pMotion->setMotion<osgAnimation::InOutElasticMotion>()
;
else if (!str.compare("OutSineMotion"))
m_pMotion->setMotion<osgAnimation::OutSineMotion>()
;
else if (!str.compare("InSineMotion"))
m_pMotion->setMotion<osgAnimation::InSineMotion>()
;
else if (!str.compare("InOutSineMotion"))
m_pMotion->setMotion<osgAnimation::InOutSineMotion>()
;
else if (!str.compare("OutBackMotion"))
m_pMotion->setMotion<osgAnimation::OutBackMotion>()
;
else if (!str.compare("InBackMotion"))
m_pMotion->setMotion<osgAnimation::InBackMotion>()
;
else if (!str.compare("InOutBackMotion"))
m_pMotion->setMotion<osgAnimation::InOutBackMotion>()
;
else if (!str.compare("OutCircMotion"))
m_pMotion->setMotion<osgAnimation::OutCircMotion>()
;
else if (!str.compare("InCircMotion"))
m_pMotion->setMotion<osgAnimation::InCircMotion>()
;
else if (!str.compare("InOutCircMotion"))
//.........这里部分代码省略.........
示例6: radioSelection
QString DataSerieDialog::radioSelection(QGroupBox *groupBox)
{
QString selection;
QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(groupBox->layout());
Q_ASSERT(layout);
for (int i(0); i < layout->count(); i++) {
QLayoutItem *item = layout->itemAt(i);
Q_ASSERT(item);
QRadioButton *radio = qobject_cast<QRadioButton *>(item->widget());
Q_ASSERT(radio);
if (radio->isChecked()) {
selection = radio->text();
break;
}
}
qDebug() << "radioSelection: " << selection;
return selection;
}
示例7: Handle
void ItemHandlerRadio::Handle (const QDomElement& item, QWidget *pwidget)
{
QGridLayout *lay = qobject_cast<QGridLayout*> (pwidget->layout ());
RadioGroup *group = new RadioGroup (XSD_);
group->setObjectName (item.attribute ("property"));
QStringList searchTerms;
QDomElement option = item.firstChildElement ("option");
while (!option.isNull ())
{
QRadioButton *button = new QRadioButton (XSD_->GetLabel (option));
searchTerms << button->text ();
XSD_->SetTooltip (button, option);
button->setObjectName (option.attribute ("name"));
group->AddButton (button,
option.hasAttribute ("default") &&
option.attribute ("default") == "true");
option = option.nextSiblingElement ("option");
}
QVariant value = XSD_->GetValue (item);
connect (group,
SIGNAL (valueChanged ()),
this,
SLOT (updatePreferences ()));
QGroupBox *box = new QGroupBox (XSD_->GetLabel (item));
QVBoxLayout *layout = new QVBoxLayout ();
box->setLayout (layout);
layout->addWidget (group);
searchTerms << box->title ();
group->setProperty ("ItemHandler", QVariant::fromValue<QObject*> (this));
group->setProperty ("SearchTerms", searchTerms);
lay->addWidget (box, lay->rowCount (), 0);
}
示例8: if
bool
StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container)
{
setWidget(w, container);
// m_container = container;
if(classname == "KLineEdit")
{
KLineEdit *lineedit = static_cast<KLineEdit*>(w);
createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true);
return true;
}
else if(classname == "QLabel")
{
QLabel *label = static_cast<QLabel*>(w);
if(label->textFormat() == RichText)
{
//m_widget = w;
// setWidget(w, container);
editText();
}
else
createEditor(classname, label->text(), label, container, label->geometry(), label->alignment());
return true;
}
else if(classname == "KPushButton")
{
KPushButton *push = static_cast<KPushButton*>(w);
QRect r = w->style().subRect(QStyle::SR_PushButtonContents, w);
QRect editorRect = QRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height());
//r.setX(r.x() + 5);
//r.setY(r.y() + 5);
//r.setWidth(r.width()-10);
//r.setHeight(r.height() - 10);
createEditor(classname, push->text(), push, container, editorRect, Qt::AlignCenter, false, false, Qt::PaletteButton);
return true;
}
else if(classname == "QRadioButton")
{
QRadioButton *radio = static_cast<QRadioButton*>(w);
QRect r = w->style().subRect(QStyle::SR_RadioButtonContents, w);
QRect editorRect = QRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height());
createEditor(classname, radio->text(), radio, container, editorRect, Qt::AlignAuto);
return true;
}
else if(classname == "QCheckBox")
{
QCheckBox *check = static_cast<QCheckBox*>(w);
//QRect r(check->geometry());
//r.setX(r.x() + 20);
QRect r = w->style().subRect(QStyle::SR_CheckBoxContents, w);
QRect editorRect = QRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height());
createEditor(classname, check->text(), check, container, editorRect, Qt::AlignAuto);
return true;
}
else if((classname == "KComboBox") || (classname == "KListBox"))
{
QStringList list;
if(classname == "KListBox")
{
KListBox *listbox = (KListBox*)w;
for(uint i=0; i < listbox->count(); i++)
list.append(listbox->text(i));
}
else if(classname == "KComboBox")
{
KComboBox *combo = (KComboBox*)w;
for(int i=0; i < combo->count(); i++)
list.append(combo->text(i));
}
if(editList(w, list))
{
if(classname == "KListBox")
{
((KListBox*)w)->clear();
((KListBox*)w)->insertStringList(list);
}
else if(classname == "KComboBox")
{
((KComboBox*)w)->clear();
((KComboBox*)w)->insertStringList(list);
}
}
return true;
}
else if((classname == "KTextEdit") || (classname == "KDateTimeWidget") || (classname == "KTimeWidget") ||
(classname == "KDateWidget") || (classname == "KIntSpinBox")) {
disableFilter(w, container);
return true;
}
return false;
}
示例9: _OnClickedRefresh
void UrlGeneratorJY::_OnClickedRefresh()
{
QRadioButton* rb = (QRadioButton*)sender();
_lblRef->setText( rb->text() );
}
示例10: saveCoreSettings
/**
* Send the settings to the core. A connection to a core must be established.
*/
void SettingsWidget::saveCoreSettings()
{
if (!this->getAtLeastOneState)
return;
Protos::GUI::CoreSettings settings;
Common::ProtoHelper::setStr(settings, &Protos::GUI::CoreSettings::set_nick, this->ui->txtNick->text());
settings.set_enable_integrity_check(this->ui->chkEnableIntegrityCheck->isChecked());
for (QListIterator<Common::SharedDir> i(this->sharedDirsModel.getDirs()); i.hasNext();)
Common::ProtoHelper::addRepeatedStr(*settings.mutable_shared_directories(), &Protos::GUI::CoreSettings::SharedDirectories::add_dir, i.next().path);
if (this->ui->radIPv6->isChecked())
settings.set_listen_any(Protos::Common::Interface::Address::IPv6);
else if (this->ui->radIPv4->isChecked())
settings.set_listen_any(Protos::Common::Interface::Address::IPv4);
else
{
for (QListIterator<QRadioButton*> i(this->ui->grpInterfaces->findChildren<QRadioButton*>()); i.hasNext();)
{
QRadioButton* button = i.next();
if (button->isChecked())
{
Common::ProtoHelper::setStr(settings, &Protos::GUI::CoreSettings::set_listen_address, button->text());
break;
}
}
}
this->coreConnection->setCoreSettings(settings);
}