本文整理汇总了C++中QListWidgetItem::setHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidgetItem::setHidden方法的具体用法?C++ QListWidgetItem::setHidden怎么用?C++ QListWidgetItem::setHidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidgetItem
的用法示例。
在下文中一共展示了QListWidgetItem::setHidden方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: objectTextEdited
void ObjectExplorer::objectTextEdited(const QString& text)
{
QListWidgetItem * item = nullptr;
for(int i=0; i<mObjectList->count(); i++) {
item = mObjectList->item(i);
item->setHidden(!item->text().contains(text, Qt::CaseInsensitive));
}
QList<QListWidgetItem *> items;
items = mGroupList->selectedItems();
if(items.size()) {
for(int i=0; i<items.size(); i++) {
item = items.at(i);
}
}
else {
for(int i=0; i<mGroupList->count(); i++) {
item = mGroupList->item(i);
if(!item->isHidden()) {
items.push_back(item);
}
}
}
bool match = false;
for(int i=0; i<mObjectList->count(); i++) {
if(!mObjectList->item(i)->isHidden()) {
for(int j=0; j<items.size(); j++) {
match = false;
if(items.at(j)->text() == mObjectList->item(i)->whatsThis()) {
match = true;
break;
}
}
if(!match) {
mObjectList->item(i)->setHidden(true);
}
}
}
}
示例2: sipNoMethod
static PyObject *meth_QListWidgetItem_setHidden(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
bool a0;
QListWidgetItem *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "Bb", &sipSelf, sipType_QListWidgetItem, &sipCpp, &a0))
{
sipCpp->setHidden(a0);
Py_INCREF(Py_None);
return Py_None;
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipParseErr, sipName_QListWidgetItem, sipName_setHidden, doc_QListWidgetItem_setHidden);
return NULL;
}
示例3: removeDocsets
void SettingsDialog::removeDocsets(const QStringList &names)
{
for (const QString &name : names) {
const QString title = m_docsetRegistry->docset(name)->title();
m_docsetRegistry->remove(name);
const QDir dataDir(m_application->settings()->docsetPath);
if (dataDir.exists()) {
ui->docsetsProgress->show();
ui->removeDocsetsButton->setEnabled(false);
displayProgress();
QFuture<bool> future = QtConcurrent::run([=] {
QDir docsetDir(dataDir);
return docsetDir.cd(name + QLatin1String(".docset"))
&& docsetDir.removeRecursively();
});
QFutureWatcher<bool> *watcher = new QFutureWatcher<bool>();
watcher->setFuture(future);
connect(watcher, &QFutureWatcher<void>::finished, [=] {
if (!watcher->result()) {
QMessageBox::warning(this, tr("Error"),
QString(tr("Cannot delete docset <b>%1</b>!")).arg(title));
}
resetProgress();
QListWidgetItem *listItem = findDocsetListItem(title);
if (listItem)
listItem->setHidden(false);
watcher->deleteLater();
});
}
}
}
示例4: filter
void ScalarListSelector::filter(const QString& filter) {
for (int i = 0; i < _scalars->count(); i++) {
QListWidgetItem *item = _scalars->item(i);
item->setHidden(!item->text().contains(filter, Qt::CaseInsensitive));
}
}
示例5: toggleFilter
void SkDebuggerGUI::toggleFilter(QString string) {
for (int row = 0; row < fListWidget.count(); row++) {
QListWidgetItem *item = fListWidget.item(row);
item->setHidden(item->text() != string);
}
}