• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setCheckState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: QMenu

void ResourceManager::on_twResources_customContextMenuRequested(const QPoint &pos)
{
    QTreeWidgetItem *item = twResources->itemAt(pos);
    if (item != NULL)
    {
        if (item->childCount() > 0)
        {
            QMenu *popupMenu = new QMenu(this);
            QAction *action;
            popupMenu->addAction(aCheckAll);
            popupMenu->addAction(aCheckAllRecursively);
            popupMenu->addAction(aUncheckAll);
            popupMenu->addAction(aUncheckAllRecursively);
            action = popupMenu->exec(QCursor::pos());
            if (action == aCheckAll)
                setCheckState(item, Qt::Checked);
            else if (action == aCheckAllRecursively)
                setCheckStateRecursively(item, Qt::Checked);
            else if (action == aUncheckAll)
                setCheckState(item, Qt::Unchecked);
            else if (action == aUncheckAllRecursively)
                setCheckStateRecursively(item, Qt::Unchecked);
        }
    }
}
开发者ID:timdetering,项目名称:openrpgmaker,代码行数:25,代码来源:resourcemanager.cpp


示例2: setCheckState

void MenuCheckBox::nextCheckState()
{
	if(this->checkState() == Qt::Checked)
		setCheckState(Qt::Unchecked);
	else
		setCheckState(Qt::Checked);
}
开发者ID:gawron89,项目名称:bulma,代码行数:7,代码来源:menucheckbox.cpp


示例3: setCheckState

void CLabel::setChecked(bool checked){
    if( checked ){
        setCheckState(Qt::Checked);
    } else {
        setCheckState(Qt::Unchecked);
    }
}
开发者ID:CoActionOS,项目名称:CoActionOS-Desktop,代码行数:7,代码来源:CLabel.cpp


示例4: dir

void OpenMediaFolderDialog::updateList() {
	const auto folder = d->ui.folder->text();
	if (!folder.isEmpty()) {
		d->ui.list->clear();
		QDir dir(folder);
		static const auto filters = Info::mediaNameFilter();
		const QFileInfoList files = dir.entryInfoList(filters, QDir::Files, QDir::Name);
		for (int i=0; i<files.size(); ++i) {
			auto item = new QListWidgetItem(files[i].fileName(), d->ui.list);
			QCheckBox *box = nullptr;
			item->setCheckState(Qt::Unchecked);
			const QString suffix = files[i].suffix();
			if (Info::videoExt().contains(suffix, Qt::CaseInsensitive))
				box = d->ui.videos;
			else if (Info::videoExt().contains(suffix, Qt::CaseInsensitive))
				box = d->ui.audios;
			else if (Info::readableImageExt().contains(suffix, Qt::CaseInsensitive))
				box = d->ui.images;
			Q_ASSERT(box);
			item->setIcon(d->icons.icon(files[i]));
			item->setData(Type, QVariant::fromValue(box));
			item->setData(Path, files[i].absoluteFilePath());
			item->setCheckState(box->isChecked() ? Qt::Checked : Qt::Unchecked);
		}
		updateOpenButton();
	}
}
开发者ID:akhilo,项目名称:cmplayer,代码行数:27,代码来源:openmediafolderdialog.cpp


示例5: setCheckState

