From 33013477adf4ce6a7dbb5b1c703d3fa35e0e9e37 Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Fri, 17 Jul 2026 07:58:20 +0000 Subject: [PATCH] physicalterminal.cpp: fix std::min template deduction under Qt6 QVector::size() (== QList::size() under Qt6) returns qsizetype (64-bit), while 'level' is a plain int. std::min(level, m_real_terminal.size()-1) therefore tries to deduce a single T from two different argument types, which fails - GCC reports it against the unrelated std::min(initializer_list) overload, but the real issue is the type mismatch between the two-argument candidates. Under Qt5, QVector::size() returned int, so this compiled fine. Force T=int explicitly via std::min(...) and cast size() down to int (physical terminal counts are always tiny), matching the pattern already used safely elsewhere in the codebase (e.g. qetgraphicstableitem.cpp). --- sources/TerminalStrip/physicalterminal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/TerminalStrip/physicalterminal.cpp b/sources/TerminalStrip/physicalterminal.cpp index b5d49acda..6af90d55f 100644 --- a/sources/TerminalStrip/physicalterminal.cpp +++ b/sources/TerminalStrip/physicalterminal.cpp @@ -131,7 +131,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer &terminal, if (i >= 0) { #if QT_VERSION >= QT_VERSION_CHECK(5,14,0) - m_real_terminal.swapItemsAt(i, std::min(level, m_real_terminal.size()-1)); + m_real_terminal.swapItemsAt(i, std::min(level, static_cast(m_real_terminal.size())-1)); #else auto j = std::min(level, m_real_terminal.size()-1); std::swap(m_real_terminal.begin()[i], m_real_terminal.begin()[j]);