本文整理汇总了C++中QChar::isSurrogate方法的典型用法代码示例。如果您正苦于以下问题:C++ QChar::isSurrogate方法的具体用法?C++ QChar::isSurrogate怎么用?C++ QChar::isSurrogate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QChar
的用法示例。
在下文中一共展示了QChar::isSurrogate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WordAndPara
void WordAndPara(PageItem* currItem, int *w, int *p, int *c, int *wN, int *pN, int *cN)
{
QChar Dat = QChar(32);
int para = 0;
int ww = 0;
int cc = 0;
int paraN = 0;
int wwN = 0;
int ccN = 0;
bool first = true;
PageItem *nextItem = currItem;
PageItem *nbl = currItem;
while (nextItem != 0)
{
if (nextItem->prevInChain() != 0)
nextItem = nextItem->prevInChain();
else
break;
}
while (nextItem != 0)
{
for (int a = qMax(nextItem->firstInFrame(),0); a <= nextItem->lastInFrame() && a < nextItem->itemText.length(); ++a)
{
QChar b = nextItem->itemText.text(a);
if (b == SpecialChars::PARSEP)
{
para++;
}
if ((!b.isLetterOrNumber()) && (Dat.isLetterOrNumber()) && (!first))
{
ww++;
}
if (b.isSurrogate())
++a;
cc++;
Dat = b;
first = false;
}
nbl = nextItem;
nextItem = nextItem->nextInChain();
}
if (nbl->frameOverflows()) {
paraN++;
for (int a = nbl->lastInFrame()+1; a < nbl->itemText.length(); ++a)
{
QChar b = nbl->itemText.text(a);
if (b == SpecialChars::PARSEP)
{
paraN++;
}
if ((!b.isLetterOrNumber()) && (Dat.isLetterOrNumber()) && (!first))
{
wwN++;
}
if (b.isSurrogate())
++a;
ccN++;
Dat = b;
first = false;
}
}
else {
para++;
}
if (Dat.isLetterOrNumber())
{
if (nbl->frameOverflows())
wwN++;
else
ww++;
}
*w = ww;
*p = para;
*c = cc;
*wN = wwN;
*pN = paraN;
*cN = ccN;
}