diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index bbd23c2a53..4eb38e6347 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -949,7 +949,7 @@ QRect qItemRect(QPainter *p, Qt::GUIStyle gs, x += w - pixmap->width(); else if ((flags & Qt::AlignHCenter) == Qt::AlignHCenter) x += w/2 - pixmap->width()/2; - else if ((flags & Qt::AlignLeft) != Qt::AlignLeft && QApplication::isRightToLeft()) + else if ((flags & Qt::AlignLeft) != Qt::AlignLeft && QGuiApplication::isRightToLeft()) x += w - pixmap->width(); result = QRect(x, y, pixmap->width(), pixmap->height()); } else if (!text.isNull() && p) { @@ -1008,7 +1008,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, x += w - pm.width(); else if ((flags & Qt::AlignHCenter) == Qt::AlignHCenter) x += w/2 - pm.width()/2; - else if (((flags & Qt::AlignLeft) != Qt::AlignLeft) && QApplication::isRightToLeft()) // Qt::AlignAuto && rightToLeft + else if (((flags & Qt::AlignLeft) != Qt::AlignLeft) && QGuiApplication::isRightToLeft()) // Qt::AlignAuto && rightToLeft x += w - pm.width(); if (!enabled) { diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 0b66a6caf1..97736263ed 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -138,7 +138,7 @@ QString QTextItem::text() const QFont QTextItem::font() const { const QTextItemInt *ti = static_cast(this); - return ti->f ? *ti->f : QApplication::font(); + return ti->f ? *ti->f : QGuiApplication::font(); } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 2b42f2158e..876b7f632d 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6452,7 +6452,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const const qreal underlinePos = pos.y() + qCeil(underlineOffset) - aliasedCoordinateDelta; if (underlineStyle == QTextCharFormat::SpellCheckUnderline) { - underlineStyle = QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle)); + underlineStyle = QTextCharFormat::SpellCheckUnderline; // ### Qt5 QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle)); } if (underlineStyle == QTextCharFormat::WaveUnderline) { @@ -8296,7 +8296,7 @@ QPainterState::QPainterState() wx(0), wy(0), ww(0), wh(0), vx(0), vy(0), vw(0), vh(0), opacity(1), WxF(false), VxF(false), clipEnabled(true), bgMode(Qt::TransparentMode), painter(0), - layoutDirection(QApplication::layoutDirection()), + layoutDirection(QGuiApplication::layoutDirection()), composition_mode(QPainter::CompositionMode_SourceOver), emulationSpecifier(0), changeFlags(0) { @@ -8326,7 +8326,7 @@ void QPainterState::init(QPainter *p) { clipInfo.clear(); worldMatrix.reset(); matrix.reset(); - layoutDirection = QApplication::layoutDirection(); + layoutDirection = QGuiApplication::layoutDirection(); composition_mode = QPainter::CompositionMode_SourceOver; emulationSpecifier = 0; dirtyFlags = 0; diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index 5111bf4e2d..2baa1ddab2 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -45,7 +45,7 @@ #include "qprinterinfo.h" #include "qlist.h" #include -#include +#include #include #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) #include "private/qcups_p.h" @@ -627,9 +627,9 @@ QPrinter::QPrinter(const QPrinterInfo& printer, PrinterMode mode) void QPrinter::init(PrinterMode mode) { #if !defined(Q_WS_X11) - if (!qApp) { + if (!QCoreApplication::instance()) { #else - if (!qApp || !X11) { + if (!QCoreApplication::instance() || !X11) { #endif qFatal("QPrinter: Must construct a QApplication before a QPaintDevice"); return; diff --git a/src/gui/painting/qwindowsurface.cpp b/src/gui/painting/qwindowsurface.cpp index f6167696ac..13d152175d 100644 --- a/src/gui/painting/qwindowsurface.cpp +++ b/src/gui/painting/qwindowsurface.cpp @@ -116,12 +116,6 @@ QWindowSurface::QWindowSurface(QWindow *window, bool /*setDefaultSurface*/) { if (window) window->d_func()->surface = this; -#if 0 - if (!QApplicationPrivate::runtime_graphics_system) { - if (setDefaultSurface && window) - window->setWindowSurface(this); - } -#endif } /*! @@ -149,7 +143,6 @@ void QWindowSurface::beginPaint(const QRegion &) void QWindowSurface::endPaint(const QRegion &) { -// QApplication::syncX(); } #if !defined(Q_WS_QPA)