本文整理汇总了C++中ParagraphStyle::direction方法的典型用法代码示例。如果您正苦于以下问题:C++ ParagraphStyle::direction方法的具体用法?C++ ParagraphStyle::direction怎么用?C++ ParagraphStyle::direction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParagraphStyle
的用法示例。
在下文中一共展示了ParagraphStyle::direction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStyle
void PropertiesPalette_Text::updateStyle(const ParagraphStyle& newCurrent)
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
const CharStyle& charStyle = newCurrent.charStyle();
advancedWidgets->updateStyle(newCurrent);
fontfeaturesWidget->updateStyle(newCurrent);
colorWidgets->updateStyle(newCurrent);
optMargins->updateStyle(newCurrent);
orphanBox->updateStyle (newCurrent);
parEffectWidgets->updateStyle(newCurrent);
hyphenationWidget->updateStyle(newCurrent);
showFontFace(charStyle.font().scName());
showFontSize(charStyle.fontSize());
showLanguage(charStyle.language());
bool tmp = m_haveItem;
m_haveItem = false;
setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing());
lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode());
textAlignment->setStyle(newCurrent.alignment(), newCurrent.direction());
textDirection->setStyle(newCurrent.direction());
m_haveItem = tmp;
}
示例2:
QList<TextShaper::TextRun> TextShaper::itemizeBiDi()
{
QList<TextRun> textRuns;
UBiDi *obj = ubidi_open();
UErrorCode err = U_ZERO_ERROR;
UBiDiLevel parLevel = UBIDI_LTR;
ParagraphStyle style = m_story.paragraphStyle(m_firstChar);
if (style.direction() == ParagraphStyle::RTL)
parLevel = UBIDI_RTL;
ubidi_setPara(obj, (const UChar*) m_text.utf16(), m_text.length(), parLevel, NULL, &err);
if (U_SUCCESS(err))
{
int32_t count = ubidi_countRuns(obj, &err);
if (U_SUCCESS(err))
{
textRuns.reserve(count);
for (int32_t i = 0; i < count; i++)
{
int32_t start, length;
UBiDiDirection dir = ubidi_getVisualRun(obj, i, &start, &length);
textRuns.append(TextRun(start, length, dir));
}
}
}
ubidi_close(obj);
return textRuns;
}