diff --git a/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp b/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp index 4811e1b5431..af8c13e76d1 100644 --- a/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp +++ b/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.cpp @@ -386,10 +386,14 @@ private: static int widthLimit() { +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) auto screen = QGuiApplication::screenAt(QCursor::pos()); if (!screen) screen = QGuiApplication::primaryScreen(); return screen->availableGeometry().width() / 2; +#else + return QApplication::desktop()->availableGeometry(QCursor::pos()).width() / 2; +#endif } private: diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 2f8cef1d243..6f23a9df629 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -624,11 +624,15 @@ void DebuggerToolTipWidget::computeSize() // Add a bit of space to account for tooltip border, and not // touch the border of the screen. QPoint pos(x(), y()); - QTC_ASSERT(QApplication::desktop(), return); +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) auto screen = QGuiApplication::screenAt(pos); if (!screen) screen = QGuiApplication::primaryScreen(); QRect desktopRect = screen->availableGeometry(); +#else + QTC_ASSERT(QApplication::desktop(), return); + QRect desktopRect = QApplication::desktop()->availableGeometry(); +#endif const int maxWidth = desktopRect.right() - pos.x() - 5 - 5; const int maxHeight = desktopRect.bottom() - pos.y() - 5 - 5; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 51a7da5e31c..5ac69be40ce 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8252,7 +8252,11 @@ void TextEditorWidgetPrivate::updateTabStops() // to be set as an int. A work around is to access directly the QTextOption. qreal charWidth = QFontMetricsF(q->font()).width(QLatin1Char(' ')); QTextOption option = q->document()->defaultTextOption(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) option.setTabStopDistance(charWidth * m_document->tabSettings().m_tabSize); +#else + option.setTabStop(charWidth * m_document->tabSettings().m_tabSize); +#endif q->document()->setDefaultTextOption(option); }