summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-01-31 13:58:44 +1000
committerAndrew den Exter <andrew.den-exter@nokia.com>2012-01-31 06:34:44 +0100
commitf973bb1730e1138f9c745d142c1f2f5d9c53b456 (patch)
treec04bc36a5ae8fddf29e6fe37f55e3ec2af59de3f /src/declarative/graphicsitems
parentdbf35e498db723ae9850686e462ec4f45bc7b67c (diff)
Fix compile failures.
Remove uses of QLineControl, QTextControl and QBool and forward declared QGraphicsWidget. Change-Id: Ic5184a1d5aebfb1100ad0e24444b6773f4e617e8 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp36
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp147
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h6
6 files changed, 95 insertions, 101 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index b57c38ea..5db1b9c3 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -47,8 +47,8 @@
#include <QtCore/QObject>
#include <QtCore/QList>
-#include <QtWidgets/qgraphicsitem.h>
#include <QtWidgets/qgraphicstransform.h>
+#include <QtWidgets/qgraphicswidget.h>
#include <QtGui/qfont.h>
#include <QtWidgets/qaction.h>
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 4d0e5829..6ab599b5 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1106,7 +1106,6 @@ bool QDeclarativeTextPrivate::setHAlign(QDeclarativeText::HAlignment alignment,
{
Q_Q(QDeclarativeText);
if (hAlign != alignment || forceAlign) {
- QDeclarativeText::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
hAlign = alignment;
emit q->horizontalAlignmentChanged(hAlign);
return true;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index c23718b6..6ca1b738 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -56,8 +56,9 @@
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#include <QPainter>
+#include <QtGui/QInputPanel>
-#include <private/qtextcontrol_p.h>
+#include <private/qwidgettextcontrol_p.h>
QT_BEGIN_NAMESPACE
@@ -126,10 +127,10 @@ QString QDeclarativeTextEdit::text() const
#ifndef QT_NO_TEXTHTMLPARSER
if (d->richText)
- return d->document->toHtml();
+ return d->control->toHtml();
else
#endif
- return d->document->toPlainText();
+ return d->control->toPlainText();
}
/*!
@@ -548,9 +549,12 @@ bool QDeclarativeTextEditPrivate::determineHorizontalAlignment()
if (hAlignImplicit && q->isComponentComplete()) {
bool alignToRight;
if (text.isEmpty()) {
- const QString preeditText = control->textCursor().block().layout()->preeditAreaText();
+ QTextCursor cursor = control->textCursor();
+ const QString preeditText = cursor.block().isValid()
+ ? control->textCursor().block().layout()->preeditAreaText()
+ : QString();
alignToRight = preeditText.isEmpty()
- ? QApplication::keyboardInputDirection() == Qt::RightToLeft
+ ? qApp->inputPanel()->inputDirection() == Qt::RightToLeft
: preeditText.isRightToLeft();
} else {
alignToRight = rightToLeftText;
@@ -1537,12 +1541,12 @@ void QDeclarativeTextEditPrivate::init()
q->setFlag(QGraphicsItem::ItemHasNoContents, false);
q->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
- control = new QTextControl(q);
+ control = new QWidgetTextControl(q);
control->setIgnoreUnusedNavigationEvents(true);
- control->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByKeyboard | Qt::TextEditable);
+ control->setTextInteractionFlags(Qt::TextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByKeyboard | Qt::TextEditable));
control->setDragEnabled(false);
- // QTextControl follows the default text color
+ // QWidgetTextControl follows the default text color
// defined by the platform, declarative text
// should be black by default
QPalette pal = control->palette();
@@ -1777,9 +1781,8 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
customizing when you want the input keyboard to be shown and hidden in
your application.
- By default the opening of input panels follows the platform style. On Symbian^1 and
- Symbian^3 -based devices the panels are opened by clicking TextEdit. On other platforms
- the panels are automatically opened when TextEdit element gains active focus. Input panels are
+ By default the opening of input panels follows the platform style.
+ The panels are automatically opened when TextEdit element gains active focus. Input panels are
always closed if no editor has active focus.
You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
@@ -1811,11 +1814,10 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
*/
void QDeclarativeTextEdit::openSoftwareInputPanel()
{
- QEvent event(QEvent::RequestSoftwareInputPanel);
if (qApp) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->show();
}
}
}
@@ -1828,9 +1830,8 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
for customizing when you want the input keyboard to be shown and hidden in
your application.
- By default the opening of input panels follows the platform style. On Symbian^1 and
- Symbian^3 -based devices the panels are opened by clicking TextEdit. On other platforms
- the panels are automatically opened when TextEdit element gains active focus. Input panels are
+ By default the opening of input panels follows the platform style.
+ The panels are automatically opened when TextEdit element gains active focus. Input panels are
always closed if no editor has active focus.
You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
@@ -1862,11 +1863,10 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
*/
void QDeclarativeTextEdit::closeSoftwareInputPanel()
{
- QEvent event(QEvent::CloseSoftwareInputPanel);
if (qApp) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->hide();
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index bdc4351c..844c4554 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
class QTextLayout;
class QTextDocument;
-class QTextControl;
+class QWidgetTextControl;
class QDeclarativeTextEditPrivate : public QDeclarativeImplicitSizePaintedItemPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeTextEdit)
@@ -124,7 +124,7 @@ public:
QDeclarativeItem* cursor;
QDeclarativeTextEdit::TextFormat format;
QTextDocument *document;
- QTextControl *control;
+ QWidgetTextControl *control;
QDeclarativeTextEdit::WrapMode wrapMode;
QDeclarativeTextEdit::SelectionMode mouseSelectionMode;
int lineCount;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 2d519bed..b22df6e2 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -48,6 +48,7 @@
#include <QValidator>
#include <QTextCursor>
#include <QApplication>
+#include <QtGui/QInputPanel>
#include <QFontMetrics>
#include <QPainter>
#include <QTextBoundaryFinder>
@@ -58,6 +59,8 @@
QT_BEGIN_NAMESPACE
+
+
/*!
\qmlclass TextInput QDeclarativeTextInput
\ingroup qml-basic-visual-elements
@@ -394,7 +397,6 @@ bool QDeclarativeTextInputPrivate::setHAlign(QDeclarativeTextInput::HAlignment a
{
Q_Q(QDeclarativeTextInput);
if ((hAlign != alignment || forceAlign) && alignment <= QDeclarativeTextInput::AlignHCenter) { // justify not supported
- QDeclarativeTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
hAlign = alignment;
emit q->horizontalAlignmentChanged(alignment);
return true;
@@ -410,7 +412,7 @@ bool QDeclarativeTextInputPrivate::determineHorizontalAlignment()
if (text.isEmpty())
text = control->preeditAreaText();
bool isRightToLeft = text.isEmpty()
- ? QApplication::keyboardInputDirection() == Qt::RightToLeft
+ ? qApp->inputPanel()->inputDirection() == Qt::RightToLeft
: text.isRightToLeft();
return setHAlign(isRightToLeft ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft);
}
@@ -423,7 +425,6 @@ void QDeclarativeTextInputPrivate::mirrorChange()
if (q->isComponentComplete()) {
if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) {
q->updateCursorRectangle();
- updateHorizontalScroll();
}
}
}
@@ -554,7 +555,7 @@ QRect QDeclarativeTextInput::cursorRectangle() const
Q_D(const QDeclarativeTextInput);
QRect r = d->control->cursorRect();
// Scroll and make consistent with TextEdit
- // QLineControl inexplicably adds 1 to the height and horizontal padding
+ // QWidgetLineControl inexplicably adds 1 to the height and horizontal padding
// for unicode direction markers.
r.adjust(5 - d->hscroll, 0, -4 - d->hscroll, -1);
return r;
@@ -865,8 +866,10 @@ void QDeclarativeTextInputPrivate::updateInputMethodHints()
hints |= Qt::ImhHiddenText;
else if (echo == QDeclarativeTextInput::PasswordEchoOnEdit)
hints &= ~Qt::ImhHiddenText;
- if (echo != QDeclarativeTextInput::Normal)
- hints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ if (echo != QDeclarativeTextInput::Normal) {
+ hints |= Qt::ImhNoAutoUppercase;
+ hints |= Qt::ImhNoPredictiveText;
+ }
q->setInputMethodHints(hints);
}
@@ -893,7 +896,7 @@ void QDeclarativeTextInput::setEchoMode(QDeclarativeTextInput::EchoMode echo)
Q_D(QDeclarativeTextInput);
if (echoMode() == echo)
return;
- d->control->setEchoMode(QLineControl::EchoMode(echo));
+ d->control->setEchoMode(echo);
d->updateInputMethodHints();
q_textChanged();
emit echoModeChanged(echoMode());
@@ -985,7 +988,7 @@ void QDeclarativeTextInput::createCursor()
QDeclarative_setParent_noEvent(d->cursorItem, this);
d->cursorItem->setParentItem(this);
d->cursorItem->setX(d->control->cursorToX());
- d->cursorItem->setHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
+ d->cursorItem->setHeight(d->control->height()-1); // -1 to counter QWidgetLineControl's +1 which is not consistent with Text.
}
/*!
@@ -1052,9 +1055,11 @@ void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
focused = hasFocus;
q->setCursorVisible(hasFocus && scene && scene->hasFocus());
if(!hasFocus && control->passwordEchoEditing())
- control->updatePasswordEchoEditing(false);//QLineControl sets it on key events, but doesn't deal with focus events
- if (!hasFocus)
+ control->updatePasswordEchoEditing(false);//QWidgetLineControl sets it on key events, but doesn't deal with focus events
+ if (!hasFocus) {
+ control->commitPreedit();
control->deselect();
+ }
QDeclarativeItemPrivate::focusChanged(hasFocus);
}
@@ -1112,13 +1117,13 @@ Handles the given mouse \a event.
void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
- if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonDblClick))
- return;
- if (d->selectByMouse) {
+ if (d->selectByMouse && event->button() == Qt::LeftButton) {
int cursor = d->xToPos(event->pos().x());
d->control->selectWordAtPos(cursor);
event->setAccepted(true);
} else {
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonDblClick))
+ return;
QDeclarativePaintedItem::mouseDoubleClickEvent(event);
}
}
@@ -1126,8 +1131,9 @@ void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even
void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
- if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonPress))
- return;
+
+ d->pressPos = event->pos();
+
if(d->focusOnPress){
bool hadActiveFocus = hasActiveFocus();
forceActiveFocus();
@@ -1145,8 +1151,10 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (d->selectByMouse) {
setKeepMouseGrab(false);
d->selectPressed = true;
- d->pressPos = event->pos();
}
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonPress))
+ return;
+
bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse;
int cursor = d->xToPos(event->pos().x());
d->control->moveCursor(cursor, mark);
@@ -1156,12 +1164,20 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
- if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
- return;
+
if (d->selectPressed) {
if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
setKeepMouseGrab(true);
- moveCursorSelection(d->xToPos(event->pos().x()), d->mouseSelectionMode);
+
+ if (d->control->composeMode()) {
+ // start selection
+ int startPos = d->xToPos(d->pressPos.x());
+ int currentPos = d->xToPos(event->pos().x());
+ if (startPos != currentPos)
+ d->control->setSelection(startPos, currentPos - startPos);
+ } else {
+ moveCursorSelection(d->xToPos(event->pos().x()), d->mouseSelectionMode);
+ }
event->setAccepted(true);
} else {
QDeclarativePaintedItem::mouseMoveEvent(event);
@@ -1191,7 +1207,16 @@ void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
}
d->clickCausedFocus = false;
- d->control->processEvent(event);
+#ifndef QT_NO_CLIPBOARD
+ if (QGuiApplication::clipboard()->supportsSelection()) {
+ if (event->button() == Qt::LeftButton) {
+ d->control->copy(QClipboard::Selection);
+ } else if (!isReadOnly() && event->button() == Qt::MidButton) {
+ d->control->deselect();
+ d->control->insert(QGuiApplication::clipboard()->text(QClipboard::Selection));
+ }
+ }
+#endif
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
}
@@ -1203,28 +1228,12 @@ bool QDeclarativeTextInputPrivate::sendMouseEventToInputContext(
if (event->widget() && control->composeMode()) {
int tmp_cursor = xToPos(event->pos().x());
int mousePos = tmp_cursor - control->cursor();
- if (mousePos < 0 || mousePos > control->preeditAreaText().length()) {
- mousePos = -1;
- // don't send move events outside the preedit area
- if (eventType == QEvent::MouseMove)
- return true;
- }
-
- QInputContext *qic = event->widget()->inputContext();
- if (qic) {
- QMouseEvent mouseEvent(
- eventType,
- event->widget()->mapFromGlobal(event->screenPos()),
- event->screenPos(),
- event->button(),
- event->buttons(),
- event->modifiers());
- // may be causing reset() in some input methods
- qic->mouseHandler(mousePos, &mouseEvent);
- event->setAccepted(mouseEvent.isAccepted());
- }
- if (!control->preeditAreaText().isEmpty())
+ if (mousePos >= 0 && mousePos <= control->preeditAreaText().length()) {
+ if (eventType == QEvent::MouseButtonRelease) {
+ qApp->inputPanel()->invokeAction(QInputPanel::Click, mousePos);
+ }
return true;
+ }
}
#else
Q_UNUSED(event);
@@ -1247,30 +1256,20 @@ bool QDeclarativeTextInput::sceneEvent(QEvent *event)
bool QDeclarativeTextInput::event(QEvent* ev)
{
+#ifndef QT_NO_SHORTCUT
Q_D(QDeclarativeTextInput);
- //Anything we don't deal with ourselves, pass to the control
- bool handled = false;
- switch(ev->type()){
- case QEvent::KeyPress:
- case QEvent::KeyRelease://###Should the control be doing anything with release?
- case QEvent::InputMethod:
- case QEvent::GraphicsSceneMousePress:
- case QEvent::GraphicsSceneMouseMove:
- case QEvent::GraphicsSceneMouseRelease:
- case QEvent::GraphicsSceneMouseDoubleClick:
- break;
- default:
- handled = d->control->processEvent(ev);
+
+ if (ev->type() == QEvent::ShortcutOverride) {
+ d->control->processShortcutOverrideEvent(static_cast<QKeyEvent *>(ev));
+ return ev->isAccepted();
}
- if(!handled)
- handled = QDeclarativePaintedItem::event(ev);
- return handled;
+#endif
+ return QDeclarativePaintedItem::event(ev);
}
void QDeclarativeTextInput::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
- Q_D(QDeclarativeTextInput);
if (newGeometry.width() != oldGeometry.width()) {
updateSize();
updateCursorRectangle();
@@ -1348,11 +1347,11 @@ void QDeclarativeTextInput::drawContents(QPainter *p, const QRect &r)
p->setRenderHint(QPainter::TextAntialiasing, true);
p->save();
p->setPen(QPen(d->color));
- int flags = QLineControl::DrawText;
+ int flags = QWidgetLineControl::DrawText;
if(!isReadOnly() && d->cursorVisible && !d->cursorItem)
- flags |= QLineControl::DrawCursor;
+ flags |= QWidgetLineControl::DrawCursor;
if (d->control->hasSelectedText())
- flags |= QLineControl::DrawSelections;
+ flags |= QWidgetLineControl::DrawSelections;
QPoint offset = QPoint(0,0);
QFontMetrics fm = QFontMetrics(d->font);
QRect br(boundingRect().toRect());
@@ -1381,10 +1380,11 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
case Qt::ImCursorPosition:
return QVariant(d->control->cursor());
case Qt::ImSurroundingText:
- if (d->control->echoMode() == PasswordEchoOnEdit && !d->control->passwordEchoEditing())
+ if (d->control->echoMode() == PasswordEchoOnEdit
+ && !d->control->passwordEchoEditing())
return QVariant(displayText());
else
- return QVariant(text());
+ return QVariant(d->control->realText());
case Qt::ImCurrentSelection:
return QVariant(selectedText());
case Qt::ImMaximumTextLength:
@@ -1722,9 +1722,8 @@ void QDeclarativeTextInput::moveCursorSelection(int pos, SelectionMode mode)
customizing when you want the input keyboard to be shown and hidden in
your application.
- By default the opening of input panels follows the platform style. On Symbian^1 and
- Symbian^3 -based devices the panels are opened by clicking TextInput. On other platforms
- the panels are automatically opened when TextInput element gains active focus. Input panels are
+ By default the opening of input panels follows the platform style.
+ The panels are automatically opened when TextInput element gains active focus. Input panels are
always closed if no editor has active focus.
. You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
@@ -1756,11 +1755,10 @@ void QDeclarativeTextInput::moveCursorSelection(int pos, SelectionMode mode)
*/
void QDeclarativeTextInput::openSoftwareInputPanel()
{
- QEvent event(QEvent::RequestSoftwareInputPanel);
if (qApp) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->show();
}
}
}
@@ -1773,9 +1771,8 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
for customizing when you want the input keyboard to be shown and hidden in
your application.
- By default the opening of input panels follows the platform style. On Symbian^1 and
- Symbian^3 -based devices the panels are opened by clicking TextInput. On other platforms
- the panels are automatically opened when TextInput element gains active focus. Input panels are
+ By default the opening of input panels follows the platform style.
+ The panels are automatically opened when TextInput element gains active focus. Input panels are
always closed if no editor has active focus.
. You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
@@ -1807,12 +1804,10 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
*/
void QDeclarativeTextInput::closeSoftwareInputPanel()
{
- QEvent event(QEvent::CloseSoftwareInputPanel);
if (qApp) {
- QEvent event(QEvent::CloseSoftwareInputPanel);
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
- QApplication::sendEvent(view, &event);
+ qApp->inputPanel()->hide();
}
}
}
@@ -1851,7 +1846,7 @@ bool QDeclarativeTextInput::isInputMethodComposing() const
void QDeclarativeTextInputPrivate::init()
{
Q_Q(QDeclarativeTextInput);
- control->setParent(q);
+ control->setParent(q);//Now mandatory due to accessibility changes
control->setCursorWidth(1);
control->setPasswordCharacter(QLatin1Char('*'));
q->setSmooth(smooth);
@@ -1983,7 +1978,7 @@ void QDeclarativeTextInput::updateSize(bool needsRedraw)
Q_D(QDeclarativeTextInput);
int w = width();
int h = height();
- setImplicitHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
+ setImplicitHeight(d->control->height()-1); // -1 to counter QWidgetLineControl's +1 which is not consistent with Text.
setImplicitWidth(d->calculateTextWidth());
setContentsSize(QSize(width(), height()));//Repaints if changed
if(w==width() && h==height() && needsRedraw){
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index f968460d..ab916104 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -50,7 +50,7 @@
#include <QPointer>
-#include <private/qlinecontrol_p.h>
+#include <private/qwidgetlinecontrol_p.h>
//
// W A R N I N G
@@ -70,7 +70,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInputPrivate : public QDeclarativeImplic
{
Q_DECLARE_PUBLIC(QDeclarativeTextInput)
public:
- QDeclarativeTextInputPrivate() : control(new QLineControl),
+ QDeclarativeTextInputPrivate() : control(new QWidgetLineControl),
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
mouseSelectionMode(QDeclarativeTextInput::SelectCharacters), inputMethodHints(Qt::ImhNone),
@@ -110,7 +110,7 @@ public:
bool sendMouseEventToInputContext(QGraphicsSceneMouseEvent *event, QEvent::Type eventType);
void updateInputMethodHints();
- QLineControl* control;
+ QWidgetLineControl* control;
QFont font;
QFont sourceFont;