void ResourceItem::setOn( bool checked )
{
  if ( checked ) {
    setCheckState( 0, Qt::Checked );
  } else {
    setCheckState( 0, Qt::Unchecked );
  }
  mActive = checked;
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:9,代码来源:resourceview.cpp


示例6: setCheckState

void WAbstractToggleButton::setValueText(const WT_USTRING& text)
{
  if (text == "yes")
    setCheckState(Checked);
  else if (text == "no")
    setCheckState(Unchecked);
  else if (text == "maybe")
    setCheckState(PartiallyChecked);
}
开发者ID:hhirsch,项目名称:wtim,代码行数:9,代码来源:WAbstractToggleButton.C


示例7: setCheckState

void VisibleCheckBox::nextCheckState()
{
	if(m_item->isVisible())
		setCheckState(Qt::Unchecked);
	else if(m_item->wouldBeVisibleRecursive())
		setCheckState(Qt::Checked);
	else
		setCheckState(Qt::PartiallyChecked);
}
开发者ID:andrejsavikin,项目名称:mishira,代码行数:9,代码来源:visiblecheckbox.cpp


示例8: setCheckState

void _k9ItemWidget::titleChanged() {
    if (title->isSelected())  {
        setCheckState(0,Qt::Checked);
        astTitle->titleSelected(title);
    } else {
        setCheckState(0,Qt::Unchecked);
        astTitle->titleUnSelected(title);
    }
}
开发者ID:netrunner-debian-attic,项目名称:k9copy,代码行数:9,代码来源:k9asttitles.cpp


示例9: Q_UNUSED

void KexiDBCheckBox::setValueInternal(const QVariant &add, bool removeOld)
{
    Q_UNUSED(add);
    Q_UNUSED(removeOld);
    if (isTristateInternal())
        setCheckState(m_origValue.isNull()
                      ? Qt::PartiallyChecked : (m_origValue.toBool() ? Qt::Checked : Qt::Unchecked));
    else
        setCheckState(m_origValue.toBool() ? Qt::Checked : Qt::Unchecked);
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:10,代码来源:kexidbcheckbox.cpp


示例10: KateDocItem

 KateDocItem( KTextEditor::Document *doc, const QString &status, QTreeWidget *tw )
     : QTreeWidgetItem( tw ),
     document( doc )
 {
   setText( 0, doc->url().prettyUrl() );
   setText( 1, status );
   if ( ! doc->isModified() )
     setCheckState( 0, Qt::Checked );
   else
     setCheckState( 0, Qt::Unchecked );
 }
开发者ID:UIKit0,项目名称:kate,代码行数:11,代码来源:katemwmodonhddialog.cpp


示例11: updateInterfaceColumns

    void updateInterfaceColumns(interface_t *device)
    {
        if (!device) return;

        QString default_str = QObject::tr("default");

        QString linkname = QObject::tr("DLT %1").arg(device->active_dlt);
        for (GList *list = device->links; list != NULL; list = g_list_next(list)) {
            link_row *linkr = (link_row*)(list->data);
            // XXX ...and if they're both -1?
            if (linkr->dlt == device->active_dlt) {
                linkname = linkr->name;
                break;
            }
        }
        setText(col_link_, linkname);

#ifdef HAVE_EXTCAP
        if (device->if_info.type == IF_EXTCAP) {
            /* extcap interfaces does not have this settings */
            setData(col_pmode_, Qt::CheckStateRole, QVariant());
            setApplicable(col_pmode_, false);

            setApplicable(col_snaplen_, false);
#ifdef SHOW_BUFFER_COLUMN
            setApplicable(col_buffer_, false);
#endif
        } else {
#endif
            setApplicable(col_pmode_, true);
            setCheckState(col_pmode_, device->pmode ? Qt::Checked : Qt::Unchecked);

            QString snaplen_string = device->has_snaplen ? QString::number(device->snaplen) : default_str;
            setText(col_snaplen_, snaplen_string);
#ifdef SHOW_BUFFER_COLUMN
            setText(col_buffer_, QString::number(device->buffer));
#endif
#ifdef HAVE_EXTCAP
        }
#endif
        setText(col_filter_, device->cfilter);

#ifdef SHOW_MONITOR_COLUMN
        if (device->monitor_mode_supported) {
            setApplicable(col_monitor_, true);
            setCheckState(col_monitor_, device->monitor_mode_enabled ? Qt::Checked : Qt::Unchecked);
        } else {
            setApplicable(col_monitor_, false);
        }
#endif
    }
开发者ID:kynesim,项目名称:wireshark,代码行数:51,代码来源:capture_interfaces_dialog.cpp


示例12: QTreeWidgetItem

BracketStackItem::BracketStackItem(QTreeWidget* const parent)
                : QTreeWidgetItem(parent)
{
    setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
    setCheckState(0, Qt::Unchecked);
    setThumbnail(SmallIcon("image-x-generic", treeWidget()->iconSize().width(), KIconLoader::DisabledState));
}
开发者ID:SOUMAJYOTI,项目名称:HDR-image-plugin-for-digiKam,代码行数:7,代码来源:bracketstack.cpp


示例13: setCheckable

void QtPropertyItem::ApplyDataFlags()
{
	if(NULL != itemData)
	{
		int dataFlags = itemData->GetFlags();

		if(dataFlags & QtPropertyData::FLAG_IS_CHECKABLE)
		{
			setCheckable(true);
			if(itemData->GetValue().toBool())
			{
				setCheckState(Qt::Checked);
			}
		}

		if(dataFlags & QtPropertyData::FLAG_IS_DISABLED)
		{
			setEnabled(false);
		}

		if(dataFlags & QtPropertyData::FLAG_IS_NOT_EDITABLE)
		{
			setEditable(false);
		}
	}
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:26,代码来源:QtPropertyItem.cpp


示例14: m_type

UIBootTableItem::UIBootTableItem(KDeviceType type)
    : m_type(type)
{
    setCheckState(Qt::Unchecked);
    switch(type)
    {
    case KDeviceType_Floppy:
    {
        setIcon(QIcon(":fd_16px.png"));
        break;
    }
    case KDeviceType_DVD:
    {
        setIcon(QIcon(":cd_16px.png"));
        break;
    }
    case KDeviceType_HardDisk:
    {
        setIcon(QIcon(":hd_16px.png"));
        break;
    }
    case KDeviceType_Network:
    {
        setIcon(QIcon(":nw_16px.png"));
        break;
    }
    }
    retranslateUi();
}
开发者ID:marktsai0316,项目名称:VirtualMonitor,代码行数:29,代码来源:UIBootTable.cpp


示例15: legendLayerFiles

void QgsLegendGroup::updateCheckState()
{
  std::list<QgsLegendLayerFile*> llfiles = legendLayerFiles();
  if ( llfiles.size() < 1 )
  {
    return;
  }

  std::list<QgsLegendLayerFile*>::iterator iter = llfiles.begin();
  Qt::CheckState theState = ( *iter )->checkState( 0 );
  for ( ; iter != llfiles.end(); ++iter )
  {
    if ( theState != ( *iter )->checkState( 0 ) )
    {
      theState = Qt::PartiallyChecked;
      break;
    }
  }

  if ( theState != checkState( 0 ) )
  {
    treeWidget()->blockSignals( true );
    setCheckState( 0, theState );
    treeWidget()->blockSignals( false );
  }
}
开发者ID:HydroCouple,项目名称:FVHMComponent,代码行数:26,代码来源:qgslegendgroup.cpp


示例16: QgsLegendItem

QgsLegendLayerFile::QgsLegendLayerFile( QTreeWidgetItem * theLegendItem, QString theString, QgsMapLayer* theLayer )
    : QgsLegendItem( theLegendItem, theString ), mLyr( theLayer )
{
  // Set the initial visibility flag for layers
  // This user option allows the user to turn off inital drawing of
  // layers when they are added to the map. This is useful when adding
  // many layers and the user wants to adjusty symbology, etc prior to
  // actually viewing the layer.
  QSettings settings;
  bool visible = settings.value( "/qgis/new_layers_visible", true ).toBool();
  mLyr.setVisible( visible );

  // not in overview by default
  mLyr.setInOverview( FALSE );

  mType = LEGEND_LAYER_FILE;

  setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
  setCheckState( 0, Qt::Checked );
  setText( 0, theString );

  // Add check if vector layer when connecting to selectionChanged slot
  // Ticket #811 - racicot
  QgsMapLayer *currentLayer = mLyr.layer();
  QgsVectorLayer *isVectLyr = dynamic_cast < QgsVectorLayer * >( currentLayer );
  if ( isVectLyr )
  {
    connect( mLyr.layer(), SIGNAL( editingStarted() ), this, SLOT( updateLegendItem() ) );
    connect( mLyr.layer(), SIGNAL( editingStopped() ), this, SLOT( updateLegendItem() ) );
  }
  connect( mLyr.layer(), SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );
}
开发者ID:HydroCouple,项目名称:FVHMComponent,代码行数:32,代码来源:qgslegendlayerfile.cpp


示例17: TreeItem

FolderTreeItem::FolderTreeItem( QTreeWidgetItem* parent, Folder* folder, Preferences& prefs, PropertiesPanel* propsPanel )
    : TreeItem( parent ), folder( folder ), prefs( prefs ), propsPanel( propsPanel ) {
    // It's important to setCheckState() first.  Otherwise, if a change is made too soon, 
    // it may reset the markedForStudy property by an event.
    setCheckState( 0, folder->isMarkedForStudy() ? Qt::Checked : Qt::Unchecked );
    setText( 0, folder->getTitle() );
}
开发者ID:FBergeron,项目名称:tomotko-fremantle,代码行数:7,代码来源:FolderTreeItem.cpp


示例18: setText

AlcasFunction::AlcasFunction(QString str, QListWidget *listwidget) {

    setText(str);
    setCheckState(Qt::Checked);
    listwidget->addItem(this);

}
开发者ID:fofoni,项目名称:alcas,代码行数:7,代码来源:AlcasFunction.cpp


示例19: CWizTagListWidgetItem

 CWizTagListWidgetItem(const WIZTAGDATA& tag, QListWidget* parent = 0)
     : QListWidgetItem(parent)
     , m_tag(tag)
 {
     setText(WizDatabase::tagNameToDisplayName(tag.strName));
     setFlags(flags() | Qt::ItemIsUserCheckable);
     setCheckState(Qt::Unchecked);
 }
开发者ID:WizTeam,项目名称:WizQTClient,代码行数:8,代码来源:WizTagListWidget.cpp


示例20: QCheckBox

LinkedCheckBox::LinkedCheckBox(const QString& str, const BitFieldWrapper& bitfield) : QCheckBox(str), bitfield(bitfield)
{
//	assert(bitfield.NumBits() == 1);//TODO: Enable!

	setCheckState((bitfield != 0) ? Qt::Checked : Qt::Unchecked);

	connect(this, SIGNAL(stateChanged(int)), this, SLOT(OnStateChanged(int)));
}
开发者ID:dolphin-emu,项目名称:fifoplayer,代码行数:8,代码来源:command_info.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setCheckable函数代码示例发布时间:2022-05-30
下一篇:
C++ setCheck函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap