summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-05-14 18:12:48 +0300
committerQt by Nokia <qt-info@nokia.com>2012-05-17 05:14:36 +0200
commit8babea35dd11fddb635494657f3ed362822ec6f2 (patch)
tree9d9bf4c93b18e500a7feb56a7185f27b83fcd965
parent601a707f66485450e6fad24c5964874592a87f09 (diff)
add some more widely-used QChar::SpecialCharacter enum values
Change-Id: Iad58f4366ba6cd6da29a268c56c8a4bc4cf0329c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r--src/corelib/tools/qchar.cpp4
-rw-r--r--src/corelib/tools/qchar.h4
-rw-r--r--src/gui/text/qtextengine.cpp4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 9c5a515dd7..cb5db973e1 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -366,6 +366,10 @@ QT_BEGIN_NAMESPACE
\enum QChar::SpecialCharacter
\value Null A QChar with this value isNull().
+ \value Tabulation Character tabulation.
+ \value LineFeed
+ \value CarriageReturn
+ \value Space
\value Nbsp Non-breaking space.
\value ReplacementCharacter The character shown when a font has no glyph
for a certain codepoint. A special question mark character is often
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 6c423859ec..63a8df32f4 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -67,6 +67,10 @@ class Q_CORE_EXPORT QChar {
public:
enum SpecialCharacter {
Null = 0x0000,
+ Tabulation = 0x0009,
+ LineFeed = 0x000a,
+ CarriageReturn = 0x000d,
+ Space = 0x0020,
Nbsp = 0x00a0,
ReplacementCharacter = 0xfffd,
ObjectReplacementCharacter = 0xfffc,
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 1bbadfb182..1694dd58f2 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1352,12 +1352,12 @@ void QTextEngine::itemize() const
if (option.flags() & QTextOption::ShowLineAndParagraphSeparators)
*const_cast<ushort*>(uc) = 0x21B5; // visual line separator
break;
- case 9: // Tab
+ case QChar::Tabulation:
analysis->script = QUnicodeTables::Common;
analysis->flags = QScriptAnalysis::Tab;
analysis->bidiLevel = control.baseLevel();
break;
- case 32: // Space
+ case QChar::Space:
case QChar::Nbsp:
if (option.flags() & QTextOption::ShowTabsAndSpaces) {
analysis->script = QUnicodeTables::Common;