本文整理汇总了C++中setCheckState函数的典型用法代码示例。如果您正苦于以下问题:C++ setCheckState函数的具体用法?C++ setCheckState怎么用?C++ setCheckState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setCheckState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例2: setCheckState
void MenuCheckBox::nextCheckState()
{
if(this->checkState() == Qt::Checked)
setCheckState(Qt::Unchecked);
else
setCheckState(Qt::Checked);
}
示例3: setCheckState
void CLabel::setChecked(bool checked){
if( checked ){
setCheckState(Qt::Checked);
} else {
setCheckState(Qt::Unchecked);
}
}
示例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();
}
}
示例5: setCheckState
void ResourceItem::setOn( bool checked )
{
if ( checked ) {
setCheckState( 0, Qt::Checked );
} else {
setCheckState( 0, Qt::Unchecked );
}
mActive = checked;
}
示例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);
}
示例7: setCheckState
void VisibleCheckBox::nextCheckState()
{
if(m_item->isVisible())
setCheckState(Qt::Unchecked);
else if(m_item->wouldBeVisibleRecursive())
setCheckState(Qt::Checked);
else
setCheckState(Qt::PartiallyChecked);
}
示例8: setCheckState
void _k9ItemWidget::titleChanged() {
if (title->isSelected()) {
setCheckState(0,Qt::Checked);
astTitle->titleSelected(title);
} else {
setCheckState(0,Qt::Unchecked);
astTitle->titleUnSelected(title);
}
}
示例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);
}
示例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 );
}
示例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
}
示例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));
}
示例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);
}
}
}
示例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();
}
示例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 );
}
}