本文整理汇总了C++中TQListViewItem::firstChild方法的典型用法代码示例。如果您正苦于以下问题:C++ TQListViewItem::firstChild方法的具体用法?C++ TQListViewItem::firstChild怎么用?C++ TQListViewItem::firstChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TQListViewItem
的用法示例。
在下文中一共展示了TQListViewItem::firstChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSelectedZonelist
void Zone::getSelectedZonelist(TDEListView *listView)
{
_remotezonelist.clear();
/* loop through all entries */
TQListViewItem *root = listView->firstChild();
while (root) {
if (root->firstChild()) {
root = root->firstChild();
continue;
}
TQCheckListItem *cl = (TQCheckListItem*) root;
if (cl->isOn()) {
_remotezonelist.append(cl->text(2));
}
if (root->nextSibling()) {
root = root->nextSibling();
continue;
}
root = root->parent();
if (root)
root = root->nextSibling();
}
}
示例2: lookForItem
TQListViewItem* KMWLocal::lookForItem( const TQString& uri )
{
for ( int i=0; i<4; i++ )
{
TQListViewItem *item = m_parents[ i ]->firstChild();
while ( item )
if ( item->text( 1 ) == uri )
if ( item->firstChild() )
return item->firstChild();
else
return item;
else
item = item->nextSibling();
}
return 0;
}
示例3: InsertTreeListItem
void KJanusWidget::InsertTreeListItem(const TQStringList &items, const TQPixmap &pixmap, TQFrame *page)
{
bool isTop = true;
TQListViewItem *curTop = 0, *child, *last, *newChild;
unsigned int index = 1;
TQStringList curPath;
for ( TQStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) {
TQString name = (*it);
bool isPath = ( index != items.count() );
// Find the first child.
if (isTop) {
child = mTreeList->firstChild();
}
else {
child = curTop->firstChild();
}
// Now search for a child with the current Name, and if it we doesn't
// find it, then remember the location of the last child.
for (last = 0; child && child->text(0) != name ; last = child, child = child->nextSibling());
if (!last && !child) {
// This node didn't have any children at all, lets just insert the
// new child.
if (isTop)
newChild = new TQListViewItem(mTreeList, name);
else
newChild = new TQListViewItem(curTop, name);
}
else if (child) {
// we found the given name in this child.
if (!isPath) {
kdDebug() << "The element inserted was already in the TreeList box!" << endl;
return;
}
else {
// Ok we found the folder
newChild = child;
}
}
else {
// the node had some children, but we didn't find the given name
if (isTop)
newChild = new TQListViewItem(mTreeList, last, name);
else
newChild = new TQListViewItem(curTop, last, name);
}
// Now make the element expandable if it is a path component, and make
// ready for next loop
if (isPath) {
newChild->setExpandable(true);
curTop = newChild;
isTop = false;
curPath << name;
TQString key = curPath.join("_/_");
if (mFolderIconMap.contains(key)) {
TQPixmap p = mFolderIconMap[key];
newChild->setPixmap(0,p);
}
}
else {
if (mShowIconsInTreeList) {
newChild->setPixmap(0, pixmap);
}
mTreeListToPageStack.insert(newChild, page);
}
}
}