diff --git a/src/libs/clangsupport/nativefilepath.h b/src/libs/clangsupport/nativefilepath.h index fefaa9c2057..62234dd6fd4 100644 --- a/src/libs/clangsupport/nativefilepath.h +++ b/src/libs/clangsupport/nativefilepath.h @@ -171,7 +171,7 @@ public: template static NativeFilePath fromFilePath(String filePath) { - Utils::PathString nativePath{filePath.data(), filePath.size()}; + Utils::PathString nativePath{filePath.data(), size_type(filePath.size())}; if (Utils::HostOsInfo::isWindowsHost()) nativePath.replace('/', '\\'); diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index 6c0def6e3ca..a233b8c58c0 100644 --- a/src/plugins/coreplugin/fancytabwidget.cpp +++ b/src/plugins/coreplugin/fancytabwidget.cpp @@ -184,13 +184,13 @@ void FancyTabBar::leaveEvent(QEvent *event) QSize FancyTabBar::sizeHint() const { const QSize sh = tabSizeHint(); - return {sh.width(), sh.height() * m_tabs.count()}; + return {sh.width(), sh.height() * int(m_tabs.count())}; } QSize FancyTabBar::minimumSizeHint() const { const QSize sh = tabSizeHint(true); - return {sh.width(), sh.height() * m_tabs.count()}; + return {sh.width(), sh.height() * int(m_tabs.count())}; } QRect FancyTabBar::tabRect(int index) const diff --git a/src/plugins/coreplugin/locator/commandlocator.cpp b/src/plugins/coreplugin/locator/commandlocator.cpp index f2b83e74e37..c3cc9740a9a 100644 --- a/src/plugins/coreplugin/locator/commandlocator.cpp +++ b/src/plugins/coreplugin/locator/commandlocator.cpp @@ -90,7 +90,7 @@ QList CommandLocator::matchesFor(QFutureInterface= 0) { LocatorFilterEntry filterEntry(this, text, QVariant(i)); - filterEntry.highlightInfo = {index, entry.length()}; + filterEntry.highlightInfo = {index, int(entry.length())}; if (index == 0) betterEntries.append(filterEntry); diff --git a/src/plugins/coreplugin/locator/executefilter.cpp b/src/plugins/coreplugin/locator/executefilter.cpp index ea983a34f56..b827b601910 100644 --- a/src/plugins/coreplugin/locator/executefilter.cpp +++ b/src/plugins/coreplugin/locator/executefilter.cpp @@ -69,7 +69,7 @@ QList ExecuteFilter::matchesFor(QFutureInterface= 0) { - filterEntry.highlightInfo = {index, entry.length()}; + filterEntry.highlightInfo = {index, int(entry.length())}; value.append(filterEntry); } else { others.append(filterEntry); diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index e545b8313c3..cb2e49e68b0 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -319,8 +319,9 @@ void CenteredLocatorPopup::updateGeometry() QTC_ASSERT(parentWidget(), return); const QSize size = preferredSize(); const QSize parentSize = parentWidget()->size(); - const QPoint pos = parentWidget()->mapToGlobal({(parentSize.width() - size.width()) / 2, - parentSize.height() / 2 - size.height()}); + const QPoint local((parentSize.width() - size.width()) / 2, + parentSize.height() / 2 - size.height()); + const QPoint pos = parentWidget()->mapToGlobal(local); QRect rect(pos, size); // invisible widget doesn't have the right screen set yet, so use the parent widget to // check for available geometry diff --git a/src/plugins/coreplugin/locator/urllocatorfilter.cpp b/src/plugins/coreplugin/locator/urllocatorfilter.cpp index 194a3f620f3..626d820855c 100644 --- a/src/plugins/coreplugin/locator/urllocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/urllocatorfilter.cpp @@ -152,7 +152,7 @@ QList UrlLocatorFilter::matchesFor( break; const QString name = url.arg(entry); Core::LocatorFilterEntry filterEntry(this, name, QVariant(), m_icon); - filterEntry.highlightInfo = {name.lastIndexOf(entry), entry.length()}; + filterEntry.highlightInfo = {int(name.lastIndexOf(entry)), int(entry.length())}; entries.append(filterEntry); } return entries; diff --git a/src/plugins/help/helpindexfilter.cpp b/src/plugins/help/helpindexfilter.cpp index d3d78cf0f70..45d2ba63882 100644 --- a/src/plugins/help/helpindexfilter.cpp +++ b/src/plugins/help/helpindexfilter.cpp @@ -202,7 +202,7 @@ QList HelpIndexFilter::matchesFor(QFutureInterface #include +#include #include namespace Help { diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index 8c6e1c2b331..c03c465f8e0 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -108,7 +108,7 @@ void OutputTaskParser::setDetailsFormat(Task &task, const LinkSpecs &linkSpecs) task.formats.clear(); int offset = task.summary.length() + 1; for (const Utils::FormattedText &ft : linkifiedText) { - task.formats << QTextLayout::FormatRange{offset, ft.text.length(), ft.format}; + task.formats << QTextLayout::FormatRange{offset, int(ft.text.length()), ft.format}; offset += ft.text.length(); } } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp index ff0fcde7d44..51ffd37b91c 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.cpp @@ -99,7 +99,7 @@ Core::GeneratedFiles JsonWizardScannerGenerator::fileList(Utils::MacroExpander * result = scan(project.absolutePath(), project); - static const auto getDepth = [](const QString &filePath) { return filePath.count('/'); }; + static const auto getDepth = [](const QString &filePath) { return int(filePath.count('/')); }; int minDepth = std::numeric_limits::max(); for (auto it = result.begin(); it != result.end(); ++it) { const QString relPath = project.relativeFilePath(it->path()); diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index f8ebbf16903..238beb0f460 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -93,7 +93,7 @@ private: const QStringList elements = line.split(QLatin1Char('\n')); if (elements.count() < 4) { qDebug("%s: Expected four list elements, got %d. Line was '%s'.", Q_FUNC_INFO, - elements.count(), qPrintable(visualizeNull(line))); + int(elements.count()), qPrintable(visualizeNull(line))); continue; } bool ok; diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index bfa0f85a866..2c2c9d0648b 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -475,7 +475,7 @@ void SyntaxHighlighter::formatSpaces(const QString &text, int start, int count) { Q_D(const SyntaxHighlighter); int offset = start; - const int end = std::min(start + count, text.length()); + const int end = std::min(start + count, int(text.length())); while (offset < end) { if (text.at(offset).isSpace()) { int start = offset++; @@ -503,7 +503,7 @@ void SyntaxHighlighter::setFormatWithSpaces(const QString &text, int start, int QTextCharFormat visualSpaceFormat = d->whitespaceFormat; visualSpaceFormat.setBackground(format.background()); - const int end = std::min(start + count, text.length()); + const int end = std::min(start + count, int(text.length())); int index = start; while (index != end) { diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index 83ee58e277f..0146e4e1982 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -284,7 +284,7 @@ void IntroductionWidget::paintEvent(QPaintEvent *) p.setOpacity(.87); const QColor backgroundColor = Qt::black; if (m_stepPointerAnchor) { - const QPoint anchorPos = m_stepPointerAnchor->mapTo(parentWidget(), {0, 0}); + const QPoint anchorPos = m_stepPointerAnchor->mapTo(parentWidget(), QPoint{0, 0}); const QRect anchorRect(anchorPos, m_stepPointerAnchor->size()); const QRect spotlightRect = anchorRect.adjusted(-SPOTLIGHTMARGIN, -SPOTLIGHTMARGIN,