remove more QApplication dependencies
This commit is contained in:
parent
5df3d517b4
commit
f169264b7b
@ -949,7 +949,7 @@ QRect qItemRect(QPainter *p, Qt::GUIStyle gs,
|
|||||||
x += w - pixmap->width();
|
x += w - pixmap->width();
|
||||||
else if ((flags & Qt::AlignHCenter) == Qt::AlignHCenter)
|
else if ((flags & Qt::AlignHCenter) == Qt::AlignHCenter)
|
||||||
x += w/2 - pixmap->width()/2;
|
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();
|
x += w - pixmap->width();
|
||||||
result = QRect(x, y, pixmap->width(), pixmap->height());
|
result = QRect(x, y, pixmap->width(), pixmap->height());
|
||||||
} else if (!text.isNull() && p) {
|
} else if (!text.isNull() && p) {
|
||||||
@ -1008,7 +1008,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs,
|
|||||||
x += w - pm.width();
|
x += w - pm.width();
|
||||||
else if ((flags & Qt::AlignHCenter) == Qt::AlignHCenter)
|
else if ((flags & Qt::AlignHCenter) == Qt::AlignHCenter)
|
||||||
x += w/2 - pm.width()/2;
|
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();
|
x += w - pm.width();
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
|
@ -138,7 +138,7 @@ QString QTextItem::text() const
|
|||||||
QFont QTextItem::font() const
|
QFont QTextItem::font() const
|
||||||
{
|
{
|
||||||
const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);
|
const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);
|
||||||
return ti->f ? *ti->f : QApplication::font();
|
return ti->f ? *ti->f : QGuiApplication::font();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6452,7 +6452,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
|
|||||||
const qreal underlinePos = pos.y() + qCeil(underlineOffset) - aliasedCoordinateDelta;
|
const qreal underlinePos = pos.y() + qCeil(underlineOffset) - aliasedCoordinateDelta;
|
||||||
|
|
||||||
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
|
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) {
|
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),
|
wx(0), wy(0), ww(0), wh(0), vx(0), vy(0), vw(0), vh(0),
|
||||||
opacity(1), WxF(false), VxF(false), clipEnabled(true),
|
opacity(1), WxF(false), VxF(false), clipEnabled(true),
|
||||||
bgMode(Qt::TransparentMode), painter(0),
|
bgMode(Qt::TransparentMode), painter(0),
|
||||||
layoutDirection(QApplication::layoutDirection()),
|
layoutDirection(QGuiApplication::layoutDirection()),
|
||||||
composition_mode(QPainter::CompositionMode_SourceOver),
|
composition_mode(QPainter::CompositionMode_SourceOver),
|
||||||
emulationSpecifier(0), changeFlags(0)
|
emulationSpecifier(0), changeFlags(0)
|
||||||
{
|
{
|
||||||
@ -8326,7 +8326,7 @@ void QPainterState::init(QPainter *p) {
|
|||||||
clipInfo.clear();
|
clipInfo.clear();
|
||||||
worldMatrix.reset();
|
worldMatrix.reset();
|
||||||
matrix.reset();
|
matrix.reset();
|
||||||
layoutDirection = QApplication::layoutDirection();
|
layoutDirection = QGuiApplication::layoutDirection();
|
||||||
composition_mode = QPainter::CompositionMode_SourceOver;
|
composition_mode = QPainter::CompositionMode_SourceOver;
|
||||||
emulationSpecifier = 0;
|
emulationSpecifier = 0;
|
||||||
dirtyFlags = 0;
|
dirtyFlags = 0;
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#include "qprinterinfo.h"
|
#include "qprinterinfo.h"
|
||||||
#include "qlist.h"
|
#include "qlist.h"
|
||||||
#include <qpagesetupdialog.h>
|
#include <qpagesetupdialog.h>
|
||||||
#include <qapplication.h>
|
#include <qcoreapplication.h>
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
|
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
|
||||||
#include "private/qcups_p.h"
|
#include "private/qcups_p.h"
|
||||||
@ -627,9 +627,9 @@ QPrinter::QPrinter(const QPrinterInfo& printer, PrinterMode mode)
|
|||||||
void QPrinter::init(PrinterMode mode)
|
void QPrinter::init(PrinterMode mode)
|
||||||
{
|
{
|
||||||
#if !defined(Q_WS_X11)
|
#if !defined(Q_WS_X11)
|
||||||
if (!qApp) {
|
if (!QCoreApplication::instance()) {
|
||||||
#else
|
#else
|
||||||
if (!qApp || !X11) {
|
if (!QCoreApplication::instance() || !X11) {
|
||||||
#endif
|
#endif
|
||||||
qFatal("QPrinter: Must construct a QApplication before a QPaintDevice");
|
qFatal("QPrinter: Must construct a QApplication before a QPaintDevice");
|
||||||
return;
|
return;
|
||||||
|
@ -116,12 +116,6 @@ QWindowSurface::QWindowSurface(QWindow *window, bool /*setDefaultSurface*/)
|
|||||||
{
|
{
|
||||||
if (window)
|
if (window)
|
||||||
window->d_func()->surface = this;
|
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 &)
|
void QWindowSurface::endPaint(const QRegion &)
|
||||||
{
|
{
|
||||||
// QApplication::syncX();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(Q_WS_QPA)
|
#if !defined(Q_WS_QPA)
|
||||||
|
Loading…
Reference in New Issue
Block a user