remove more QApplication dependencies

This commit is contained in:
Lars Knoll 2011-05-03 21:14:05 +02:00
parent 5df3d517b4
commit f169264b7b
5 changed files with 9 additions and 16 deletions

View File

@ -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) {

View File

@ -138,7 +138,7 @@ QString QTextItem::text() const
QFont QTextItem::font() const
{
const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);
return ti->f ? *ti->f : QApplication::font();
return ti->f ? *ti->f : QGuiApplication::font();
}

View File

@ -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;

View File

@ -45,7 +45,7 @@
#include "qprinterinfo.h"
#include "qlist.h"
#include <qpagesetupdialog.h>
#include <qapplication.h>
#include <qcoreapplication.h>
#include <qfileinfo.h>
#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;

View File

@ -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)