本文整理汇总了C++中KBookmark::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ KBookmark::setText方法的具体用法?C++ KBookmark::setText怎么用?C++ KBookmark::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KBookmark
的用法示例。
在下文中一共展示了KBookmark::setText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rename
// rich
void KBookmarkManager::rename(int i, const char *s)
{
KBookmark *b;
if (i > 0) {
b= root.getChildren().at(i);
b->setText(s);
emit changed();
}
}
示例2: if
// parser based on HTML widget parser
//
const char *KBookmarkManager::parse( BookmarkTokenizer *ht, KBookmark *parent,
const char *_end )
{
KBookmark *bm = parent;
QString text;
const char *str;
parent->setType( KBookmark::Folder );
while ( ht->hasMoreTokens() )
{
str = ht->nextToken();
if (str[0] == TAG_ESCAPE )
{
str++;
if ( _end[0] != 0 && strcasecmp( str, _end ) == 0 )
{
return str;
}
else if ( strncasecmp( str, "<dl>", 4 ) == 0 )
{
parse( ht, bm, "</dl>" );
}
else if ( strncasecmp( str, "<dt>", 4 ) == 0 )
{
bm = new KBookmark;
parent->getChildren().append( bm );
}
else if ( strncasecmp( str, "<a ", 3 ) == 0 )
{
const char *p = str + 3;
while ( *p != '>' )
{
if ( strncasecmp( p, "href=", 5 ) == 0 )
{
p += 5;
text = "";
bool quoted = false;
while ( ( *p != ' ' && *p != '>' ) || quoted )
{
if ( *p == '\"' )
quoted = !quoted;
else
text += *p;
p++;
}
bm->setURL( text );
if ( *p == ' ' )
p++;
}
else
{
char *p2 = strchr( (char*) p, ' ' );
if ( p2 == 0L )
p2 = strchr( (char*) p, '>');
else
p2++;
p = p2;
}
}
text = "";
}
else if ( strncasecmp( str, "<H3", 3 ) == 0 )
{
text = "";
}
else if ( strncasecmp( str, "</H3>", 5 ) == 0 ||
strncasecmp( str, "</a>", 4 ) == 0 )
{
bm->setText( text );
}
}
else if ( str[0] )
{
text += str;
}
}
return NULL;
}