本文整理汇总了C++中LayoutUnit::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutUnit::toString方法的具体用法?C++ LayoutUnit::toString怎么用?C++ LayoutUnit::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutUnit
的用法示例。
在下文中一共展示了LayoutUnit::toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLayoutsList
bool X11Helper::setLayout(const LayoutUnit& layout)
{
QList<LayoutUnit> currentLayouts = getLayoutsList();
int idx = currentLayouts.indexOf(layout);
if( idx == -1 || idx >= X11Helper::MAX_GROUP_COUNT ) {
qCWarning(KCM_KEYBOARD) << "Layout" << layout.toString() << "is not found in current layout list"
<< getLayoutsListAsString(currentLayouts);
return false;
}
return X11Helper::setGroup((unsigned int)idx);
}
示例2: getIconWithText
const QIcon Flags::getIconWithText(const LayoutUnit& layoutUnit, const KeyboardConfig& keyboardConfig)
{
QString keySuffix(getPixmapKey(keyboardConfig));
QString key(layoutUnit.toString() + keySuffix);
if( iconOrTextMap.contains(key) ) {
return iconOrTextMap[ key ];
}
if( keyboardConfig.indicatorType == KeyboardConfig::SHOW_FLAG ) {
QIcon icon = getIcon(layoutUnit.layout);
if( ! icon.isNull() ) {
iconOrTextMap[ key ] = icon;
return icon;
}
}
QString layoutText = Flags::getShortText(layoutUnit, keyboardConfig);
const QSize TRAY_ICON_SIZE(21, 14);
QPixmap pixmap = QPixmap(TRAY_ICON_SIZE);
pixmap.fill(Qt::transparent);
QPainter painter(&pixmap);
// p.setRenderHint(QPainter::SmoothPixmapTransform);
// p.setRenderHint(QPainter::Antialiasing);
if( keyboardConfig.indicatorType == KeyboardConfig::SHOW_LABEL_ON_FLAG ) {
QIcon iconf = createIcon(layoutUnit.layout);
iconf.paint(&painter, painter.window(), Qt::AlignCenter);
}
drawLabel(painter, layoutText, keyboardConfig.isFlagShown());
painter.end();
QIcon icon(pixmap);
iconOrTextMap[ key ] = icon;
return icon;
}