From bec7a69c113bc0cd07b265379b6d62decbfb51c0 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sat, 27 Aug 2022 23:36:39 +0200 Subject: [PATCH] fix Qt 6 compile --- src/Screen.cpp | 2 +- src/Vt102Emulation.cpp | 14 +++++++------- src/terminalDisplay/TerminalPainter.cpp | 4 ++-- src/terminalDisplay/TerminalPainter.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Screen.cpp b/src/Screen.cpp index ef443bc8..a110eb6c 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -1714,7 +1714,7 @@ void Screen::selectReplContigious(const int x, const int y) if (row < _history->getLines()) { col = std::min(col, _history->getLineLen(row) - 1); } else { - col = std::min(col, _screenLines[row - _history->getLines()].size() - 1); + col = std::min(col, int(_screenLines[row - _history->getLines()].size()) - 1); } while (col > 0 && (getCharacter(col, row).flags & EF_REPL) == EF_REPL_NONE) { col--; diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index 14db6fd9..b50a11e5 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -1048,19 +1048,19 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u } if (attribute == 133) { - if (value[0] == L'A' || value[0] == L'N' || value[0] == L'P') { + if (value[0] == QLatin1Char('A') || value[0] == QLatin1Char('N') || value[0] == QLatin1Char('P')) { _currentScreen->setReplMode(REPL_PROMPT); } - if (value[0] == L'L' && _currentScreen->getCursorX() > 0) { + if (value[0] == QLatin1Char('L') && _currentScreen->getCursorX() > 0) { _currentScreen->nextLine(); } - if (value[0] == L'B') { + if (value[0] == QLatin1Char('B')) { _currentScreen->setReplMode(REPL_INPUT); } - if (value[0] == L'C') { + if (value[0] == QLatin1Char('C')) { _currentScreen->setReplMode(REPL_OUTPUT); } - if (value[0] == L'D') { + if (value[0] == QLatin1Char('D')) { _currentScreen->setReplMode(REPL_None); } } @@ -2671,9 +2671,9 @@ void Vt102Emulation::reportDecodingError(int token) } if ((token & 0xff) != 3) { // SCS - outputError.append((token >> 8) & 0xff); + outputError.append(QLatin1Char((token >> 8) & 0xff)); } else { - outputError.append((token >> 16) & 0xff); + outputError.append(QLatin1Char((token >> 16) & 0xff)); } qCDebug(KonsoleDebug).noquote() << outputError; diff --git a/src/terminalDisplay/TerminalPainter.cpp b/src/terminalDisplay/TerminalPainter.cpp index 4fe362a8..7e36884a 100644 --- a/src/terminalDisplay/TerminalPainter.cpp +++ b/src/terminalDisplay/TerminalPainter.cpp @@ -104,7 +104,7 @@ void TerminalPainter::drawContents(Character *image, QFont::Bold, QFont::Black, }; - const auto normalWeight = m_parentDisplay->font().weight(); + const QFont::Weight normalWeight = static_cast(m_parentDisplay->font().weight()); // Qt6: cast can go away auto it = std::upper_bound(std::begin(FontWeights), std::end(FontWeights), normalWeight); const QFont::Weight boldWeight = it != std::end(FontWeights) ? *it : QFont::Black; paint.setRenderHint(QPainter::Antialiasing, m_parentDisplay->terminalFont()->antialiasText()); @@ -886,7 +886,7 @@ void TerminalPainter::drawTextCharacters(QPainter &painter, bool printerFriendly, RenditionFlags &oldRendition, QColor oldColor, - int normalWeight, + QFont::Weight normalWeight, QFont::Weight boldWeight) { // setup painter diff --git a/src/terminalDisplay/TerminalPainter.h b/src/terminalDisplay/TerminalPainter.h index d013d5cd..5f600f64 100644 --- a/src/terminalDisplay/TerminalPainter.h +++ b/src/terminalDisplay/TerminalPainter.h @@ -127,7 +127,7 @@ private: bool printerFriendly, RenditionFlags &oldRendition, QColor oldColor, - int normalWeight, + QFont::Weight normalWeight, QFont::Weight boldWeight); };