当前位置: 首页>>代码示例>>C++>>正文


C++ QCheckBox::objectName方法代码示例

本文整理汇总了C++中QCheckBox::objectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::objectName方法的具体用法?C++ QCheckBox::objectName怎么用?C++ QCheckBox::objectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QCheckBox的用法示例。


在下文中一共展示了QCheckBox::objectName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:floreks,项目名称:D3Helper,代码行数:8,代码来源:layoutmanager.cpp

示例2: onWritePinChange

// _____________________________________________________________________
void CRaspiGPIO::onWritePinChange(bool state)
{
    QCheckBox* checkbox = qobject_cast<QCheckBox*>(sender());
    if( checkbox != NULL )
    {
        QString objectName = checkbox->objectName();
        bool ok;
        unsigned int gpio_num = objectName.remove(PREFIX_CHECKBOX_WRITE).toInt(&ok);
        if (ok) {
            writePin(gpio_num, state);
        }
    }
}
开发者ID:CRLG,项目名称:LABOTBOX,代码行数:14,代码来源:CRaspiGPIO.cpp

示例3: while

void MesytecMadc32UI::applySettings()
{
    applyingSettings = true;

    QList<QGroupBox*> gbs = findChildren<QGroupBox*>();
    if(!gbs.empty())
    {
        QList<QGroupBox*>::const_iterator it = gbs.begin();
        while(it != gbs.end())
        {
            QGroupBox* w = (*it);
            for(int ch=0; ch < MADC32V2_NUM_CHANNELS; ch++) {
                if(w->objectName() == tr("enable_channel%1").arg(ch)) w->setChecked(module->conf_.enable_channel[ch]);
            }
            it++;
        }
    }
    QList<QCheckBox*> cbs = findChildren<QCheckBox*>();
    if(!cbs.empty())
    {
        QList<QCheckBox*>::const_iterator it = cbs.begin();
        while(it != cbs.end())
        {
            QCheckBox* w = (*it);

            if(w->objectName() == "enable_multi_event_send_different_eob_marker") w->setChecked(module->conf_.enable_multi_event_send_different_eob_marker);
            if(w->objectName() == "enable_multi_event_compare_with_max_transfer_data") w->setChecked(module->conf_.enable_multi_event_compare_with_max_transfer_data);
            if(w->objectName() == "enable_adc_override") w->setChecked(module->conf_.enable_adc_override);
            if(w->objectName() == "enable_switch_off_sliding_scale") w->setChecked(module->conf_.enable_switch_off_sliding_scale);
            if(w->objectName() == "enable_skip_out_of_range") w->setChecked(module->conf_.enable_skip_out_of_range);
            if(w->objectName() == "enable_ignore_thresholds") w->setChecked(module->conf_.enable_ignore_thresholds);
            if(w->objectName() == "enable_termination_input_gate0") w->setChecked(module->conf_.enable_termination_input_gate0);
            if(w->objectName() == "enable_termination_input_fast_clear") w->setChecked(module->conf_.enable_termination_input_fast_clear);
            if(w->objectName() == "enable_external_time_stamp_reset") w->setChecked(module->conf_.enable_external_time_stamp_reset);

            it++;
        }
    }
    QList<QComboBox*> cbbs = findChildren<QComboBox*>();
    if(!cbbs.empty())
    {
        QList<QComboBox*>::const_iterator it = cbbs.begin();
        while(it != cbbs.end())
        {
            QComboBox* w = (*it);
            //printf("Found combobox with the name %s\n",w->objectName().toStdString().c_str());
            if(w->objectName() == "addr_source") w->setCurrentIndex(module->conf_.addr_source);
            if(w->objectName() == "multi_event_mode") w->setCurrentIndex(module->conf_.multi_event_mode);
            if(w->objectName() == "vme_mode") w->setCurrentIndex(module->conf_.vme_mode);
            if(w->objectName() == "data_length_format") w->setCurrentIndex(module->conf_.data_length_format);
            if(w->objectName() == "time_stamp_source") w->setCurrentIndex(module->conf_.time_stamp_source);
            if(w->objectName() == "adc_resolution") w->setCurrentIndex(module->conf_.adc_resolution);
            if(w->objectName() == "output_format") w->setCurrentIndex(module->conf_.output_format);
            if(w->objectName() == "gate_generator_mode") w->setCurrentIndex(module->conf_.gate_generator_mode);
            if(w->objectName() == "ecl_gate1_mode") w->setCurrentIndex(module->conf_.ecl_gate1_mode);
            if(w->objectName() == "ecl_fclear_mode") w->setCurrentIndex(module->conf_.ecl_fclear_mode);
            if(w->objectName() == "ecl_busy_mode") w->setCurrentIndex(module->conf_.ecl_busy_mode);
            if(w->objectName() == "nim_gate1_mode") w->setCurrentIndex(module->conf_.nim_gate1_mode);
            if(w->objectName() == "nim_fclear_mode") w->setCurrentIndex(module->conf_.nim_fclear_mode);
            if(w->objectName() == "input_range") {
                switch (module->conf_.input_range){
                case MesytecMadc32ModuleConfig::ir4V: w->setCurrentIndex(0); break;
                case MesytecMadc32ModuleConfig::ir8V: w->setCurrentIndex(1); break;
                case MesytecMadc32ModuleConfig::ir10V: w->setCurrentIndex(2); break;
                default: w->setCurrentIndex(2); break;
                }
            }
            if(w->objectName() == "marking_type") w->setCurrentIndex(module->conf_.marking_type);
            if(w->objectName() == "bank_operation") w->setCurrentIndex(module->conf_.bank_operation);
            if(w->objectName() == "test_pulser_mode") w->setCurrentIndex(module->conf_.test_pulser_mode);
            it++;
        }
    }
    QList<QSpinBox*> csb = findChildren<QSpinBox*>();
    if(!csb.empty())
    {
        QList<QSpinBox*>::const_iterator it = csb.begin();
        while(it != csb.end())
        {
            QSpinBox* w = (*it);
            //printf("Found spinbox with the name %s\n",w->objectName().toStdString().c_str());
            if(w->objectName() == "irq_level") w->setValue(module->conf_.irq_level);
            if(w->objectName() == "irq_vector") w->setValue(module->conf_.irq_vector);
            if(w->objectName() == "irq_threshold") w->setValue(module->conf_.irq_threshold);
            if(w->objectName() == "base_addr_register") w->setValue(module->conf_.base_addr_register);
            if(w->objectName() == "time_stamp_divisor") w->setValue(module->conf_.time_stamp_divisor);
            if(w->objectName() == "max_transfer_data") w->setValue(module->conf_.max_transfer_data);
            if(w->objectName() == "rc_module_id_read") w->setValue(module->conf_.rc_module_id_read);
            if(w->objectName() == "rc_module_id_write") w->setValue(module->conf_.rc_module_id_write);

            for(int ch=0; ch<2; ch++)
            {
                if(w->objectName() == tr("hold_delay_%1").arg(ch)) w->setValue(module->conf_.hold_delay[ch]);
                if(w->objectName() == tr("hold_width_%1").arg(ch)) w->setValue(module->conf_.hold_width[ch]);
            }
            for(int ch=0; ch<MADC32V2_NUM_CHANNELS; ch++)
            {
                if(w->objectName() == tr("thresholds%1").arg(ch)) w->setValue(module->conf_.thresholds[ch]);
            }
            it++;
//.........这里部分代码省略.........
开发者ID:mojca,项目名称:gecko,代码行数:101,代码来源:mesytecMadc32ui.cpp


注:本文中的QCheckBox::objectName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。