您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ toggled函数代码示例

51自学网 2021-06-03 08:55:01
  C++
这篇教程C++ toggled函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中toggled函数的典型用法代码示例。如果您正苦于以下问题:C++ toggled函数的具体用法?C++ toggled怎么用?C++ toggled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: toggled

void QToggleSwitch::toggle(){    extern int currentValue;    if (this->value() == 1)    {        this->setSliderPosition(0);        currentValue = 0;        this->setValue(0);        emit toggled();        emit switchedOff();    }    else    {        this->setSliderPosition(1);        currentValue = 1;        this->setValue(1);        emit toggled();        emit switchedOn();    }}
开发者ID:bharadwaj-raju,项目名称:QToggleSwitch,代码行数:34,


示例2: setText

void toToggleButton::toggle(){    int idx = ++m_idx < m_enum.keyCount() ? m_idx : m_idx=0;    setText(m_enum.key(idx));    emit toggled(text());    emit toggled(m_enum.value(idx));}
开发者ID:Daniel1892,项目名称:tora,代码行数:7,


示例3: Editor

TableEditor::TableEditor(QWidget *parent): Editor(parent){    QVBoxLayout *layout = new QVBoxLayout(this);    setLayout(layout);    // toolbar    _toolbar = new QWidget(this);    layout->addWidget(_toolbar);    _ui_toolbar = new Ui::TableEditorToolbar;    _ui_toolbar->setupUi(_toolbar);    _ui_toolbar->firstPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/allLeft")));    _ui_toolbar->previousPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/left")));    _ui_toolbar->nextPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/right")));    _ui_toolbar->lastPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/allRight")));    _ui_toolbar->refreshButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/refresh")));    _ui_toolbar->addRowButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/general/add")));    _ui_toolbar->deleteRowButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/general/remove")));    _ui_toolbar->commitButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/checked")));    _ui_toolbar->rollbackButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/rollback")));    _ui_toolbar->dumpDataButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/export")));    _tableView = new QTableView(this);    _tableModel = new QSqlTableModel(_tableView /* TODO database connection */);    _tableView->setModel(_tableModel);    layout->addWidget(_tableView);    // connections    connect(_ui_toolbar->commitButton, SIGNAL(clicked()), _tableModel, SLOT(submitAll()));    connect(_ui_toolbar->rollbackButton, SIGNAL(clicked()), _tableModel, SLOT(revertAll()));    connect(_ui_toolbar->addRowButton, SIGNAL(clicked()), this, SLOT(addRow()));    connect(_ui_toolbar->deleteRowButton, SIGNAL(clicked()), this, SLOT(deleteRows()));    connect(_ui_toolbar->refreshButton, SIGNAL(clicked()), _tableModel, SLOT(select()));    connect(_ui_toolbar->toolButtonExportImage, SIGNAL(clicked()),_imageView, SLOT(exportImage()));    connect(_ui_toolbar->toolButtonZoomIn, SIGNAL(clicked()),_imageView,SLOT(zoomIn()));    connect(_ui_toolbar->toolButtonZoomOut, SIGNAL(clicked()),_imageView, SLOT(zoomOut()));    connect(_ui_toolbar->toolButtonFitToScreen, SIGNAL(clicked()),_imageView, SLOT(fitToScreen()));    connect(_ui_toolbar->toolButtonOriginalSize, SIGNAL(clicked()),_imageView, SLOT(resetToOriginalSize()));    connect(_ui_toolbar->toolButtonBackground, SIGNAL(toggled()),_imageView, SLOT(setViewBackground()));    connect(_ui_toolbar->toolButtonOutline, SIGNAL(toggled()),_imageView, SLOT(setViewOutline()));    connect(_ui_toolbar->toolButtonPlayPause, SIGNAL(clicked()),this, SLOT(playToggled()));    connect(_file, SIGNAL(imageSizeChanged()),this, SLOT(imageSizeUpdated()));    connect(_file, SIGNAL(openFinished()),_imageView, SLOT(createScene()));    connect(_file, SIGNAL(openFinished()),this, SLOT(updateToolButtons()));    connect(_file, SIGNAL(aboutToReload()),_imageView, SLOT(reset()));    connect(_file, SIGNAL(reloadFinished()),_imageView, SLOT(createScene()));    connect(_file, SIGNAL(isPausedChanged()),this, SLOT(updatePauseAction()));    connect(_imageView, SIGNAL(scaleFactorChanged()),this, SLOT(scaleFactorUpdate()));}
开发者ID:intelligide,项目名称:UnicornEdit,代码行数:55,


示例4: KxkbSystemTray

void KXKBApp::initTray(){    if(!m_tray)    {        KSystemTray *sysTray = new KxkbSystemTray();        KPopupMenu *popupMenu = sysTray->contextMenu();        //	popupMenu->insertTitle( kapp->miniIcon(), kapp->caption() );        m_tray = new KxkbLabelController(sysTray, popupMenu);        connect(popupMenu, SIGNAL(activated(int)), this, SLOT(menuActivated(int)));        connect(sysTray, SIGNAL(toggled()), this, SLOT(toggled()));    }
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:12,


示例5: toggle_tracing

static voidtoggle_tracing(toggle_index_t ix _is_unused, enum toggle_type tt){    /* If turning on trace and no trace file, open one. */    if (toggled(TRACING) && tracef == NULL) {	tracefile_on(TRACING, tt);	if (tracef == NULL) {	    set_toggle(TRACING, false);	}    } else if (!toggled(TRACING)) {	/* If turning off trace and not still tracing events, close the	   trace file. */	tracefile_off();    }}
开发者ID:Oxyoptia,项目名称:x3270,代码行数:15,


示例6: update

void ExtenderButton::toggle(){    if (!d->checkable) return;    d->checked = !d->checked;    update();    emit toggled(d->checked);}
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:7,


示例7: cb_toggled_case_sensitive

static voidcb_toggled_case_sensitive (GtkCellRendererToggle *cell,			   const gchar           *path_string,			   SortFlowState *state){	toggled (state, path_string, ITEM_CASE_SENSITIVE);}
开发者ID:arcean,项目名称:gnumeric-for-maemo-5,代码行数:7,


示例8: cb_toggled_sort_by_value

/* We are currently not supporting `by-value' vs not. */static voidcb_toggled_sort_by_value (GtkCellRendererToggle *cell,			  const gchar *path_string,			  SortFlowState *state){	toggled (state, path_string, ITEM_SORT_BY_VALUE);}
开发者ID:arcean,项目名称:gnumeric-for-maemo-5,代码行数:8,


示例9: toggled

void TPanelTitleBarButtonForSafeArea::mousePressEvent(QMouseEvent *e) {  if (e->button() != Qt::RightButton) {    m_pressed = !m_pressed;    emit toggled(m_pressed);    update();  }}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:7,


示例10: toggled

void StickyQButton::onPushToggle(bool checked){	emit toggled(checked);	if(!checked) {		ui->lockButton->setChecked(false);	}}
开发者ID:gigglesninja,项目名称:bullycpp,代码行数:7,


示例11: setChecked

void ConfigCheckBox::loadConfiguration(){	if (!dataManager)		return;	setChecked(dataManager->readEntry(section, item).toBool());	emit toggled(isChecked());}
开发者ID:partition,项目名称:kadu,代码行数:7,


示例12: toggled

void KPageWidgetItem::setChecked(bool checked){    d->checked = checked;    emit toggled(checked);    emit changed();}
开发者ID:KDE,项目名称:kwidgetsaddons,代码行数:7,


示例13: hold

voidhold(Button *button, struct counter_data *data){  if(button->time_closed % 250 == 0) {    toggled(button, data);  }}
开发者ID:dominikh,项目名称:arduino,代码行数:7,


示例14: QStringLiteral

bool QgsLayoutAtlas::readXml( const QDomElement &atlasElem, const QDomDocument &, const QgsReadWriteContext & ){  mEnabled = atlasElem.attribute( QStringLiteral( "enabled" ), QStringLiteral( "0" ) ).toInt();  // look for stored layer name  QString layerId = atlasElem.attribute( QStringLiteral( "coverageLayer" ) );  QString layerName = atlasElem.attribute( QStringLiteral( "coverageLayerName" ) );  QString layerSource = atlasElem.attribute( QStringLiteral( "coverageLayerSource" ) );  QString layerProvider = atlasElem.attribute( QStringLiteral( "coverageLayerProvider" ) );  mCoverageLayer = QgsVectorLayerRef( layerId, layerName, layerSource, layerProvider );  mCoverageLayer.resolveWeakly( mLayout->project() );  mLayout->reportContext().setLayer( mCoverageLayer.get() );  mPageNameExpression = atlasElem.attribute( QStringLiteral( "pageNameExpression" ), QString() );  QString error;  setFilenameExpression( atlasElem.attribute( QStringLiteral( "filenamePattern" ), QString() ), error );  mSortFeatures = atlasElem.attribute( QStringLiteral( "sortFeatures" ), QStringLiteral( "0" ) ).toInt();  mSortExpression = atlasElem.attribute( QStringLiteral( "sortKey" ) );  mSortAscending = atlasElem.attribute( QStringLiteral( "sortAscending" ), QStringLiteral( "1" ) ).toInt();  mFilterFeatures = atlasElem.attribute( QStringLiteral( "filterFeatures" ), QStringLiteral( "0" ) ).toInt();  mFilterExpression = atlasElem.attribute( QStringLiteral( "featureFilter" ) );  mHideCoverage = atlasElem.attribute( QStringLiteral( "hideCoverage" ), QStringLiteral( "0" ) ).toInt();  emit toggled( mEnabled );  emit changed();  return true;}
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:30,


示例15: model

void MButton::setChecked(bool buttonChecked){    // FIXME: these checks could be done in model side, the group needs moved to model first    if (isCheckable() && buttonChecked != isChecked()) {        /* The active button in an exclusive group cannot be deselected */        if (group() && group()->exclusive() && group()->checkedButton() == this) {            return;        }        //TODO This is here just because of the delayed model initialization, this        //     call should be removed when the delayed model initialization bug/feature        //     is properly fixed.        //        //     The bug causes invalid functionaliy for buttons inside a buttongroup,        //     if state of a button(s) is changed before messageloop is run first        //     time. The updateData() slot does does not get called and toggled        //     signal is not emitted. Exclusive buttongroup uses the toggled signal        //     to uncheck buttons.        bool shouldEmit = (model()->checked() != buttonChecked);        toggleEmitted = false;        model()->setChecked(buttonChecked);        //TODO Remove this when delayed model initialization bug is properly fixed.        if (shouldEmit && !toggleEmitted)            emit toggled(model()->checked());    }}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:29,


示例16: mapFromGlobal

void CheckableHeader::mousePressEvent(QMouseEvent *event){    if (!m_visible) {        return;    }    const QStyle *style = QApplication::style();    QStyleOptionButton option;    option.rect.setSize(sizeHint());    option.rect.setWidth(viewport()->width());    QRect rect = style->subElementRect(QStyle::SE_CheckBoxIndicator, &option);    QPoint pos = mapFromGlobal(QCursor::pos());//     kDebug() << rect << pos;    if (insideCheckBox(rect, pos)) {        if (m_state == Qt::Checked) {            m_state = Qt::Unchecked;        } else {            m_state = Qt::Checked;        }        emit toggled(m_state);        headerDataChanged(Qt::Horizontal, 0, 0);    } else {        QHeaderView::mousePressEvent(event);    }}
开发者ID:KDE,项目名称:apper,代码行数:26,


示例17: setStyleSheet

void LinkLabel::mouseReleaseEvent(QMouseEvent* event){    if((event->button() == Qt::LeftButton) && (isEnabled())) {        if(isCheckable()) {            if(isText()) {                if(_down)                    setStyleSheet("QLabel { color : blue; }");            } else {                if(_down)                    setPixmap(_upImg);            }            _down = !_down;            emit toggled(_down);        } else {            if(isText())                setStyleSheet("QLabel { color : blue; }");            else                setPixmap(_upImg);            _down = false;            emit clicked();            emit clicked(this);        }    }    if (!_hyperlink) setStyleSheet("");    QLabel::mouseReleaseEvent(event);}
开发者ID:dmosora,项目名称:Query-Dependent,代码行数:27,


示例18: toggled

void CheckListBoxTestCase::Check(){    EventCounter toggled(m_check, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED);    wxArrayString testitems;    testitems.Add("item 0");    testitems.Add("item 1");    testitems.Add("item 2");    testitems.Add("item 3");    m_check->Append(testitems);    m_check->Check(0);    m_check->Check(1);    m_check->Check(1, false);    //We should not get any events when changing this from code    CPPUNIT_ASSERT_EQUAL(0, toggled.GetCount());    CPPUNIT_ASSERT_EQUAL(true, m_check->IsChecked(0));    CPPUNIT_ASSERT_EQUAL(false, m_check->IsChecked(1));    //Make sure a double check of an items doesn't deselect it    m_check->Check(0);    CPPUNIT_ASSERT_EQUAL(true, m_check->IsChecked(0));}
开发者ID:enachb,项目名称:freetel-code,代码行数:26,


示例19: QRect

bool CheckboxDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option,                                   const QModelIndex& index){    bool value = index.data(Qt::EditRole).toBool();    if (event->type() == QEvent::MouseButtonRelease) {        const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;        QRect checkRect = QStyle::alignedRect(option.direction, Qt::AlignCenter,                                              option.decorationSize,                                              QRect(option.rect.x() + (2 * textMargin), option.rect.y(),                                                      option.rect.width() - (2 * textMargin),                                                      option.rect.height()));        if (!checkRect.contains(static_cast<QMouseEvent*>(event)->pos()))            return false;    } else if (event->type() == QEvent::KeyPress) {        if (static_cast<QKeyEvent*>(event)->key() != Qt::Key_Space && static_cast<QKeyEvent*>(event)->key() != Qt::Key_Select)            return false;    } else {        return false;    }    value = !value;    emit toggled(value, index.column());    return model->setData(index, value, Qt::EditRole);}
开发者ID:sashoalm,项目名称:TesseractBoxEditor,代码行数:26,


示例20: update

void AbstractButtonItem::setChecked(bool checked){  m_checked = checked;  update();  emit toggled(m_checked);}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:8,


示例21: trace_char

/* Called from NVT emulation code to log a single character. */voidtrace_char(char c){    if (!toggled(SCREEN_TRACE) || !screentracef) {	return;    }    (void) fputc(c, screentracef);}
开发者ID:Oxyoptia,项目名称:x3270,代码行数:9,


示例22: toggled

void GroupBoxWidget::setChecked(bool checked){    if (!m_checkable || m_checked == checked)        return;    m_checked = checked;    emit toggled(checked);    updateDesign();}
开发者ID:kubdat,项目名称:fotowall,代码行数:8,


示例23: setChecked

void ConfigRadioButton::loadConfiguration(){    if (section.isEmpty())        return;    setChecked(dataManager->readEntry(section, item).toBool());    emit toggled(isChecked());}
开发者ID:vogel,项目名称:kadu,代码行数:8,


示例24: disconnect

ActionForward::~ActionForward(){    if (m_front && m_back)    {        disconnect(m_front, SIGNAL(triggered()), m_back, SLOT(trigger()));        disconnect(m_front, SIGNAL(toggled()), m_back, SLOT(toggle()));    }}
开发者ID:koboveb,项目名称:SVID.TERMINAL,代码行数:8,


示例25: toggled

/*! * /brief Sets the state of the diode. */void HacLed::setChecked(bool checked){    if (d->checked == checked)		return;    d->checked = checked;    emit toggled(checked);    update();}
开发者ID:etop-wesley,项目名称:hac,代码行数:12,


示例26: setToggled

void LangBarButton::setToggled(bool toggle) {	if(toggled() != toggle) {		if(toggle)			status_ |= TF_LBI_STATUS_BTN_TOGGLED;		else			status_ &= ~TF_LBI_STATUS_BTN_TOGGLED;		update(TF_LBI_STATUS);	}}
开发者ID:ChunHungLiu,项目名称:PIME,代码行数:9,


示例27: toggled

void QQuickAction::setChecked(bool c){    if (c == m_checked)        return;    m_checked = c;    // Its value shows as false while checkable is false. See also comment in setCheckable().    if (m_checkable)        emit toggled(m_checked);}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:10,



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


C++ tointeger函数代码示例
C++ toggleHidden函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。