fix Qt 6 compile

wilder
Christoph Cullmann 4 years ago
parent 8b140e23bd
commit bec7a69c11
  1. 2
      src/Screen.cpp
  2. 14
      src/Vt102Emulation.cpp
  3. 4
      src/terminalDisplay/TerminalPainter.cpp
  4. 2
      src/terminalDisplay/TerminalPainter.h

@ -1714,7 +1714,7 @@ void Screen::selectReplContigious(const int x, const int y)
if (row < _history->getLines()) { if (row < _history->getLines()) {
col = std::min(col, _history->getLineLen(row) - 1); col = std::min(col, _history->getLineLen(row) - 1);
} else { } 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) { while (col > 0 && (getCharacter(col, row).flags & EF_REPL) == EF_REPL_NONE) {
col--; col--;

@ -1048,19 +1048,19 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
} }
if (attribute == 133) { 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); _currentScreen->setReplMode(REPL_PROMPT);
} }
if (value[0] == L'L' && _currentScreen->getCursorX() > 0) { if (value[0] == QLatin1Char('L') && _currentScreen->getCursorX() > 0) {
_currentScreen->nextLine(); _currentScreen->nextLine();
} }
if (value[0] == L'B') { if (value[0] == QLatin1Char('B')) {
_currentScreen->setReplMode(REPL_INPUT); _currentScreen->setReplMode(REPL_INPUT);
} }
if (value[0] == L'C') { if (value[0] == QLatin1Char('C')) {
_currentScreen->setReplMode(REPL_OUTPUT); _currentScreen->setReplMode(REPL_OUTPUT);
} }
if (value[0] == L'D') { if (value[0] == QLatin1Char('D')) {
_currentScreen->setReplMode(REPL_None); _currentScreen->setReplMode(REPL_None);
} }
} }
@ -2671,9 +2671,9 @@ void Vt102Emulation::reportDecodingError(int token)
} }
if ((token & 0xff) != 3) { // SCS if ((token & 0xff) != 3) { // SCS
outputError.append((token >> 8) & 0xff); outputError.append(QLatin1Char((token >> 8) & 0xff));
} else { } else {
outputError.append((token >> 16) & 0xff); outputError.append(QLatin1Char((token >> 16) & 0xff));
} }
qCDebug(KonsoleDebug).noquote() << outputError; qCDebug(KonsoleDebug).noquote() << outputError;

@ -104,7 +104,7 @@ void TerminalPainter::drawContents(Character *image,
QFont::Bold, QFont::Bold,
QFont::Black, QFont::Black,
}; };
const auto normalWeight = m_parentDisplay->font().weight(); const QFont::Weight normalWeight = static_cast<QFont::Weight>(m_parentDisplay->font().weight()); // Qt6: cast can go away
auto it = std::upper_bound(std::begin(FontWeights), std::end(FontWeights), normalWeight); auto it = std::upper_bound(std::begin(FontWeights), std::end(FontWeights), normalWeight);
const QFont::Weight boldWeight = it != std::end(FontWeights) ? *it : QFont::Black; const QFont::Weight boldWeight = it != std::end(FontWeights) ? *it : QFont::Black;
paint.setRenderHint(QPainter::Antialiasing, m_parentDisplay->terminalFont()->antialiasText()); paint.setRenderHint(QPainter::Antialiasing, m_parentDisplay->terminalFont()->antialiasText());
@ -886,7 +886,7 @@ void TerminalPainter::drawTextCharacters(QPainter &painter,
bool printerFriendly, bool printerFriendly,
RenditionFlags &oldRendition, RenditionFlags &oldRendition,
QColor oldColor, QColor oldColor,
int normalWeight, QFont::Weight normalWeight,
QFont::Weight boldWeight) QFont::Weight boldWeight)
{ {
// setup painter // setup painter

@ -127,7 +127,7 @@ private:
bool printerFriendly, bool printerFriendly,
RenditionFlags &oldRendition, RenditionFlags &oldRendition,
QColor oldColor, QColor oldColor,
int normalWeight, QFont::Weight normalWeight,
QFont::Weight boldWeight); QFont::Weight boldWeight);
}; };

Loading…
Cancel
Save