本文整理汇总了C++中QListViewItem::isOpen方法的典型用法代码示例。如果您正苦于以下问题:C++ QListViewItem::isOpen方法的具体用法?C++ QListViewItem::isOpen怎么用?C++ QListViewItem::isOpen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListViewItem
的用法示例。
在下文中一共展示了QListViewItem::isOpen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotEditToolbar
void ActionConfigDialog::slotEditToolbar()
{
QString toolbarName;
QString toolbarId;
QListViewItem *oldItem;
QListViewItem *item = actionTreeView->currentItem();
if (item->parent())
item = item->parent();
toolbarName = item->text(0);
if ( toolbarName != i18n("All"))
{
emit configureToolbars(toolbarName +" <quanta>");
//update the tree view
KAction *action;
KActionCollection *ac = m_mainWindow->actionCollection();
ToolbarTabWidget *tb = ToolbarTabWidget::ref();
for (int i = 0; i < tb->count(); i++)
{
toolbarName = tb->label(i);
toolbarId = tb->id(i);
ToolbarEntry *p_toolbar = m_toolbarList[toolbarId];
if (p_toolbar)
{
oldItem = actionTreeView->findItem(toolbarName, 0);
item = new KListViewItem(actionTreeView, oldItem, toolbarName);
item->setOpen(oldItem->isOpen());
delete oldItem;
QDomNode node = p_toolbar->guiClient->domDocument().firstChild().firstChild().firstChild();
while (!node.isNull())
{
if (node.nodeName() == "Action")
{
action = ac->action(node.toElement().attribute("name"));
if (action)
{
oldItem = new KListViewItem(item, oldItem, action->text().replace(QRegExp("\\&(?!\\&)"),""), action->shortcut().toString(), action->name());
oldItem->setPixmap(0, SmallIcon(action->icon()));
}
}
node = node.nextSibling();
}
}
}
actionTreeView->setCurrentItem(allActionsItem);
actionTreeView->setSelected(allActionsItem, true);
}
}
示例2: prune
void VariableTree::prune()
{
QListViewItem *child = firstChild();
while (child != 0) {
QListViewItem *nextChild = child->nextSibling();
// Only prune var frames, not the watch or global root
if (child->rtti() == RTTI_VAR_FRAME_ROOT) {
if (((VarFrameRoot*) child)->isActive()) {
if (child->isOpen()) {
((VarFrameRoot*) child)->prune();
}
} else {
delete child;
}
}
child = nextChild;
}
}
示例3: readAnnotations
void AnnotationOutput::readAnnotations()
{
if (!Project::ref()->hasProject())
{
m_allAnnotations->clear();
m_yourAnnotations->clear();
m_yourAnnotationsNum = 0;
setTabLabel(m_yourAnnotations, i18n("For You"));
return;
}
KURL baseURL = Project::ref()->projectBaseURL();
QStringList openedItems;
QListViewItem *item = m_allAnnotations->firstChild();
while (item)
{
if (item->isOpen())
openedItems += item->text(0);
item = item->nextSibling();
}
m_allAnnotations->clear();
m_annotatedFileItems.clear();
m_fileNames.clear();
m_lines.clear();
QStringList yourOpenedItems;
item = m_yourAnnotations->firstChild();
while (item)
{
if (item->isOpen())
yourOpenedItems += item->text(0);
item = item->nextSibling();
}
m_yourAnnotations->clear();
m_yourFileItems.clear();
m_yourFileNames.clear();
m_yourLines.clear();
m_yourAnnotationsNum = 0;
QDomElement annotationElement = Project::ref()->dom()->firstChild().firstChild().namedItem("annotations").toElement();
if (annotationElement.isNull())
return;
QString yourself = Project::ref()->yourself().lower();
QStringList roles = Project::ref()->yourRoles();
QDomNodeList nodes = annotationElement.childNodes();
int count = nodes.count();
for (int i = 0; i < count; i++)
{
QDomElement el = nodes.item(i).toElement();
QString fileName = el.attribute("url");
KURL u = baseURL;
QuantaCommon::setUrl(u, fileName);
u = QExtFileInfo::toAbsolute(u, baseURL);
if (Project::ref()->contains(u))
{
bool ok;
int line = el.attribute("line").toInt(&ok, 10);
QString text = el.attribute("text");
QString receiver = el.attribute("receiver");
text.replace('\n',' ');
QString lineText = QString("%1").arg(line);
if (lineText.length() < 20)
{
QString s;
s.fill('0', 20 - lineText.length());
lineText.prepend(s);
}
KListViewItem *fileIt = m_annotatedFileItems[fileName];
if (!fileIt)
{
fileIt = new KListViewItem(m_allAnnotations, fileName);
m_annotatedFileItems.insert(fileName, fileIt);
m_fileNames[fileIt] = u.url();
}
KListViewItem *it = new KListViewItem(fileIt, fileIt, text, lineText);
if (openedItems.contains(fileName))
fileIt->setOpen(true);
m_fileNames[it] = u.url();
m_lines[it] = line;
if (!yourself.isEmpty() && (receiver == yourself || roles.contains(receiver)))
{
m_yourAnnotationsNum++;
KListViewItem *fileIt = m_yourFileItems[fileName];
if (!fileIt)
{
fileIt = new KListViewItem(m_yourAnnotations, fileName);
m_yourFileItems.insert(fileName, fileIt);
m_yourFileNames[fileIt] = u.url();
}
KListViewItem *it = new KListViewItem(fileIt, fileIt, text, lineText);
if (yourOpenedItems.contains(fileName))
fileIt->setOpen(true);
m_yourFileNames[it] = u.url();
m_yourLines[it] = line;
}
} else
{
annotationElement.removeChild(el);
//.........这里部分代码省略.........