aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-08-30 13:17:00 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-09-01 13:35:08 +0200
commit1259c5768e410361bcd8b5cf0c2057a2ebabda83 (patch)
tree4cb0444f1272506fd0cc788d45fccf601138ef72
parente4ba808305952dd313b495f20300ec6e2c3801ac (diff)
Remove the remaining dependencies onto QtWidgets
Change-Id: I49efc4d0af4c19c24515ecfaa5c549e36f442cc8 Reviewed-on: http://codereview.qt.nokia.com/3992 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
-rw-r--r--modules/qt_declarative.pri2
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp4
-rw-r--r--src/declarative/declarative.pro2
-rw-r--r--src/declarative/items/context2d/qsgcontext2d.cpp11
-rw-r--r--src/declarative/items/qsganimation.cpp1
-rw-r--r--src/declarative/items/qsgcanvas.cpp8
-rw-r--r--src/declarative/items/qsgcanvas.h2
-rw-r--r--src/declarative/items/qsgcanvas_p.h2
-rw-r--r--src/declarative/items/qsgflickable.cpp11
-rw-r--r--src/declarative/items/qsgitem.cpp7
-rw-r--r--src/declarative/items/qsgitem.h1
-rw-r--r--src/declarative/items/qsgitemsmodule.cpp3
-rw-r--r--src/declarative/items/qsgmousearea.cpp3
-rw-r--r--src/declarative/items/qsgmousearea_p.h2
-rw-r--r--src/declarative/items/qsgpainteditem.h1
-rw-r--r--src/declarative/items/qsgpainteditem_p.h1
-rw-r--r--src/declarative/items/qsgpathview.cpp5
-rw-r--r--src/declarative/items/qsgpincharea.cpp5
-rw-r--r--src/declarative/items/qsgtext.cpp4
-rw-r--r--src/declarative/items/qsgtextedit.cpp12
-rw-r--r--src/declarative/items/qsgtextedit_p_p.h1
-rw-r--r--src/declarative/items/qsgtextinput.cpp24
-rw-r--r--src/declarative/items/qsgtextnode_p.h2
-rw-r--r--src/declarative/particles/qsgimageparticle_p.h1
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp1
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp1
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp16
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp16
-rw-r--r--src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp2
-rw-r--r--src/declarative/scenegraph/coreapi/qsgrenderer.cpp4
-rw-r--r--src/declarative/scenegraph/qsgcontext.cpp2
-rw-r--r--src/declarative/scenegraph/qsgcontextplugin.cpp4
-rw-r--r--src/declarative/scenegraph/util/qsgpainternode_p.h2
-rw-r--r--src/declarative/util/qdeclarativeapplication.cpp8
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp1
-rw-r--r--src/declarative/util/qdeclarativesystempalette.cpp8
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp1
38 files changed, 84 insertions, 99 deletions
diff --git a/modules/qt_declarative.pri b/modules/qt_declarative.pri
index ef7db54a2b..54727d462a 100644
--- a/modules/qt_declarative.pri
+++ b/modules/qt_declarative.pri
@@ -11,7 +11,7 @@ QT.declarative.sources = $$QT_MODULE_BASE/src/declarative
QT.declarative.libs = $$QT_MODULE_LIB_BASE
QT.declarative.plugins = $$QT_MODULE_PLUGIN_BASE
QT.declarative.imports = $$QT_MODULE_IMPORT_BASE
-QT.declarative.depends = gui network opengl xmlpatterns
+QT.declarative.depends = gui network xmlpatterns
QT.declarative.DEFINES = QT_DECLARATIVE_LIB
QT_CONFIG += declarative
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index e7785d0f90..6e2db4f605 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -49,7 +49,7 @@
#include <QtCore/QStringList>
#include <private/qobject_p.h>
-#include <private/qapplication_p.h>
+#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
@@ -167,7 +167,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (!commandLineTested) {
commandLineTested = true;
- QApplicationPrivate *appD = static_cast<QApplicationPrivate*>(QObjectPrivate::get(qApp));
+ QGuiApplicationPrivate *appD = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL
// ### remove port definition when protocol is changed
int port = 0;
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
index 78717c9254..4e5ff4c17d 100644
--- a/src/declarative/declarative.pro
+++ b/src/declarative/declarative.pro
@@ -6,7 +6,7 @@ QPRO_PWD = $$PWD
CONFIG += module
MODULE_PRI += ../../modules/qt_declarative.pri
-QT = core-private gui gui-private network widgets-private sql v8-private
+QT = core-private gui gui-private network sql v8-private
DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp
index 22a9c7029e..7a8465a4bc 100644
--- a/src/declarative/items/context2d/qsgcontext2d.cpp
+++ b/src/declarative/items/context2d/qsgcontext2d.cpp
@@ -47,9 +47,7 @@
#include <QtCore/qdebug.h>
#include "private/qsgcontext_p.h"
-#include <QtWidgets/qgraphicsitem.h>
-#include <QtWidgets/qapplication.h>
-#include <QtWidgets/qgraphicseffect.h>
+#include <QtGui/qguiapplication.h>
#include <qdeclarativeinfo.h>
#include <QtCore/qmath.h>
#include "qdeclarativepixmapcache_p.h"
@@ -78,10 +76,6 @@ void copy_vector(QVector<T>* dst, const QVector<T>& src)
}
}
-// Note, this is exported but in a private header as qtopengl depends on it.
-// But it really should be considered private API
-void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0);
-void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed = 0);
static bool parsePathDataFast(const QString &dataStr, QPainterPath &path);
#define DEGREES(t) ((t) * 180.0 / Q_PI)
#define qClamp(val, min, max) qMin(qMax(val, min), max)
@@ -1322,6 +1316,8 @@ QImage QSGContext2DPrivate::makeShadowImage(const QPixmap& pix)
tmpPainter.drawPixmap(shadowX, shadowY, pix);
tmpPainter.end();
+#if 0
+ // ### refactor
// blur the alpha channel
if (state.shadowBlur > 0) {
QImage blurred(shadowImg.size(), QImage::Format_ARGB32);
@@ -1331,6 +1327,7 @@ QImage QSGContext2DPrivate::makeShadowImage(const QPixmap& pix)
blurPainter.end();
shadowImg = blurred;
}
+#endif
// blacken the image with shadow color...
tmpPainter.begin(&shadowImg);
diff --git a/src/declarative/items/qsganimation.cpp b/src/declarative/items/qsganimation.cpp
index 446dc5a7c7..0822974397 100644
--- a/src/declarative/items/qsganimation.cpp
+++ b/src/declarative/items/qsganimation.cpp
@@ -47,6 +47,7 @@
#include <QtCore/qmath.h>
#include <QtCore/qsequentialanimationgroup.h>
#include <QtCore/qparallelanimationgroup.h>
+#include <QtGui/qtransform.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp
index f97028a3fc..96af2a5f3a 100644
--- a/src/declarative/items/qsgcanvas.cpp
+++ b/src/declarative/items/qsgcanvas.cpp
@@ -115,7 +115,7 @@ public:
virtual void maybeUpdate() {
if (!updatePending) {
- QApplication::postEvent(this, new QEvent(QEvent::User));
+ QCoreApplication::postEvent(this, new QEvent(QEvent::User));
updatePending = true;
}
}
@@ -839,7 +839,7 @@ bool QSGCanvasPrivate::clearHover()
bool accepted = false;
foreach (QSGItem* item, hoverItems)
- accepted = sendHoverEvent(QEvent::HoverLeave, item, pos, pos, QApplication::keyboardModifiers(), true) || accepted;
+ accepted = sendHoverEvent(QEvent::HoverLeave, item, pos, pos, QGuiApplication::keyboardModifiers(), true) || accepted;
hoverItems.clear();
return accepted;
}
@@ -1888,7 +1888,7 @@ void QSGCanvasRenderThread::run()
#ifdef THREAD_DEBUG
printf(" RenderThread: aquired sync lock...\n");
#endif
- QApplication::postEvent(this, new QEvent(QEvent::User));
+ QCoreApplication::postEvent(this, new QEvent(QEvent::User));
#ifdef THREAD_DEBUG
printf(" RenderThread: going to sleep...\n");
#endif
@@ -2251,7 +2251,7 @@ QImage QSGCanvasRenderThread::grab()
void QSGCanvasRenderThread::maybeUpdate()
{
- Q_ASSERT_X(QThread::currentThread() == QApplication::instance()->thread() || inSync,
+ Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread() || inSync,
"QSGCanvas::update",
"Function can only be called from GUI thread or during QSGItem::updatePaintNode()");
diff --git a/src/declarative/items/qsgcanvas.h b/src/declarative/items/qsgcanvas.h
index e364ee88f5..b396788e73 100644
--- a/src/declarative/items/qsgcanvas.h
+++ b/src/declarative/items/qsgcanvas.h
@@ -44,7 +44,7 @@
#include <QtCore/qmetatype.h>
#include <QtGui/qopengl.h>
-#include <QtWidgets/qwidget.h>
+#include <QtGui/qwindow.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/items/qsgcanvas_p.h b/src/declarative/items/qsgcanvas_p.h
index 6915bffa04..acd52a8a2a 100644
--- a/src/declarative/items/qsgcanvas_p.h
+++ b/src/declarative/items/qsgcanvas_p.h
@@ -63,11 +63,11 @@
#include <QtCore/qthread.h>
#include <QtCore/qmutex.h>
#include <QtCore/qwaitcondition.h>
-#include <private/qwidget_p.h>
#include <private/qwindow_p.h>
#include <private/qopengl_p.h>
#include <qopenglcontext.h>
#include <QtGui/qopenglframebufferobject.h>
+#include <QtGui/qevent.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/items/qsgflickable.cpp b/src/declarative/items/qsgflickable.cpp
index 92554f8e79..21474be8d9 100644
--- a/src/declarative/items/qsgflickable.cpp
+++ b/src/declarative/items/qsgflickable.cpp
@@ -46,7 +46,8 @@
#include <QtDeclarative/qdeclarativeinfo.h>
#include <QtGui/qevent.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qstylehints.h>
#include "qplatformdefs.h"
QT_BEGIN_NAMESPACE
@@ -821,7 +822,7 @@ void QSGFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
if (q->yflick()) {
int dy = int(event->localPos().y() - pressPos.y());
- if (qAbs(dy) > QApplication::startDragDistance() || QSGItemPrivate::elapsed(pressTime) > 200) {
+ if (qAbs(dy) > qApp->styleHints()->startDragDistance() || QSGItemPrivate::elapsed(pressTime) > 200) {
if (!vMoved)
vData.dragStartOffset = dy;
qreal newY = dy + vData.pressPos - vData.dragStartOffset;
@@ -846,14 +847,14 @@ void QSGFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
vData.move.setValue(qRound(newY));
vMoved = true;
}
- if (qAbs(dy) > QApplication::startDragDistance())
+ if (qAbs(dy) > qApp->styleHints()->startDragDistance())
stealY = true;
}
}
if (q->xflick()) {
int dx = int(event->localPos().x() - pressPos.x());
- if (qAbs(dx) > QApplication::startDragDistance() || QSGItemPrivate::elapsed(pressTime) > 200) {
+ if (qAbs(dx) > qApp->styleHints()->startDragDistance() || QSGItemPrivate::elapsed(pressTime) > 200) {
if (!hMoved)
hData.dragStartOffset = dx;
qreal newX = dx + hData.pressPos - hData.dragStartOffset;
@@ -879,7 +880,7 @@ void QSGFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
hMoved = true;
}
- if (qAbs(dx) > QApplication::startDragDistance())
+ if (qAbs(dx) > qApp->styleHints()->startDragDistance())
stealX = true;
}
}
diff --git a/src/declarative/items/qsgitem.cpp b/src/declarative/items/qsgitem.cpp
index c7df26dc0c..765fe349ca 100644
--- a/src/declarative/items/qsgitem.cpp
+++ b/src/declarative/items/qsgitem.cpp
@@ -51,8 +51,8 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeinfo.h>
-#include <QtWidgets/qgraphicstransform.h>
#include <QtGui/qpen.h>
+#include <QtGui/qcursor.h>
#include <QtCore/qdebug.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qnumeric.h>
@@ -2240,8 +2240,6 @@ void QSGItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObjec
// This test is measurably (albeit only slightly) faster than qobject_cast<>()
const QMetaObject *mo = o->metaObject();
while (mo && mo != &QSGItem::staticMetaObject) {
- if (mo == &QGraphicsObject::staticMetaObject)
- qWarning("Cannot add a QtQuick 1.0 item (%s) into a QtQuick 2.0 scene!", o->metaObject()->className());
mo = mo->d.superdata;
}
@@ -2249,6 +2247,9 @@ void QSGItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObjec
QSGItem *item = static_cast<QSGItem *>(o);
item->setParentItem(that);
} else {
+ if (o->inherits("QGraphicsItem"))
+ qWarning("Cannot add a QtQuick 1.0 item (%s) into a QtQuick 2.0 scene!", o->metaObject()->className());
+
// XXX todo - do we really want this behavior?
o->setParent(that);
}
diff --git a/src/declarative/items/qsgitem.h b/src/declarative/items/qsgitem.h
index bff32e3f65..9cd549d3b8 100644
--- a/src/declarative/items/qsgitem.h
+++ b/src/declarative/items/qsgitem.h
@@ -50,7 +50,6 @@
#include <QtCore/QList>
#include <QtGui/qevent.h>
#include <QtGui/qfont.h>
-#include <QtWidgets/qaction.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/items/qsgitemsmodule.cpp b/src/declarative/items/qsgitemsmodule.cpp
index 9547dc01cc..0d147d31fc 100644
--- a/src/declarative/items/qsgitemsmodule.cpp
+++ b/src/declarative/items/qsgitemsmodule.cpp
@@ -157,9 +157,6 @@ static void qt_sgitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QValidator>();
#endif
qmlRegisterType<QSGVisualModel>();
-#ifndef QT_NO_ACTION
- qmlRegisterType<QAction>();
-#endif
qmlRegisterType<QSGPen>();
qmlRegisterType<QSGFlickableVisibleArea>();
qRegisterMetaType<QSGAnchorLine>("QSGAnchorLine");
diff --git a/src/declarative/items/qsgmousearea.cpp b/src/declarative/items/qsgmousearea.cpp
index 547df313d2..cae0be60c5 100644
--- a/src/declarative/items/qsgmousearea.cpp
+++ b/src/declarative/items/qsgmousearea.cpp
@@ -47,6 +47,7 @@
#include <QtGui/qevent.h>
#include <QtGui/qguiapplication.h>
+#include <QtGui/qstylehints.h>
#include <float.h>
@@ -760,7 +761,7 @@ void QSGMouseArea::mouseMoveEvent(QMouseEvent *event)
curLocalPos = event->windowPos();
}
- const int dragThreshold = 20; // ### refactor: QGuiApplication::startDragDistance();
+ const int dragThreshold = qApp->styleHints()->startDragDistance();
qreal dx = qAbs(curLocalPos.x() - startLocalPos.x());
qreal dy = qAbs(curLocalPos.y() - startLocalPos.y());
diff --git a/src/declarative/items/qsgmousearea_p.h b/src/declarative/items/qsgmousearea_p.h
index c7d3cb79f1..0ec9c6b335 100644
--- a/src/declarative/items/qsgmousearea_p.h
+++ b/src/declarative/items/qsgmousearea_p.h
@@ -45,6 +45,8 @@
#include "qsgitem.h"
+#include <QtCore/qstringlist.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/items/qsgpainteditem.h b/src/declarative/items/qsgpainteditem.h
index 3fc8fb890f..244e24b18c 100644
--- a/src/declarative/items/qsgpainteditem.h
+++ b/src/declarative/items/qsgpainteditem.h
@@ -43,6 +43,7 @@
#define QSGPAINTEDITEM_P_H
#include <qsgitem.h>
+#include <QtGui/qcolor.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/items/qsgpainteditem_p.h b/src/declarative/items/qsgpainteditem_p.h
index 87b9f6890d..3ad44660a1 100644
--- a/src/declarative/items/qsgpainteditem_p.h
+++ b/src/declarative/items/qsgpainteditem_p.h
@@ -44,6 +44,7 @@
#define QSGPAINTEDITEM_P_P_H
#include "qsgitem_p.h"
+#include <QtGui/qcolor.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/items/qsgpathview.cpp b/src/declarative/items/qsgpathview.cpp
index d37f7101a1..11733df53e 100644
--- a/src/declarative/items/qsgpathview.cpp
+++ b/src/declarative/items/qsgpathview.cpp
@@ -49,7 +49,8 @@
#include <QtGui/qevent.h>
#include <QtGui/qevent.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qstylehints.h>
#include <QtCore/qmath.h>
#include <math.h>
@@ -1163,7 +1164,7 @@ void QSGPathViewPrivate::handleMouseMoveEvent(QMouseEvent *event)
QPointF pathPoint = pointNear(event->localPos(), &newPc);
if (!stealMouse) {
QPointF delta = pathPoint - startPoint;
- if (qAbs(delta.x()) > QApplication::startDragDistance() || qAbs(delta.y()) > QApplication::startDragDistance()) {
+ if (qAbs(delta.x()) > qApp->styleHints()->startDragDistance() || qAbs(delta.y()) > qApp->styleHints()->startDragDistance()) {
stealMouse = true;
startPc = newPc;
}
diff --git a/src/declarative/items/qsgpincharea.cpp b/src/declarative/items/qsgpincharea.cpp
index 6d89414cd0..d02477ee34 100644
--- a/src/declarative/items/qsgpincharea.cpp
+++ b/src/declarative/items/qsgpincharea.cpp
@@ -43,7 +43,8 @@
#include "qsgcanvas.h"
#include <QtGui/qevent.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
+#include <QtGui/qstylehints.h>
#include <float.h>
#include <math.h>
@@ -341,7 +342,7 @@ void QSGPinchArea::updatePinch()
d->initPinch = true;
}
if (d->pinchActivated && !d->pinchRejected){
- const int dragThreshold = QApplication::startDragDistance();
+ const int dragThreshold = qApp->styleHints()->startDragDistance();
QPointF p1 = touchPoint1.scenePos();
QPointF p2 = touchPoint2.scenePos();
qreal dx = p1.x() - p2.x();
diff --git a/src/declarative/items/qsgtext.cpp b/src/declarative/items/qsgtext.cpp
index da34cc6d56..a00a217ee3 100644
--- a/src/declarative/items/qsgtext.cpp
+++ b/src/declarative/items/qsgtext.cpp
@@ -56,7 +56,7 @@
#include <QtGui/qtextdocument.h>
#include <QtGui/qtextobject.h>
#include <QtGui/qtextcursor.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
#include <private/qdeclarativestyledtext_p.h>
#include <private/qdeclarativepixmapcache_p.h>
@@ -1166,7 +1166,7 @@ bool QSGTextPrivate::determineHorizontalAlignment()
{
Q_Q(QSGText);
if (hAlignImplicit && q->isComponentComplete()) {
- bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ bool alignToRight = text.isEmpty() ? QGuiApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
return setHAlign(alignToRight ? QSGText::AlignRight : QSGText::AlignLeft);
}
return false;
diff --git a/src/declarative/items/qsgtextedit.cpp b/src/declarative/items/qsgtextedit.cpp
index 6b9e4436a7..1f1de8ed49 100644
--- a/src/declarative/items/qsgtextedit.cpp
+++ b/src/declarative/items/qsgtextedit.cpp
@@ -47,7 +47,7 @@
#include "qsgsimplerectnode.h"
#include <QtDeclarative/qdeclarativeinfo.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
#include <QtGui/qevent.h>
#include <QtGui/qpainter.h>
#include <QtGui/qtextobject.h>
@@ -56,7 +56,6 @@
#include <private/qdeclarativeglobal_p.h>
#include <private/qtextcontrol_p.h>
#include <private/qtextengine_p.h>
-#include <private/qwidget_p.h>
#include <private/qsgdistancefieldglyphcache_p.h>
#include <private/qsgtexture_p.h>
#include <private/qsgadaptationlayer_p.h>
@@ -65,7 +64,6 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
-Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget);
/*!
\qmlclass TextEdit QSGTextEdit
\inqmlmodule QtQuick 2
@@ -551,7 +549,7 @@ bool QSGTextEditPrivate::determineHorizontalAlignment()
{
Q_Q(QSGTextEdit);
if (hAlignImplicit && q->isComponentComplete()) {
- bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ bool alignToRight = text.isEmpty() ? QGuiApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
return setHAlign(alignToRight ? QSGTextEdit::AlignRight : QSGTextEdit::AlignLeft);
}
return false;
@@ -1636,7 +1634,7 @@ void QSGTextEditPrivate::init()
QObject::connect(control, SIGNAL(linkActivated(QString)), q, SIGNAL(linkActivated(QString)));
#ifndef QT_NO_CLIPBOARD
QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged()));
- QObject::connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
+ QObject::connect(QGuiApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
canPaste = control->canPaste();
#endif
@@ -1910,7 +1908,7 @@ void QSGTextEdit::openSoftwareInputPanel()
if (qApp) {
if (canvas()) {
QEvent event(QEvent::RequestSoftwareInputPanel);
- QApplication::sendEvent(canvas(), &event);
+ QGuiApplication::sendEvent(canvas(), &event);
}
}
}
@@ -1959,7 +1957,7 @@ void QSGTextEdit::closeSoftwareInputPanel()
if (qApp) {
if (canvas()) {
QEvent event(QEvent::CloseSoftwareInputPanel);
- QApplication::sendEvent(canvas(), &event);
+ QGuiApplication::sendEvent(canvas(), &event);
}
}
}
diff --git a/src/declarative/items/qsgtextedit_p_p.h b/src/declarative/items/qsgtextedit_p_p.h
index e4f74c0ef5..b670baf8aa 100644
--- a/src/declarative/items/qsgtextedit_p_p.h
+++ b/src/declarative/items/qsgtextedit_p_p.h
@@ -58,6 +58,7 @@
#include "qsgimplicitsizeitem_p_p.h"
#include <QtDeclarative/qdeclarative.h>
+#include <QtGui/qpixmap.h>
QT_BEGIN_NAMESPACE
class QTextLayout;
diff --git a/src/declarative/items/qsgtextinput.cpp b/src/declarative/items/qsgtextinput.cpp
index a7c1a122bb..22ee3c805d 100644
--- a/src/declarative/items/qsgtextinput.cpp
+++ b/src/declarative/items/qsgtextinput.cpp
@@ -44,26 +44,22 @@
#include "qsgcanvas.h"
#include <private/qdeclarativeglobal_p.h>
-#include <private/qwidget_p.h>
#include <private/qsgdistancefieldglyphcache_p.h>
#include <QtDeclarative/qdeclarativeinfo.h>
#include <QtGui/qevent.h>
-#include <QtWidgets/qinputcontext.h>
#include <QTextBoundaryFinder>
-#include <qstyle.h>
#include <qsgtextnode_p.h>
#include <qsgsimplerectnode.h>
#include <QtGui/qplatforminputcontext_qpa.h>
#include <private/qguiapplication_p.h>
+#include <QtGui/qstylehints.h>
QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
-Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget);
-
/*!
\qmlclass TextInput QSGTextInput
\inqmlmodule QtQuick 2
@@ -408,7 +404,7 @@ bool QSGTextInputPrivate::determineHorizontalAlignment()
if (hAlignImplicit) {
// if no explicit alignment has been set, follow the natural layout direction of the text
QString text = control->text();
- bool isRightToLeft = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : text.isRightToLeft();
+ bool isRightToLeft = text.isEmpty() ? QGuiApplication::keyboardInputDirection() == Qt::RightToLeft : text.isRightToLeft();
return setHAlign(isRightToLeft ? QSGTextInput::AlignRight : QSGTextInput::AlignLeft);
}
return false;
@@ -517,7 +513,7 @@ void QSGTextInput::setCursorVisible(bool on)
if (d->cursorVisible == on)
return;
d->cursorVisible = on;
- d->control->setCursorBlinkPeriod(on?QApplication::cursorFlashTime():0);
+ d->control->setCursorBlinkPeriod(on ? qApp->styleHints()->cursorFlashTime() : 0);
QRect r = d->control->cursorRect();
if (d->control->inputMask().isEmpty())
updateRect(r);
@@ -1132,7 +1128,7 @@ void QSGTextInput::mouseMoveEvent(QMouseEvent *event)
if (d->sendMouseEventToInputContext(event))
return;
if (d->selectPressed) {
- if (qAbs(int(event->localPos().x() - d->pressPos.x())) > QApplication::startDragDistance())
+ if (qAbs(int(event->localPos().x() - d->pressPos.x())) > qApp->styleHints()->startDragDistance())
setKeepMouseGrab(true);
moveCursorSelection(d->xToPos(event->localPos().x()), d->mouseSelectionMode);
event->setAccepted(true);
@@ -1363,7 +1359,7 @@ QVariant QSGTextInput::inputMethodQuery(Qt::InputMethodQuery property) const
case Qt::ImCursorPosition:
return QVariant(d->control->cursor());
case Qt::ImSurroundingText:
- if (d->control->echoMode() == PasswordEchoOnEdit && !d->control->passwordEchoEditing())
+ if (d->control->echoMode() == QLineControl::PasswordEchoOnEdit && !d->control->passwordEchoEditing())
return QVariant(displayText());
else
return QVariant(text());
@@ -1738,7 +1734,7 @@ void QSGTextInput::openSoftwareInputPanel()
if (qApp) {
if (canvas()) {
QEvent event(QEvent::RequestSoftwareInputPanel);
- QApplication::sendEvent(canvas(), &event);
+ QCoreApplication::sendEvent(canvas(), &event);
}
}
}
@@ -1787,7 +1783,7 @@ void QSGTextInput::closeSoftwareInputPanel()
if (qApp) {
if (canvas()) {
QEvent event(QEvent::CloseSoftwareInputPanel);
- QApplication::sendEvent(canvas(), &event);
+ QCoreApplication::sendEvent(canvas(), &event);
}
}
}
@@ -1862,9 +1858,9 @@ void QSGTextInputPrivate::init()
#ifndef QT_NO_CLIPBOARD
q->connect(q, SIGNAL(readOnlyChanged(bool)),
q, SLOT(q_canPasteChanged()));
- q->connect(QApplication::clipboard(), SIGNAL(dataChanged()),
+ q->connect(QGuiApplication::clipboard(), SIGNAL(dataChanged()),
q, SLOT(q_canPasteChanged()));
- canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ canPaste = !control->isReadOnly() && QGuiApplication::clipboard()->text().length() != 0;
#endif // QT_NO_CLIPBOARD
q->connect(control, SIGNAL(updateMicroFocus()),
q, SLOT(updateCursorRectangle()));
@@ -2008,7 +2004,7 @@ void QSGTextInput::q_canPasteChanged()
Q_D(QSGTextInput);
bool old = d->canPaste;
#ifndef QT_NO_CLIPBOARD
- d->canPaste = !d->control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ d->canPaste = !d->control->isReadOnly() && QGuiApplication::clipboard()->text().length() != 0;
#endif
if(d->canPaste != old)
emit canPasteChanged();
diff --git a/src/declarative/items/qsgtextnode_p.h b/src/declarative/items/qsgtextnode_p.h
index e9b9b98edf..31a1fbe558 100644
--- a/src/declarative/items/qsgtextnode_p.h
+++ b/src/declarative/items/qsgtextnode_p.h
@@ -46,6 +46,8 @@
#include <qsgtext_p.h>
#include <qglyphrun.h>
+#include <QtGui/qcolor.h>
+
QT_BEGIN_NAMESPACE
class QTextLayout;
diff --git a/src/declarative/particles/qsgimageparticle_p.h b/src/declarative/particles/qsgimageparticle_p.h
index eb890e285c..5c684f856c 100644
--- a/src/declarative/particles/qsgimageparticle_p.h
+++ b/src/declarative/particles/qsgimageparticle_p.h
@@ -45,6 +45,7 @@
#include "qsgstochasticdirection_p.h"
#include <QDeclarativeListProperty>
#include <qsgsimplematerial.h>
+#include <QtGui/qcolor.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp
index 546cfdd100..3b5c9ac0f3 100644
--- a/src/declarative/qml/parser/qdeclarativejsparser.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtCore/QtDebug>
-#include <QtWidgets/QApplication>
+#include <QtGui/QGuiApplication>
#include <string.h>
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 49aa6d99b6..b01892813f 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -61,7 +61,6 @@
#include <QStack>
#include <QStringList>
#include <QtCore/qdebug.h>
-#include <QApplication>
#include <qdeclarativeinfo.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 051739be59..353a86ca7a 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -91,7 +91,6 @@
#include <QtCore/qmutex.h>
#include <QtGui/qcolor.h>
#include <QtGui/qvector3d.h>
-#include <QtWidgets/qsound.h>
#include <QtCore/qcryptographichash.h>
#include <private/qobject_p.h>
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 091a561993..4289dee907 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -1346,13 +1346,11 @@ QT_END_NAMESPACE
#include <QtGui/qbrush.h>
#include <QtGui/qcolor.h>
#include <QtGui/qpalette.h>
-#include <QtWidgets/qicon.h>
#include <QtGui/qimage.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qregion.h>
#include <QtGui/qbitmap.h>
#include <QtGui/qcursor.h>
-#include <QtWidgets/qsizepolicy.h>
#include <QtGui/qkeysequence.h>
#include <QtGui/qpen.h>
@@ -1425,7 +1423,6 @@ bool QDeclarativeMetaType::canCopy(int type)
case QMetaType::QBrush:
case QMetaType::QColor:
case QMetaType::QPalette:
- case QMetaType::QIcon:
case QMetaType::QImage:
case QMetaType::QPolygon:
case QMetaType::QRegion:
@@ -1433,7 +1430,6 @@ bool QDeclarativeMetaType::canCopy(int type)
#ifndef QT_NO_CURSOR
case QMetaType::QCursor:
#endif
- case QMetaType::QSizePolicy:
case QMetaType::QKeySequence:
case QMetaType::QPen:
case QMetaType::QTextLength:
@@ -1611,9 +1607,6 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
case QMetaType::QPalette:
*static_cast<NS(QPalette) *>(data) = *static_cast<const NS(QPalette)*>(copy);
return true;
- case QMetaType::QIcon:
- *static_cast<NS(QIcon) *>(data) = *static_cast<const NS(QIcon)*>(copy);
- return true;
case QMetaType::QImage:
*static_cast<NS(QImage) *>(data) = *static_cast<const NS(QImage)*>(copy);
return true;
@@ -1631,9 +1624,6 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
*static_cast<NS(QCursor) *>(data) = *static_cast<const NS(QCursor)*>(copy);
return true;
#endif
- case QMetaType::QSizePolicy:
- *static_cast<NS(QSizePolicy) *>(data) = *static_cast<const NS(QSizePolicy)*>(copy);
- return true;
case QMetaType::QKeySequence:
*static_cast<NS(QKeySequence) *>(data) = *static_cast<const NS(QKeySequence)*>(copy);
return true;
@@ -1822,9 +1812,6 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
case QMetaType::QPalette:
*static_cast<NS(QPalette) *>(data) = NS(QPalette)();
return true;
- case QMetaType::QIcon:
- *static_cast<NS(QIcon) *>(data) = NS(QIcon)();
- return true;
case QMetaType::QImage:
*static_cast<NS(QImage) *>(data) = NS(QImage)();
return true;
@@ -1842,9 +1829,6 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
*static_cast<NS(QCursor) *>(data) = NS(QCursor)();
return true;
#endif
- case QMetaType::QSizePolicy:
- *static_cast<NS(QSizePolicy) *>(data) = NS(QSizePolicy)();
- return true;
case QMetaType::QKeySequence:
*static_cast<NS(QKeySequence) *>(data) = NS(QKeySequence)();
return true;
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index bf290869b4..d90545308f 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -65,7 +65,6 @@
#include "qdeclarativescriptstring_p.h"
#include <QStack>
-#include <QWidget>
#include <QColor>
#include <QPointF>
#include <QSizeF>
@@ -276,17 +275,20 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack,
}
if (!stack.isEmpty()) {
QObject *parent = stack.top();
- if (o->isWidgetType()) {
+#if 0 // ### refactor
+ if (o->isWidgetType()) {
QWidget *widget = static_cast<QWidget*>(o);
if (parent->isWidgetType()) {
QWidget *parentWidget = static_cast<QWidget*>(parent);
- widget->setParent(parentWidget);
- } else {
+ widget->setParent(parentWidget);
+ } else {
// TODO: parent might be a layout
}
- } else {
- QDeclarative_setParent_noEvent(o, parent);
- }
+ } else
+#endif
+ {
+ QDeclarative_setParent_noEvent(o, parent);
+ }
}
stack.push(o);
QML_END_INSTR(CreateObject)
diff --git a/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp b/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp
index ce05e76969..a215968e2b 100644
--- a/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp
@@ -46,7 +46,7 @@
#include "qsgmaterial.h"
#include <QtCore/qvarlengtharray.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
#include <QtCore/qpair.h>
#include <QtCore/QElapsedTimer>
diff --git a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
index 0df00b56cb..57a3059d58 100644
--- a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
@@ -49,7 +49,7 @@
#include <QOpenGLShaderProgram>
#include <qopenglframebufferobject.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
#include <qdatetime.h>
@@ -600,7 +600,7 @@ static inline GLenum qt_drawTypeForPattern(QSGGeometry::DataPattern p)
void QSGRenderer::draw(const QSGMaterialShader *shader, const QSGGeometry *g)
{
// ### remove before final release...
- static bool use_vbo = !QApplication::arguments().contains(QLatin1String("--no-vbo"));
+ static bool use_vbo = !QGuiApplication::arguments().contains(QLatin1String("--no-vbo"));
const void *vertexData;
int vertexByteSize = g->vertexCount() * g->stride();
diff --git a/src/declarative/scenegraph/qsgcontext.cpp b/src/declarative/scenegraph/qsgcontext.cpp
index c472ed1260..7adbb32ec2 100644
--- a/src/declarative/scenegraph/qsgcontext.cpp
+++ b/src/declarative/scenegraph/qsgcontext.cpp
@@ -54,7 +54,7 @@
#include <private/qsgtexture_p.h>
#include <qsgengine.h>
-#include <QApplication>
+#include <QGuiApplication>
#include <QOpenGLContext>
#include <private/qobject_p.h>
diff --git a/src/declarative/scenegraph/qsgcontextplugin.cpp b/src/declarative/scenegraph/qsgcontextplugin.cpp
index c744444aeb..79bcbf9c04 100644
--- a/src/declarative/scenegraph/qsgcontextplugin.cpp
+++ b/src/declarative/scenegraph/qsgcontextplugin.cpp
@@ -41,7 +41,7 @@
#include "qsgcontextplugin_p.h"
#include <private/qsgcontext_p.h>
-#include <QtWidgets/qapplication.h>
+#include <QtGui/qguiapplication.h>
#include <QtCore/private/qfactoryloader_p.h>
#include <QtCore/qlibraryinfo.h>
@@ -69,7 +69,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
*/
QSGContext *QSGContext::createDefaultContext()
{
- const QStringList args = QApplication::arguments();
+ const QStringList args = QGuiApplication::arguments();
QString device;
for (int index = 0; index < args.count(); ++index) {
if (args.at(index).startsWith(QLatin1String("--device="))) {
diff --git a/src/declarative/scenegraph/util/qsgpainternode_p.h b/src/declarative/scenegraph/util/qsgpainternode_p.h
index 50fb521405..c14e7701fb 100644
--- a/src/declarative/scenegraph/util/qsgpainternode_p.h
+++ b/src/declarative/scenegraph/util/qsgpainternode_p.h
@@ -47,6 +47,8 @@
#include "qsgtexture_p.h"
#include "qsgpainteditem.h"
+#include <QtGui/qcolor.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp
index f745ba6fa8..e03dce7f95 100644
--- a/src/declarative/util/qdeclarativeapplication.cpp
+++ b/src/declarative/util/qdeclarativeapplication.cpp
@@ -41,7 +41,7 @@
#include "qdeclarativeapplication_p.h"
#include <private/qobject_p.h>
-#include <QtWidgets/QApplication>
+#include <QtGui/QGuiApplication>
QT_BEGIN_NAMESPACE
@@ -49,8 +49,8 @@ class QDeclarativeApplicationPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeApplication)
public:
- QDeclarativeApplicationPrivate() : active(QApplication::activeWindow() != 0),
- layoutDirection(QApplication::layoutDirection()) {}
+ QDeclarativeApplicationPrivate() : active(QGuiApplication::activeWindow() != 0),
+ layoutDirection(QGuiApplication::layoutDirection()) {}
bool active;
Qt::LayoutDirection layoutDirection;
};
@@ -100,7 +100,7 @@ bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event)
}
}
if (event->type() == QEvent::LayoutDirectionChange) {
- Qt::LayoutDirection direction = QApplication::layoutDirection();
+ Qt::LayoutDirection direction = QGuiApplication::layoutDirection();
if (d->layoutDirection != direction) {
d->layoutDirection = direction;
emit layoutDirectionChanged();
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 4f198a537e..89cc947d2c 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -53,7 +53,6 @@
#include "private/qdeclarativestate_p_p.h"
#include <QtCore/qdebug.h>
-#include <QtWidgets/qgraphicsitem.h>
#include <QtCore/qmath.h>
#include <private/qobject_p.h>
diff --git a/src/declarative/util/qdeclarativesystempalette.cpp b/src/declarative/util/qdeclarativesystempalette.cpp
index 7c5a535935..b4216cb75d 100644
--- a/src/declarative/util/qdeclarativesystempalette.cpp
+++ b/src/declarative/util/qdeclarativesystempalette.cpp
@@ -41,7 +41,7 @@
#include "private/qdeclarativesystempalette_p.h"
-#include <QApplication>
+#include <QGuiApplication>
#include <private/qobject_p.h>
@@ -84,7 +84,7 @@ QDeclarativeSystemPalette::QDeclarativeSystemPalette(QObject *parent)
: QObject(*(new QDeclarativeSystemPalettePrivate), parent)
{
Q_D(QDeclarativeSystemPalette);
- d->palette = QApplication::palette();
+ d->palette = QGuiApplication::palette();
d->group = QPalette::Active;
qApp->installEventFilter(this);
}
@@ -291,7 +291,7 @@ bool QDeclarativeSystemPalette::eventFilter(QObject *watched, QEvent *event)
{
if (watched == qApp) {
if (event->type() == QEvent::ApplicationPaletteChange) {
- QApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange));
+ QGuiApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange));
return false;
}
}
@@ -302,7 +302,7 @@ bool QDeclarativeSystemPalette::event(QEvent *event)
{
Q_D(QDeclarativeSystemPalette);
if (event->type() == QEvent::ApplicationPaletteChange) {
- d->palette = QApplication::palette();
+ d->palette = QGuiApplication::palette();
emit paletteChanged();
return true;
}
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 47ef76213a..82b7e7d368 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -47,7 +47,6 @@
#include <QDebug>
#include <QStringList>
#include <QMap>
-#include <QApplication>
#include <QThread>
#include <QXmlQuery>
#include <QXmlResultItems>