QtCore
------
+* drop a bogus QChar::NoCategory enum value; the proper QChar::Other_NotAssigned
+ value is returned for an unassigned codepoints now.
QtGui
-----
{
if (event->button() == Qt::LeftButton) {
lastKey = (event->y()/squareSize)*columns + event->x()/squareSize;
- if (QChar(lastKey).category() != QChar::NoCategory)
+ if (QChar(lastKey).category() != QChar::Other_NotAssigned)
emit characterSelected(QString(QChar(lastKey)));
update();
}
typedef enum
{
- HB_NoCategory,
-
HB_Mark_NonSpacing, /* Mn */
HB_Mark_SpacingCombining, /* Mc */
HB_Mark_Enclosing, /* Me */
\value Symbol_Other Unicode class name So
- \value NoCategory Qt cannot find an appropriate category for the character.
-
\omitvalue Punctuation_Dask
\sa category()
QChar::Category QChar::category(uint ucs4)
{
if (ucs4 > UNICODE_LAST_CODEPOINT)
- return QChar::NoCategory;
+ return QChar::Other_NotAssigned;
return (QChar::Category) qGetProp(ucs4)->category;
}
enum Category
{
- NoCategory, // ### Qt 5: replace with Other_NotAssigned
-
Mark_NonSpacing, // Mn
Mark_SpacingCombining, // Mc
Mark_Enclosing, // Me
QVERIFY(QChar::category(0xdc00u) == QChar::Other_Surrogate);
QVERIFY(QChar::category(0xdc01u) == QChar::Other_Surrogate);
- QVERIFY(QChar::category((uint)0x10fffdu) == QChar::Other_PrivateUse);
- QVERIFY(QChar::category((uint)0x110000u) == QChar::NoCategory);
-
QVERIFY(QChar::category((uint)0x1aff) == QChar::Other_NotAssigned);
+ QVERIFY(QChar::category((uint)0x10fffdu) == QChar::Other_PrivateUse);
QVERIFY(QChar::category((uint)0x10ffffu) == QChar::Other_NotAssigned);
+ QVERIFY(QChar::category((uint)0x110000u) == QChar::Other_NotAssigned);
}
void tst_QChar::direction()
{ QChar::Symbol_Currency, "Sc" },
{ QChar::Symbol_Modifier, "Sk" },
{ QChar::Symbol_Other, "So" },
- { QChar::NoCategory, 0 }
+ { QChar::Other_NotAssigned, 0 }
};
Cat *c = categories;
while (c->name) {
}
UnicodeData data(codepoint);
- data.p.category = categoryMap.value(properties[UD_Category], QChar::NoCategory);
- if (data.p.category == QChar::NoCategory)
- qFatal("unassigned char category: %s", properties[UD_Category].constData());
-
+ data.p.category = categoryMap.value(properties[UD_Category], QChar::Other_NotAssigned);
data.p.combiningClass = properties[UD_CombiningClass].toInt();
if (!combiningClassUsage.contains(data.p.combiningClass))
combiningClassUsage[data.p.combiningClass] = 1;