本文整理汇总了C++中QCheckBox::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setObjectName方法的具体用法?C++ QCheckBox::setObjectName怎么用?C++ QCheckBox::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setObjectName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initFeatureGroup
void PatternAnalysisWizard::initFeatureGroup(void)
{
if(!m_table) return;
featureGroup->setExclusive(false);
bool zernike_added = false;
for (int c=0; c<m_table->GetNumberOfColumns(); ++c)
{
const char * name = m_table->GetColumnName(c);
std::string current_name = name;
if( current_name.find("train")!=std::string::npos || current_name.find("prediction")!=std::string::npos || current_name.find("confidence")!=std::string::npos || current_name.find("time")!=std::string::npos)
continue;
if( current_name.find("Zern")!=std::string::npos)
{
if(zernike_added == false)
{
QCheckBox * check = new QCheckBox("zernike moments");
check->setObjectName("zernikeMoments");
check->setChecked(true);
featureGroup->addButton(check, 0);
zernike_added = true;
}
continue;
}
QCheckBox * check = new QCheckBox(QString(name));
check->setObjectName(QString(name));
check->setChecked(true);
featureGroup->addButton(check, c);
}
}
示例2: disabledFeatureGroup
void PatternAnalysisWizard::disabledFeatureGroup(void)
{
if(!m_table) return;
featureGroup->setExclusive(false);
bool zernike_added = false;
for (int d=0; d<mod_table->GetNumberOfColumns(); ++d)
{
const char * mod_name = mod_table->GetColumnName(d);
std::string model_name = mod_name;
if(model_name.find("Zern")!=std::string::npos)
{
if(zernike_added == false)
{
QCheckBox * check = new QCheckBox("zernike moments");
check->setObjectName("zernikeMoments");
check->setCheckable(false);
featureGroup->addButton(check);
zernike_added = true;
}
continue;
}
QCheckBox * check = new QCheckBox(QString(mod_name));
check->setObjectName(mod_name);
check->setCheckable(false);
featureGroup->addButton(check);
}
}
示例3: createLayout
void DkAdvancedPreference::createLayout() {
// load RAW radio buttons
QVector<QRadioButton*> loadRawButtons;
loadRawButtons.resize(DkSettings::raw_thumb_end);
loadRawButtons[DkSettings::raw_thumb_always] = new QRadioButton(tr("Always Load JPG if Embedded"), this);
loadRawButtons[DkSettings::raw_thumb_if_large] = new QRadioButton(tr("Load JPG if it Fits the Screen Resolution"), this);
loadRawButtons[DkSettings::raw_thumb_never] = new QRadioButton(tr("Always Load RAW Data"), this);
// check wrt the current settings
loadRawButtons[Settings::param().resources().loadRawThumb]->setChecked(true);
QButtonGroup* loadRawButtonGroup = new QButtonGroup(this);
loadRawButtonGroup->setObjectName("loadRaw");
loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_always], DkSettings::raw_thumb_always);
loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_if_large], DkSettings::raw_thumb_if_large);
loadRawButtonGroup->addButton(loadRawButtons[DkSettings::raw_thumb_never], DkSettings::raw_thumb_never);
QCheckBox* cbFilterRaw = new QCheckBox(tr("Apply Noise Filtering to RAW Images"), this);
cbFilterRaw->setObjectName("filterRaw");
cbFilterRaw->setToolTip(tr("If checked, a noise filter is applied which reduced color noise"));
cbFilterRaw->setChecked(Settings::param().resources().filterRawImages);
DkGroupWidget* loadRawGroup = new DkGroupWidget(tr("RAW Loader Settings"), this);
loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_always]);
loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_if_large]);
loadRawGroup->addWidget(loadRawButtons[DkSettings::raw_thumb_never]);
loadRawGroup->addSpace();
loadRawGroup->addWidget(cbFilterRaw);
// file loading
QCheckBox* cbSaveDeleted = new QCheckBox(tr("Ask to Save Deleted Files"), this);
cbSaveDeleted->setObjectName("saveDeleted");
cbSaveDeleted->setToolTip(tr("If checked, nomacs asked to save files which were deleted by other applications"));
cbSaveDeleted->setChecked(Settings::param().global().askToSaveDeletedFiles);
QCheckBox* cbIgnoreExif = new QCheckBox(tr("Ignore Exif Orientation when Loading"), this);
cbIgnoreExif->setObjectName("ignoreExif");
cbIgnoreExif->setToolTip(tr("If checked, images are NOT rotated with respect to their Exif orientation"));
cbIgnoreExif->setChecked(Settings::param().metaData().ignoreExifOrientation);
QCheckBox* cbSaveExif = new QCheckBox(tr("Save Exif Orientation"), this);
cbSaveExif->setObjectName("saveExif");
cbSaveExif->setToolTip(tr("If checked, orientation is written to the Exif rather than rotating the image Matrix\n") +
tr("NOTE: this allows for rotating JPGs without loosing information."));
cbSaveExif->setChecked(Settings::param().metaData().saveExifOrientation);
DkGroupWidget* loadFileGroup = new DkGroupWidget(tr("File Loading/Saving"), this);
loadFileGroup->addWidget(cbSaveDeleted);
loadFileGroup->addWidget(cbIgnoreExif);
loadFileGroup->addWidget(cbSaveExif);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(loadRawGroup);
layout->addWidget(loadFileGroup);
}
示例4: wizard
void
PluginsPage::initializePage()
{
#ifdef Q_OS_WIN32
QList<IPluginInfo*> supportedPlugins = wizard()->pluginList()->supportedList();
foreach( IPluginInfo* plugin, supportedPlugins )
{
QCheckBox* cb;
m_pluginsLayout->addWidget( cb = new QCheckBox( plugin->name(), this ));
connect( cb, SIGNAL(toggled(bool)), plugin, SLOT(install(bool)));
connect( cb, SIGNAL(toggled(bool)), SLOT(checkPluginsSelected()));
cb->setObjectName( plugin->id() );
cb->setChecked( plugin->isAppInstalled() );
cb->style()->polish( cb );
if ( plugin->isInstalled() )
{
if ( plugin->version() > plugin->installedVersion() )
{
cb->setChecked( true );
cb->setText( cb->text() + " " + tr( "(newer version)" ));
}
else
{
cb->setChecked( false );
cb->setText( cb->text() + " " + tr( "(Plugin installed tick to reinstall)" ));
}
}
}
示例5: slot_LoadFinished
//加载完成
void SearchThread::slot_LoadFinished( QNetworkReply *replay )
{
QTextCodec *codec = QTextCodec::codecForName("utf8"); //转换成utf8编码格式
QString searchStr = codec->toUnicode(replay->readAll());
if (searchStr == "")
{
emit sig_SearchTimeout(); //搜索超时
return;
}
searchStr = QUrl::fromPercentEncoding(searchStr.toAscii()); //百分比编码
//解析Json
QJson::Parser parser;
bool ok;
QVariantMap result = parser.parse(searchStr.toUtf8(), &ok).toMap();
if (!ok)
{
qDebug() << "转换成QVariantMap失败";
return;
}
//搜索到的数量
m_nMusicNum = result["total"].toInt();
emit sig_SearchNum(m_nMusicNum);
//得到结果数组
QVariantList resultList = result["results"].toList();
foreach (QVariant var, resultList)
{
QVariantMap resultMap = var.toMap(); //得到每一项的map
//歌曲名
QCheckBox *musicNameCheckBox = new QCheckBox(resultMap["song_name"].toString());
musicNameCheckBox->setObjectName(tr("musicNameCheckBox"));
musicNameCheckBox->setToolTip(resultMap["song_name"].toString());
musicNameCheckBox->setFont(QFont("微软雅黑", 10));
musicNameCheckBox->setStyleSheet("QCheckBox{color:white;}"
"QCheckBox::indicator{width:10px;height:10px;border: 1px solid white;border-radius:2px}"
"QCheckBox::indicator:checked {image: url(:/app/images/checked2.png);}");
//艺人
QTableWidgetItem *artistItem = new QTableWidgetItem(resultMap["artist_name"].toString());
artistItem->setTextAlignment(Qt::AlignCenter);
artistItem->setToolTip(resultMap["artist_name"].toString());
artistItem->setFont(QFont("微软雅黑", 10));
//专辑
QTableWidgetItem *albumItem = new QTableWidgetItem("《" + resultMap["album_name"].toString() + "》");
albumItem->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
albumItem->setToolTip("《" + resultMap["album_name"].toString() + "》");
albumItem->setFont(QFont("微软雅黑", 10));
//插入播放列表
int currentRows = m_searchList->rowCount();//返回列表中的行数
m_searchList->insertRow(currentRows);//从播放列表中的当前行插入
m_searchList->setCellWidget(currentRows, 0, musicNameCheckBox);
m_searchList->setItem(currentRows, 1, artistItem);
m_searchList->setItem(currentRows, 2, albumItem);
}
示例6: copyCheckBox
QCheckBox* LayoutManager::copyCheckBox(QObject* obj) {
QCheckBox *oldCheckBox = qobject_cast<QCheckBox*>(obj);
QCheckBox *newCheckBox = new QCheckBox();
newCheckBox->setText(oldCheckBox->text());
newCheckBox->setObjectName(oldCheckBox->objectName() + " " + QString::number(keyLayouts.size()));
return newCheckBox;
}
示例7: createEditor
QWidget* CheckBoxListDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
// Create check box as our editor.
QCheckBox* editor = new QCheckBox(parent);
editor->setObjectName("checkBoxListItem");
connect(editor, SIGNAL(stateChanged(int)), this, SLOT(checkBoxStateChanged()));
return editor;
}
示例8: pl_checkbox_text
void TestQTestComplex::pl_checkbox_text()
{
QCheckBox *cb = new QCheckBox();
cb->setObjectName("cb");
cb->setText("Let's cause a memory leak!");
delete cb;
}
示例9: init
bool KvsObject_checkBox::init(KviKvsRunTimeContext *,KviKvsVariantList *)
{
QCheckBox * cb = new QCheckBox(parentScriptWidget());
cb->setObjectName(getName().toUtf8().data());
setObject(cb, true);
connect(cb,SIGNAL(toggled(bool)),this,SLOT(toggled(bool)));
connect(widget(),SIGNAL(clicked()),this,SLOT(slotClicked()));
return true;
}
示例10: QGroupBox
QWidget *ServerDialog::createPackageTab() {
extension_group = new QButtonGroup;
extension_group->setExclusive(false);
QStringList extensions = Sanguosha->getExtensions();
QSet<QString> ban_packages = Config.BanPackages.toSet();
QGroupBox *box1 = new QGroupBox(tr("General package"));
QGroupBox *box2 = new QGroupBox(tr("Card package"));
QVBoxLayout *layout1 = new QVBoxLayout;
QVBoxLayout *layout2 = new QVBoxLayout;
box1->setLayout(layout1);
box2->setLayout(layout2);
foreach(QString extension, extensions) {
const Package *package = Sanguosha->findChild<const Package *>(extension);
if(package == NULL)
continue;
QCheckBox *checkbox = new QCheckBox;
checkbox->setObjectName(extension);
checkbox->setText(Sanguosha->translate(extension));
checkbox->setChecked(! ban_packages.contains(extension));
extension_group->addButton(checkbox);
switch(package->getType()) {
case Package::GeneralPack: {
layout1->addWidget(checkbox);
break;
}
case Package::CardPack: {
layout2->addWidget(checkbox);
break;
}
default:
break;
}
}
layout1->addStretch();
layout2->addStretch();
QWidget *widget = new QWidget;
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(box1);
layout->addWidget(box2);
widget->setLayout(layout);
return widget;
}
示例11: createWidgetForBool
QWidget* PropertyEditor::createWidgetForBool(const QString& name, bool value, const QString &detail, QWidget* parent)
{
mProperties[name] = value;
QCheckBox *box = new QCheckBox(QObject::tr(name.toUtf8().constData()), parent);
if (!detail.isEmpty())
box->setToolTip(detail);
box->setObjectName(name);
box->setChecked(value);
connect(box, SIGNAL(clicked(bool)), SLOT(onBoolChange(bool)));
return box;
}
示例12: addNewItem
void MainWindow::addNewItem()
{
// copied from ui_itemFrame.h
QHBoxLayout *itemLayout = new QHBoxLayout();
itemLayout->setObjectName(QString::fromUtf8("itemLayout"));
itemLayout->setSizeConstraint(QLayout::SetFixedSize);
QCheckBox *haveFoundCheckBox = new QCheckBox();
haveFoundCheckBox->setObjectName(QString::fromUtf8("haveFoundCheckBox"));
haveFoundCheckBox->setMinimumHeight(30);
itemLayout->addWidget(haveFoundCheckBox);
QLineEdit *amountBox = new QLineEdit();
amountBox->setObjectName(QString::fromUtf8("amountBox"));
amountBox->setMaximumSize(QSize(80, 16777215));
amountBox->setMinimumHeight(38);
amountBox->setMinimumWidth(100);
itemLayout->addWidget(amountBox);
QLineEdit *itemName = new QLineEdit();
itemName->setObjectName(QString::fromUtf8("itemName"));
itemName->setMinimumHeight(38);
itemName->setMinimumWidth(300);
itemLayout->addWidget(itemName);
QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
itemLayout->addItem(horizontalSpacer);
QPushButton *deleteButton = new QPushButton();
deleteButton->setObjectName(QString::fromUtf8("deleteButton"));
deleteButton->setText("Remove");
deleteButton->setMinimumHeight(38);
//deleteButton->setCenterButtons(false);
itemLayout->addWidget(deleteButton);
// end of copied from ui_itemFrame.h
// Doesn't work atm?
//QObject::connect(deleteButton, SIGNAL(clicked(QAbstractButton*)), haveFoundCheckBox, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), amountBox, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), itemName, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), deleteButton, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), haveFoundCheckBox, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), itemLayout, SLOT(deleteLater()));
QObject::connect(deleteButton, SIGNAL(clicked()), this,SLOT(itemWasRemoved()));
ui->mainLayout->addLayout(itemLayout);
widgetsize+=80; // in principle should also reduce when removing item, need to create a slot...
ui->scrollAreaContents->setFixedHeight(widgetsize);
}
示例13: setupGui
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void QCheckboxDialog::setupGui()
{
QVBoxLayout* verticalLayout_2 = new QVBoxLayout(this);
foreach(QString str, m_List)
{
QCheckBox* cb = new QCheckBox(this);
cb->setText(str);
cb->setObjectName(str);
cb->setChecked(true);
verticalLayout_2->addWidget(cb);
m_WidgetMap.insert(str, cb);
}
示例14: QWidget
Content::Content(QWidget *parent) :
QWidget(parent)
{
//
VGroup1 = new QGroupBox(tr("Параметры"));
Param=new params();
verLayot1= new QVBoxLayout();
verLayot2= new QVBoxLayout();
for(int i=0; i<Param->getListofparam().length(); i++ )
{
param tec_name=Param->getListofparam()[i];
if(tec_name.type=="QCheckBox")
{
QCheckBox *Checkparam =new QCheckBox();
Checkparam->setText(tec_name.printValue);
Checkparam->setObjectName(tec_name.name);
verLayot1->addWidget(Checkparam);
connect(Checkparam,SIGNAL(stateChanged(int)),this,SLOT(SetParamCheckBox(int)));
}
if(tec_name.type=="QLineEdit")
{
QLineEdit *LineEdit =new QLineEdit();
LineEdit->setText(tec_name.printValue);
LineEdit->setObjectName(tec_name.name);
verLayot1->addWidget(LineEdit);
connect(LineEdit,SIGNAL(textChanged(QString)),this,SLOT(SetTextEdit(QString)));
}
if(tec_name.type=="QLabel")
{
QLabel *Labelparam=new QLabel();
Labelparam->setText(tec_name.printValue);
Labelparam->setObjectName(tec_name.name);
// connect(Param,SIGNAL(FolderChange(QString)),this,SLOT(SetLabelName(QString)));
verLayot2->addWidget(Labelparam);
}
}
示例15: initialize
void PreferencesDialog::initialize(PreferencesTab initialTab, const Persistence::Settings *settings, const QMap<QString, QString> &jamRecorders)
{
Q_UNUSED(initialTab);
this->settings = settings;
this->jamRecorders = jamRecorders;
this->jamRecorderCheckBoxes = QMap<QCheckBox *, QString>();
foreach(const QString &jamRecorder, jamRecorders.keys()) {
QCheckBox *myCheckBox = new QCheckBox(this);
myCheckBox->setObjectName(jamRecorder);
myCheckBox->setText(jamRecorders.value(jamRecorder));
ui->layoutRecorders->addWidget(myCheckBox);
jamRecorderCheckBoxes[myCheckBox] = jamRecorder;
}
setupSignals();
populateAllTabs();
}