本文整理汇总了C++中QCheckBox::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setAttribute方法的具体用法?C++ QCheckBox::setAttribute怎么用?C++ QCheckBox::setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectedToggled
void Qt4TargetSetupWidget::addBuildConfigurationInfo(const BuildConfigurationInfo &info, bool importing)
{
if (importing) {
if (!m_haveImported) {
// disable everything on first import
for (int i = 0; i < m_enabled.count(); ++i) {
m_enabled[i] = false;
m_checkboxes[i]->setChecked(false);
}
m_selected = 0;
}
m_haveImported = true;
}
int pos = m_pathChoosers.count();
m_enabled.append(true);
++m_selected;
m_infoList.append(info);
QCheckBox *checkbox = new QCheckBox;
checkbox->setText(Qt4BuildConfigurationFactory::buildConfigurationDisplayName(info));
checkbox->setChecked(m_enabled.at(pos));
checkbox->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_newBuildsLayout->addWidget(checkbox, pos * 2, 0);
Utils::PathChooser *pathChooser = new Utils::PathChooser();
pathChooser->setExpectedKind(Utils::PathChooser::Directory);
pathChooser->setPath(info.directory);
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(m_profile);
if (!version)
return;
pathChooser->setReadOnly(!version->supportsShadowBuilds() || importing);
m_newBuildsLayout->addWidget(pathChooser, pos * 2, 1);
QLabel *reportIssuesLabel = new QLabel;
reportIssuesLabel->setIndent(32);
m_newBuildsLayout->addWidget(reportIssuesLabel, pos * 2 + 1, 0, 1, 2);
reportIssuesLabel->setVisible(false);
connect(checkbox, SIGNAL(toggled(bool)),
this, SLOT(checkBoxToggled(bool)));
connect(pathChooser, SIGNAL(changed(QString)),
this, SLOT(pathChanged()));
m_checkboxes.append(checkbox);
m_pathChoosers.append(pathChooser);
m_reportIssuesLabels.append(reportIssuesLabel);
m_issues.append(false);
reportIssues(pos);
emit selectedToggled();
}