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


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

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


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

示例1: setValue

void TUIToggleBitmapButton::setValue(int type, covise::TokenBuffer &tb)
{
    if (type == TABLET_BOOL)
    {
        char state;
        tb >> state;
        bool bState = (bool)state;
        QCheckBox *b = (QCheckBox *)widget;
        b->setChecked(bState);
        if (b->isChecked())
        {
            QPixmap pm(downName);

            if (pm.isNull())
                b->setText(downName);
            else
                b->setIcon(pm);
        }
        else
        {
            QPixmap pm(upName);
            if (pm.isNull())
                b->setText(upName);
            else
                b->setIcon(pm);
        }
    }
开发者ID:nixz,项目名称:covise,代码行数:27,代码来源:TUIToggleBitmapButton.cpp

示例2: 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)" ));
            }
        }
    }
开发者ID:Timmmm,项目名称:lastfm-desktop,代码行数:30,代码来源:PluginsPage.cpp

示例3: valueChanged

void TUIToggleBitmapButton::valueChanged(bool)
{
    QCheckBox *b = (QCheckBox *)widget;

    covise::TokenBuffer tb;
    tb << ID;
    if (b->isChecked())
    {
        tb << TABLET_ACTIVATED;
        QPixmap pm(downName);

        if (pm.isNull())
            b->setText(downName);
        else
            b->setIcon(pm);
    }
    else
    {
        tb << TABLET_DISACTIVATED;
        QPixmap pm(upName);
        if (pm.isNull())
            b->setText(upName);
        else
            b->setIcon(pm);
    }
    TUIMainWindow::getInstance()->send(tb);
}
开发者ID:nixz,项目名称:covise,代码行数:27,代码来源:TUIToggleBitmapButton.cpp

示例4: QWidget

VPiano::VPiano(QWidget *parent)
    : QWidget(parent)
{
    QVBoxLayout *layout = new QVBoxLayout;
    QCheckBox *chkFlats = new QCheckBox(this);
    QCheckBox *chkLabels = new QCheckBox(this);
    QCheckBox *chkRaw = new QCheckBox(this);
    QSlider *slider = new QSlider(Qt::Horizontal, this);
    chkFlats->setText("Use Flats");
    chkLabels->setText("Show Labels");
    chkRaw->setText("Raw Keyboard");
    slider->setRange(1, 127);
    slider->setValue(100);
    QHBoxLayout *hbox = new QHBoxLayout;
    hbox->setSpacing(10);
    hbox->addWidget(chkLabels);
    hbox->addWidget(chkFlats);
    hbox->addWidget(chkRaw);
    hbox->addWidget(new QLabel("Velocity", this));
    hbox->addWidget(slider);
    connect(chkFlats, SIGNAL(toggled(bool)), SLOT(useFlats(bool)));
    connect(chkLabels, SIGNAL(toggled(bool)), SLOT(showLabels(bool)));
    connect(chkRaw, SIGNAL(toggled(bool)), SLOT(rawKeyboard(bool)));
    connect(slider, SIGNAL(valueChanged(int)), SLOT(velocity(int)));
    layout->addLayout(hbox);

    m_piano = new PianoKeybd(this);  // base octave = 3, num. octaves = 5

    /* set a color for pressed keys (default is QPalette::Highlight) */
    m_piano->setKeyPressedColor(Qt::red);

    /* m_piano = new PianoKeybd(2, 7, this); // ctor. with base and num. octaves */
    /* m_piano->setRotation(270);   // vertical orientation */
    m_piano->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);

    // Option 1: use signals and slots to connect the note events and handler methods
    // connect(m_piano, SIGNAL(noteOn(int)), SLOT(noteOn(int)));
    // connect(m_piano, SIGNAL(noteOff(int)), SLOT(noteOff(int)));

    // Option 2: use a PianoHandler class to provide the handler methods
    m_piano->setPianoHandler(this);

    layout->addWidget(m_piano);
    layout->setSpacing(1);
    layout->setContentsMargins(2,2,2,2);
    setLayout(layout);
    m_time.start();
}
开发者ID:aasfalcon,项目名称:wexplorer,代码行数:48,代码来源:vpiano.cpp

示例5: SetDb

