mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Merge pull request #375 from plc-user/master
bordertitleblock: use same code for Qt5 & Qt6 for "numbering" rows
This commit is contained in:
@@ -941,19 +941,12 @@ QString BorderTitleBlock::incrementLetters(const QString &string) {
|
|||||||
} else {
|
} else {
|
||||||
// separate previous digits from last digit
|
// separate previous digits from last digit
|
||||||
// separe les digits precedents du dernier digit
|
// separe les digits precedents du dernier digit
|
||||||
QString first_digits(string.left(string.count() - 1));
|
QString first_digits(string.left(string.length() - 1));
|
||||||
QChar last_digit(string.at(string.count() - 1));
|
char last_digit(string.at(string.length() - 1).unicode());
|
||||||
if (last_digit != 'Z') {
|
if (last_digit != 'Z') {
|
||||||
// increments the last digit
|
// increments the last digit
|
||||||
// incremente le dernier digit
|
// incremente le dernier digit
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
last_digit = (char)(string[string.length()-1].unicode()) + 1;
|
||||||
last_digit = last_digit.toLatin1() + 1;
|
|
||||||
#else
|
|
||||||
# if TODO_LIST
|
|
||||||
# pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
# endif
|
|
||||||
qDebug() << "Help code for QT 6 or later";
|
|
||||||
#endif
|
|
||||||
return(first_digits + QString(last_digit));
|
return(first_digits + QString(last_digit));
|
||||||
} else {
|
} else {
|
||||||
return(incrementLetters(first_digits) + "A");
|
return(incrementLetters(first_digits) + "A");
|
||||||
|
|||||||
Reference in New Issue
Block a user