forked from qt-creator/qt-creator
Fix build with Qt6
Some type issues (int vs long long, int vs QFont::Weight), no "midRef" any more. Task-number: QTCREATORBUG-24098 Change-Id: Id39f70edc14832baaeebb2572bca5491deadaf1d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -291,8 +291,9 @@ void ActivationSequenceContextProcessor::goBackToStartOfName()
|
||||
const int tokIndex = CPlusPlus::SimpleLexer::tokenAt(tokens, tokenPos);
|
||||
if (tokIndex > -1 && tokens.at(tokIndex).isStringLiteral()) {
|
||||
const int tokenStart = tokens.at(tokIndex).utf16charOffset;
|
||||
const int slashIndex = m_textCursor.block().text().lastIndexOf('/',
|
||||
std::min(m_textCursor.positionInBlock(), m_textCursor.block().text().length() - 1));
|
||||
const int slashIndex = m_textCursor.block().text().lastIndexOf(
|
||||
'/',
|
||||
std::min(m_textCursor.positionInBlock(), int(m_textCursor.block().text().length() - 1)));
|
||||
m_startOfNamePosition = m_textCursor.block().position() + std::max(slashIndex, tokenStart)
|
||||
+ 1;
|
||||
} else {
|
||||
|
||||
@@ -227,7 +227,7 @@ static QString replaceEntities(const QString &original)
|
||||
const QRegularExpressionMatch match = it.next();
|
||||
const QString value = match.captured(1);
|
||||
if (value.startsWith('x'))
|
||||
result.replace(match.captured(0), QChar(value.midRef(1).toInt(nullptr, 16)));
|
||||
result.replace(match.captured(0), QChar(value.mid(1).toInt(nullptr, 16)));
|
||||
else
|
||||
result.replace(match.captured(0), QChar(value.toInt(nullptr, 10)));
|
||||
}
|
||||
|
||||
@@ -2267,7 +2267,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings()
|
||||
dd->m_buildPropertiesSettings.qtQuickCompiler.toVariant(),
|
||||
TriState::Default.toVariant());
|
||||
|
||||
s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, dd->m_customParsers.count(), 0);
|
||||
s->setValueWithDefault(Constants::CUSTOM_PARSER_COUNT_KEY, int(dd->m_customParsers.count()), 0);
|
||||
for (int i = 0; i < dd->m_customParsers.count(); ++i) {
|
||||
s->setValue(Constants::CUSTOM_PARSER_PREFIX_KEY + QString::number(i),
|
||||
dd->m_customParsers.at(i).toMap());
|
||||
|
||||
@@ -81,7 +81,11 @@ void ImageCacheFontCollector::start(Utils::SmallStringView name,
|
||||
QFont font(fontFamily);
|
||||
font.setStyle(rawFont.style());
|
||||
font.setStyleName(rawFont.styleName());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
font.setWeight(QFont::Weight(rawFont.weight()));
|
||||
#else
|
||||
font.setWeight(rawFont.weight());
|
||||
#endif
|
||||
QImage image(size, QImage::Format_ARGB32);
|
||||
image.fill(Qt::transparent);
|
||||
int pixelSize(200);
|
||||
|
||||
Reference in New Issue
Block a user