mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Introduce toqstr(char_type) and use it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22857 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e172898430
commit
46e6cacfe0
@ -294,8 +294,7 @@ void GuiSymbols::updateSymbolList()
|
||||
// we do not want control or space characters
|
||||
if (cat == QChar::Other_Control || cat == QChar::Separator_Space)
|
||||
continue;
|
||||
QListWidgetItem * lwi = new QListWidgetItem(
|
||||
QString::fromUcs4((uint const *) &c, 1));
|
||||
QListWidgetItem * lwi = new QListWidgetItem(toqstr(c));
|
||||
if (show_all || c >= range_start && c <= range_end) {
|
||||
lwi->setTextAlignment(Qt::AlignCenter);
|
||||
symbolsLW->addItem(lwi);
|
||||
|
@ -64,6 +64,16 @@ inline QString const toqstr(docstring const & ucs4)
|
||||
return QString::fromUcs4(reinterpret_cast<uint const *>(ucs4.data()), ucs4.length());
|
||||
}
|
||||
|
||||
/**
|
||||
* toqstr - convert a UCS4 encoded character into a QString
|
||||
*
|
||||
* This is the preferred method of converting anything that possibly
|
||||
* contains non-ASCII stuff to QString.
|
||||
*/
|
||||
inline QString const toqstr(char_type ucs4)
|
||||
{
|
||||
return QString::fromUcs4(reinterpret_cast<uint const *>(&ucs4), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* qstring_to_ucs4 - convert a QString into a UCS4 encoded docstring
|
||||
|
Loading…
Reference in New Issue
Block a user