void PringKvitok::SetDb(db *mdb)
{
    myDB = mdb;
     ui->comboBox_groups->addItem("Выбрать все", "s_all");
    ui->comboBox_groups->addItem("Снять все", "d_all");
    QSqlQueryModel *groups = myDB->Query("SELECT * FROM groups WHERE id > 2");
    for(int i = 0; i < groups->rowCount(); i++){
         ui->comboBox_groups->addItem(groups->record(i).value("name").toString(), groups->record(i).value("id").toString());
    }

    childsCheckBox_map.clear();
   QString sql = "SELECT t0.id, t0.group_id, t0.fio,  t1.name AS group_name, t0.ls FROM childs t0";
    sql += " LEFT OUTER  JOIN groups  t1 ON t0.group_id = t1.id";
    QSqlQueryModel *childs = myDB->Query(sql);
    for(int i = 0; i < childs->rowCount(); i++){
          QString childs_id = childs->record(i).value("id").toString();
          ui->tW->insertRow(ui->tW->rowCount());
          ui->tW->setItem(ui->tW->rowCount() - 1, 1,new QTableWidgetItem(childs->record(i).value("fio").toString()));
          ui->tW->setItem(ui->tW->rowCount() - 1, 2,new QTableWidgetItem(childs->record(i).value("group_name").toString()));
          ui->tW->setItem(ui->tW->rowCount() - 1, 3,new QTableWidgetItem(childs_id));
          ui->tW->setItem(ui->tW->rowCount() - 1, 4,new QTableWidgetItem(childs->record(i).value("group_id").toString()));
          ui->tW->setItem(ui->tW->rowCount() - 1, 5,new QTableWidgetItem(childs->record(i).value("ls").toString()));
          QCheckBox *cb = new QCheckBox();
          cb->setText(childs_id);
          connect(cb , SIGNAL( toggled(bool) ), this, SLOT( on_childs_toggled(bool)) );
          childsCheckBox_map[childs_id] = cb;
          ui->tW->setCellWidget(ui->tW->rowCount() - 1, 0, cb);

     }
    delete groups;
    delete childs;

}
开发者ID:haltxz,项目名称:ds,代码行数:33,代码来源:pringkvitok.cpp

示例6: setDataToUi

void DrugEnginesPreferences::setDataToUi()
{
    // Get all IDrugEngine objects
    QList<DrugsDB::IDrugEngine *> engines = pluginManager()->getObjects<DrugsDB::IDrugEngine>();
    QGridLayout *scrollLayout = qobject_cast<QGridLayout*>(ui->scrollAreaWidgetContents->layout());
    scrollLayout->setSpacing(24);
    for(int i=0; i < engines.count(); ++i) {
        DrugsDB::IDrugEngine *engine = engines.at(i);
        // Create widget
//        QWidget *w = new QWidget(this);
//        QGridLayout *l = new QGridLayout(w);
//        w->setLayout(l);
//        l->setMargin(0);
        // with checkbox
        QCheckBox *box = new QCheckBox(this);
        box->setText(engine->shortName() + ", " + engine->name());
        box->setToolTip(engine->tooltip());
        box->setChecked(engine->isActive());
        box->setIcon(engine->icon());
        // and a small explanation
//        QTextBrowser *browser = new QTextBrowser(w);
//        browser->setText(engines.at(i));
        scrollLayout->addWidget(box, i, 0);
        connect(box, SIGNAL(clicked(bool)), engine, SLOT(setActive(bool)));
    }
    QSpacerItem *s = new QSpacerItem(20,20, QSizePolicy::Expanding, QSizePolicy::Expanding);
    scrollLayout->addItem(s, engines.count()+1, 0);
}
开发者ID:NyFanomezana,项目名称:freemedforms,代码行数:28,代码来源:drugenginespreferences.cpp

示例7: QDialog

EditContactEntryDialog::EditContactEntryDialog(data::ptr<data::ContactEntry> contactEntry, QList<data::ptr<data::ContactGroup>> contactGroups, QWidget* parent) :
    QDialog(parent),
    ui(new Ui::EditContactEntryDialog),
    m_contactEntry(contactEntry),
    m_contactGroups(contactGroups)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);

    VERIFY(connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())));
    VERIFY(connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onSaveButtonClicked())));

    ui->nameEdit->setText(contactEntry->getName());
    ui->nicknameEdit->setText(contactEntry->getNickname());
    ui->fileAsEdit->setText(contactEntry->getFileAs());
    ui->companyEdit->setText(contactEntry->getOrgName());
    ui->jobTitleEdit->setText(contactEntry->getOrgTitle());

    for (auto contactGroup : contactGroups)
    {
        /*if (contactGroup->isSystemGroup())
        {
            continue;
        }*/
        QCheckBox* checkBox = new QCheckBox(ui->groupsGroupBox);
        checkBox->setText(contactGroup->getTitle());
        ui->groupsGroupBoxLayout->insertWidget(ui->groupsGroupBoxLayout->count() - 1, checkBox);
        checkBox->setChecked(contactEntry->getContactGroups().contains(contactGroup));
        m_checkBoxesToContactGroups.insert(checkBox, contactGroup);
    }

    initPropertiesTreeWidget();
}
开发者ID:petrytar,项目名称:GoogleContacts,代码行数:33,代码来源:EditContactEntryDialog.cpp

