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


C++ setChecked函数代码示例

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


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

示例1: Q_D

/*!
    \fn void QAction::toggle()

    This is a convenience function for the \l checked property.
    Connect to it to change the checked state to its opposite state.
*/
void QAction::toggle()
{
    Q_D(QAction);
    setChecked(!d->checked);
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:11,代码来源:qaction.cpp

示例2: init

/**
 * Creates a toggle button with the specified image
 * and selection state, but no text.
 *
 * @param icon  the image that the button should display
 * @param selected  if true, the button is initially selected;
 *                  otherwise, the button is initially unselected
 */
/*public*/ JToggleButton::JToggleButton(QIcon icon, bool selected, QWidget *parent) : QPushButton(icon, "", parent)
{
 //this(NULL, icon, selected);
 init();
 setChecked(selected);
}
开发者ID:allenck,项目名称:DecoderPro_app,代码行数:14,代码来源:jtogglebutton.cpp

示例3: itemAt

void GalaGV::onContextMenuRequest(const QPoint &pos)
{

    QGraphicsItem *item = itemAt(pos);
    QGraphicsEllipseItem *eSystemItem;
    ESystem  e;

    SendMenu menu(ShipTreeWidget::tree());
    QMenu *m  = menu.menu();
    QAction *openSys = m->addAction("openSys");
    QAction *openLog = m->addAction("openLog");
    QAction *setCheckd = m->addAction("check");
    QAction *setWerf = m->addAction("werft");
    QAction *clearChecked = m->addAction("clear all checked");
    setCheckd->setCheckable(true);
    setWerf->setCheckable(true);

    const QHash<QString,QGraphicsEllipseItem*> &esysteme = mData->eSysteme.value(mData->showESysteme.first+";"+QString::number(mData->gala));

    if(!mData->showESysteme.second || esysteme.size() == 0)
        clearChecked->setEnabled(false);

    if(item == NULL){
        openSys->setEnabled(false);
        openLog->setEnabled(false);
        setCheckd->setEnabled(false);
        setWerf->setEnabled(false);
    } else {
        if(!mData->mPlayerLogPlanis.contains(item))
            openLog->setEnabled(false);

        eSystemItem =esysteme.value(item->data(ID).toString());
        if(eSystemItem == NULL || !mData->showESysteme.second){
            setCheckd->setEnabled(false);
            setWerf->setEnabled(false);
        }else {
            e=eSystemItem->data(Esystem).value<ESystem>();
            setCheckd->setChecked(e.isChecked);
            setWerf->setChecked(e.isWerft);
        }
    }



    if( eSystemItem == NULL || !mData->showESysteme.second)
        menu.setDisable(true);

    do {
        QAction *ret = m->exec(mapToGlobal(pos));
        if(ret == openSys){
            emit loadPage("http://www.omega-day.com/game/?op=system&sys="+item->data(Qt::UserRole).toString());
        }else if (ret == openLog){
            emit loadPage("http://www.omega-day.com/game/"+item->data(Qt::UserRole+1).toString());
        } else if(ret == setCheckd){
            setChecked(eSystemItem,setCheckd->isChecked());
        } else if(ret == clearChecked){
            int ret =QMessageBox::warning(this,"muh","wirklich löschen",QMessageBox::Yes,QMessageBox::No);
            if(ret == QMessageBox::Yes)
                clearAllChecked();

        }else if (ret == setWerf) {
            setWerft(eSystemItem,setWerf->isChecked());
        }else if( menu.checkSendClicked(ret)){
           const  QStringList & l = menu.checkedID();
            const QString &oldID = menu.orbitID();
            if(l.size()>0){
                QString planiID = eSystemItem->data(Esystem).value<ESystem>().planiID;
                if(l.size() == 1)
                    emit sendShip(l.first(),oldID,planiID);
                else
                    emit sendShips(l,planiID);
            }
        }
    }while(!menu.exit());
}
开发者ID:abho,项目名称:Distanz,代码行数:75,代码来源:galagv.cpp

示例4: setChecked

void CheckBoxImpl::toggle()
{
    setChecked(!m_checked);
}
开发者ID:Knarf64,项目名称:flow-pomodoro,代码行数:4,代码来源:checkbox.cpp

示例5: menu

void FieldView::contextMenuEvent(QContextMenuEvent* event)
{

    QMenu menu(this);

    QModelIndex index = currentIndex();
    if(index.isValid())
    {

        menu.addAction(m_applyValueOnSelection);
        menu.addAction(m_applyValueOnAllLines);
        menu.addSeparator();
        menu.addAction(m_defineCode);
        if(nullptr != m_canvasList)
        {
            menu.addSeparator();
            menu.addAction(m_delItem);
        }
    }
    auto showSubMenu = menu.addMenu(tr("Show"));
    showSubMenu->addAction(m_showAllGroup);
    showSubMenu->addAction(m_showEsteticGroup);
    showSubMenu->addAction(m_showIdGroup);
    showSubMenu->addAction(m_showValueGroup);
    showSubMenu->addAction(m_showGeometryGroup);

    auto hideSubMenu = menu.addMenu(tr("Show/Hide"));
    auto columnCount = m_model->columnCount(QModelIndex());
    for(int i = 0; i < columnCount;++i)
    {
        auto name = m_model->headerData(i,Qt::Horizontal,Qt::DisplayRole).toString();
        auto  act = hideSubMenu->addAction(name);
        act->setCheckable(true);
        act->setChecked(!isColumnHidden(i));
        connect(act, SIGNAL(triggered(bool)) , m_mapper, SLOT(map()));
        m_mapper->setMapping(act,i);
    }


    QAction* act = menu.exec(event->globalPos());

    if(act == m_delItem)
    {
        auto itemData = static_cast<Field*>(index.internalPointer());
        DeleteFieldCommand* deleteCommand = new DeleteFieldCommand(itemData,m_canvasList->at(*m_currentPage),m_model,*m_currentPage);
        m_undoStack->push(deleteCommand);
    }
    else if( m_applyValueOnAllLines == act)
    {
        applyValue(index,false);
    }
    else if(m_applyValueOnSelection == act)
    {
        applyValue(index,true);
    }
    else if(m_defineCode == act)
    {
        defineItemCode(index);
    }
    else if(m_resetCode == act)
    {
        if(!index.isValid())
            return;

        Field* field = m_model->getFieldFromIndex(index);

        if(nullptr != field)
        {
            field->setGeneratedCode(QStringLiteral(""));
        }

    }
}
开发者ID:Rolisteam,项目名称:rcse,代码行数:73,代码来源:fieldview.cpp

示例6: setChecked

void WAbstractToggleButton::setChecked()
{
  prevState_ = state_;
  setChecked(true);
}
开发者ID:hhirsch,项目名称:wtim,代码行数:5,代码来源:WAbstractToggleButton.C

示例7: setChecked

void FlatCheckbox::onClicked() {
	if (_state & StateDisabled) return;
	setChecked(!checked());
}
开发者ID:Freyja-Folkvangr,项目名称:tdesktop,代码行数:4,代码来源:flatcheckbox.cpp

示例8: setChecked

void CheckBox::setValueFromParam(ParamValue val) {
	setChecked(val.asBool());
}
开发者ID:k-a-z-u,项目名称:KSynth,代码行数:3,代码来源:CheckBox.cpp

示例9: GetIconThemeManager

	void PlaylistWidget::SetSortOrderButton ()
	{
		auto sortButton = new QToolButton;
		sortButton->setIcon (Core::Instance ().GetProxy ()->
					GetIconThemeManager ()->GetIcon ("view-sort-ascending"));
		sortButton->setPopupMode (QToolButton::InstantPopup);

		auto menu = new QMenu (tr ("Sorting"));
		sortButton->setMenu (menu);

		auto getInts = [] (const QList<SortingCriteria>& crit) -> QVariantList
		{
			QVariantList result;
			std::transform (crit.begin (), crit.end (), std::back_inserter (result),
					[] (decltype (crit.front ()) item) { return static_cast<int> (item); });
			return result;
		};

		typedef QPair<QString, QList<SortingCriteria>> SortPair_t;
		QList<SortPair_t> stdSorts;
		stdSorts << SortPair_t (tr ("Artist / Year / Album / Track number"),
					{
						SortingCriteria::Artist,
						SortingCriteria::Year,
						SortingCriteria::Album,
						SortingCriteria::TrackNumber
					});
		stdSorts << SortPair_t (tr ("Artist / Track title"),
					{
						SortingCriteria::Artist,
						SortingCriteria::TrackTitle
					});
		stdSorts << SortPair_t (tr ("File path"),
					{
						SortingCriteria::DirectoryPath,
						SortingCriteria::FileName
					});
		stdSorts << SortPair_t (tr ("No sort"), {});

		const auto& currentCriteria = Player_->GetSortingCriteria ();

		auto sortGroup = new QActionGroup (this);
		bool wasChecked = false;
		Q_FOREACH (const auto& pair, stdSorts)
		{
			auto act = menu->addAction (pair.first);
			act->setProperty ("SortInts", getInts (pair.second));
			act->setCheckable (true);
			sortGroup->addAction (act);
			if (pair.second == currentCriteria)
			{
				act->setChecked (true);
				wasChecked = true;
			}
			else
				act->setChecked (false);

			connect (act,
					SIGNAL (triggered ()),
					this,
					SLOT (handleStdSort ()));
		}
开发者ID:zhao07,项目名称:leechcraft,代码行数:62,代码来源:playlistwidget.cpp

示例10: setChecked

/*! \internal

  Makes sure the button isn't pressed when the popup hides.
*/
void QtColorPicker::popupClosed()
{
    setChecked(false);
    setFocus();
}
开发者ID:project-renard-survey,项目名称:utopia-documents-mirror,代码行数:9,代码来源:qtcolorpicker.cpp

示例11: blocker

void MappingBool::ConfigChanged()
{
  const QSignalBlocker blocker(this);
  setChecked(m_setting.GetValue());
}
开发者ID:AdmiralCurtiss,项目名称:dolphin,代码行数:5,代码来源:MappingNumeric.cpp

示例12: messageButtonSignal

void caMessageButton::buttonhandle(int type)
{
    emit messageButtonSignal(type);
    if(type == 0) setChecked(true);
    else setChecked(false);
}
开发者ID:rorydog1,项目名称:epics,代码行数:6,代码来源:camessagebutton.cpp

示例13: Q_UNUSED

void CheckBox::mousePressEvent (QMouseEvent* e) {
	Q_UNUSED(e);
	setChecked(!checked);
	emit onChange();
}
开发者ID:k-a-z-u,项目名称:KSynth,代码行数:5,代码来源:CheckBox.cpp

示例14: setChecked

void RazorTaskButton::nextCheckState()
{
    setChecked(xfitMan().getActiveAppWindow() == mWindow);
}
开发者ID:bwalter,项目名称:razor-qt,代码行数:4,代码来源:razortaskbutton.cpp

示例15: setChecked

void OptionButton::panelClosed()
{
	setChecked(false);
	minimizePanel();
}
开发者ID:marbl,项目名称:gingr,代码行数:5,代码来源:OptionButton.cpp


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