8#include <QtCore/qregularexpression.h>
12static const char roman[] =
"m\2d\5c\2l\5x\2v\5i";
18 static const QRegularExpression hintSyntax(
"^(\\W*)([0-9]+|[A-Z]+|[a-z]+)(\\W*)$");
20 auto match = hintSyntax.match(hint);
21 if (match.hasMatch()) {
23 int asNumeric = hint.toInt(&ok);
24 int asRoman = fromRoman(match.captured(2));
25 int asAlpha = fromAlpha(match.captured(2));
30 }
else if (asRoman > 0 && asRoman != 100 && asRoman != 500) {
37 pref = match.captured(1);
38 suff = match.captured(3);
39 }
else if (!hint.isEmpty()) {
40 location.warning(QStringLiteral(
"Unrecognized list style '%1'").arg(hint));
70 return QString::number(number());
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
94 for (
const QChar &character : str) {
95 u = character.toLower().unicode();
96 if (u >=
'a' && u <=
'z') {
109
110
127 u = v /
roman[k - 1];
128 if (
roman[k - 1] == 2) {
150 for (
const QChar &character : str) {
153 while (roman[j] !=
'i' && roman[j] != character.toLower()) {
165 if (str.toLower() == toRoman(n)) {
#define ATOM_LIST_LOWERALPHA
#define ATOM_LIST_UPPERALPHA
#define ATOM_LIST_LOWERROMAN
#define ATOM_LIST_NUMERIC
#define ATOM_LIST_UPPERROMAN
The Location class provides a way to mark a location in a file.
QString numberString() const
OpenedList(const Location &location, const QString &hint)
QString styleString() const
OpenedList(ListStyle style)
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE const char roman[]