示例8: slotAddColumns

void DbFieldWidget::slotAddColumns(QStringList columns){
    ui->firstBox->addItems(columns);
    ui->middleBox->addItems(columns);
    ui->lastBox->addItems(columns);
    ui->gradeBox->addItems(columns);
    ui->genderBox->addItems(columns);

    QVBoxLayout *layout = new QVBoxLayout();
    QWidget *holder = new QWidget(ui->questionScrollArea);
    holder->setLayout(layout);

    questionFields.resize(columns.size());

    for(int i = 0; i < columns.size(); ++i){
        QCheckBox *box = new QCheckBox(holder);
        box->setText(columns.at(i));
        questionFields[i] = box;

        layout->addWidget(box);
    }

    ui->questionScrollArea->setWidget(holder);

    dialog->setButtonState(DatabaseDialog::BUTTON_FINISH, true);
}
开发者ID:jasonpaulos,项目名称:MatchMaker,代码行数:25,代码来源:DbFieldWidget.cpp

示例9: toSGATracePrefs

    toSGATracePrefs(toTool *tool, QWidget* parent = 0, const char* name = 0)
            : QGroupBox(parent), toSettingTab("trace.html"), Tool(tool)
    {
        if (name)
            setObjectName(name);

        QVBoxLayout *vbox = new QVBoxLayout;
        vbox->setSpacing(6);
        vbox->setContentsMargins(11, 11, 11, 11);

        setLayout(vbox);

        setTitle(qApp->translate("toSGATracePrefs", "SGA Trace"));

        AutoUpdate = new QCheckBox(this);
        AutoUpdate->setText(qApp->translate("toSGATracePrefs", "&Auto update"));
        AutoUpdate->setToolTip(qApp->translate("toSGATracePrefs",
                                               "Update automatically after change of schema."));
        vbox->addWidget(AutoUpdate);

        QSpacerItem *spacer = new QSpacerItem(
            20,
            20,
            QSizePolicy::Minimum,
            QSizePolicy::Expanding);
        vbox->addItem(spacer);

//         if (!Tool->config(CONF_AUTO_UPDATE, "Yes").isEmpty())
//             AutoUpdate->setChecked(true);
        AutoUpdate->setChecked(toConfigurationSingle::Instance().autoUpdate());
    }
开发者ID:netrunner-debian-kde-extras,项目名称:tora,代码行数:31,代码来源:tosgatrace.cpp

示例10: setCells

void CellWidget::setCells(vector<CellTrack::Cell*> visable_cells, vector<CellTrack::Cell*> marked_cells)
{
	clearCells();
	m_cells = visable_cells;
	orderCells();
	int cell_num = m_cells.size();
	setLayoutItems(cell_num);
	set<CellTrack::Cell*> marked_cells_set(marked_cells.begin(), marked_cells.end());
	for(int i = 0; i < cell_num; i++)
	{
		CellTrack::Cell* cell = m_cells[i];
		QCheckBox* checker = m_checkers[i];
		QTextEdit* editor = m_editors[i];
		editor->setText(tr("<span style=\" color:#%1;\">%2</span>")
				.arg(getColorStr(cell->getColor()))
				.arg(cell->getSize()));
		checker->setText(tr("%1 : ").arg(cell->getTrack()->trackId() + 1));
		if(marked_cells_set.find(m_cells[i]) != marked_cells_set.end())
		{
			checker->setChecked(true);
		}
		else checker->setChecked(false);
		connect(checker,SIGNAL(stateChanged(int)), this, SLOT(onCellChecked(int)));
	}
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:25,代码来源:cellwidget.cpp

示例11: QDialog

VideoControl::VideoControl(Miro::Client & _client,
			   QWidget * _parent,
			   const char * _name)
  :  QDialog(_parent, _name)
{
  if ( !_name )
    setName( "QtVideoControl" );

  setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
  QGridLayout * layout2 = new QGridLayout( this, 1, 1, 11, 6, "layout2"); 

  video_control_ = _client.resolveName<Video::CameraControl>(_name);
  Video::FeatureSetVector_var features;
  video_control_->getFeatureDescription(features);
  states_ = new FeatureState[features->length()];

  // create control widgets
  // connect them also
  QGridLayout * layout = new QGridLayout( 0, features->length(), 1, 0, 6, "layout");
  layout->setColStretch(1, 1);
  for (unsigned int i=0; i<features->length(); ++i) {
    
    if (features[i].hasAutoMode) {
      QCheckBox * checkBox = new QCheckBox( this, feature2Name(features[i].feature).c_str() );
      checkBox->setText("auto");
      layout->addWidget( checkBox, i, 0 );
      connect( checkBox, SIGNAL( stateChanged(int) ), this, SLOT( autoChange(int) ) );
    } else {
开发者ID:BackupTheBerlios,项目名称:miro-middleware-svn,代码行数:28,代码来源:VideoControl.cpp

示例12: setEditorData

void CheckBoxListDelegate::setEditorData( QWidget *editor, const QModelIndex &index ) const
{
	//set editor data
	QCheckBox *myEditor = static_cast<QCheckBox*>(editor);
	myEditor->setText(index.data(Qt::DisplayRole).toString());
	myEditor->setChecked(index.data(Qt::UserRole).toBool());
}
开发者ID:CobaltBlues,项目名称:nifskope,代码行数:7,代码来源:nifcheckboxlist.cpp

示例13: sd

/*
 * Alert box, with optional "don't show this message again" variable
 * and checkbox, and optional secondary text.
 */
void
simple_message_box(ESD_TYPE_E type, gboolean *notagain,
                   const char *secondary_msg, const char *msg_format, ...)
{
    if (notagain && *notagain) {
        return;
    }

    va_list ap;

    va_start(ap, msg_format);
    SimpleDialog sd(wsApp->mainWindow(), type, ESD_BTN_OK, msg_format, ap);
    va_end(ap);

    sd.setDetailedText(secondary_msg);

#if (QT_VERSION > QT_VERSION_CHECK(5, 2, 0))
    QCheckBox *cb = NULL;
    if (notagain) {
        cb = new QCheckBox();
        cb->setChecked(true);
        cb->setText(QObject::tr("Don't show this message again."));
        sd.setCheckBox(cb);
    }
#endif

    sd.exec();

#if (QT_VERSION > QT_VERSION_CHECK(5, 2, 0))
    if (notagain && cb) {
        *notagain = cb->isChecked();
    }
#endif
}
开发者ID:acaceres2176,项目名称:wireshark,代码行数:38,代码来源:simple_dialog.cpp

示例14: QListWidgetItem

void
WidgetVpzPropertyExpCond::refresh()
{
    // First, clear the current list content
    bool oldBlock = QListWidget::blockSignals(true);
    QListWidget::clear();
    QString dyn = mVpz->modelDynFromDoc(mModQuery);
    // TODO only way to see if it is an atomic model ??
    QDomNodeList conds = mVpz->condsListFromConds(mVpz->condsFromDoc());
    for (int i = 0; i < conds.length(); i++) {
        QDomNode cond = conds.at(i);
        QString condName = DomFunctions::attributeValue(cond, "name");
        QListWidgetItem* wi = new QListWidgetItem(this);
        QListWidget::addItem(wi);
        QCheckBox* cb = new QCheckBox(this);
        cb->setText(condName);
        if (mVpz->isAttachedCond(mModQuery, condName)) {
            cb->setCheckState(Qt::Checked);
        } else {
            cb->setCheckState(Qt::Unchecked);
        }
        QObject::connect(
          cb, SIGNAL(toggled(bool)), this, SLOT(onCheckboxToggle(bool)));
        QListWidget::setItemWidget(wi, cb);
    }
    QListWidget::blockSignals(oldBlock);
}
开发者ID:Chabrier,项目名称:vle,代码行数:27,代码来源:widgetvpzproperty.cpp

示例15: retranslateUi

void QwwTipWidgetPrivate::retranslateUi(){
    Q_Q(QwwTipWidget);
    m_check->setText(q->tr("Show tips on startup"));
    m_prev->setText(q->tr("&Prev"));
    m_next->setText(q->tr("&Next"));
    m_close->setText(q->tr("&Close"));
}
开发者ID:TeamKami,项目名称:KamiCmd,代码行数:7,代码来源:qwwtipwidget.cpp


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