#include <QPainter>
#include <QtGui/QInputPanel>
-#include <private/qtextcontrol_p.h>
+#include <private/qwidgettextcontrol_p.h>
QT_BEGIN_NAMESPACE
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
: preeditText.isRightToLeft();
q->setFlag(QGraphicsItem::ItemHasNoContents, false);
q->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
- control = new QTextControl(q);
+ control = new QWidgetTextControl(q);
control->setIgnoreUnusedNavigationEvents(true);
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();
class QTextLayout;
class QTextDocument;
-class QTextControl;
+class QWidgetTextControl;
class QDeclarative1TextEditPrivate : public QDeclarative1ImplicitSizePaintedItemPrivate
{
Q_DECLARE_PUBLIC(QDeclarative1TextEdit)
QDeclarativeItem* cursor;
QDeclarative1TextEdit::TextFormat format;
QTextDocument *document;
- QTextControl *control;
+ QWidgetTextControl *control;
QDeclarative1TextEdit::WrapMode wrapMode;
QDeclarative1TextEdit::SelectionMode mouseSelectionMode;
int lineCount;
#include <QClipboard>
#include <QMimeData>
#include <private/qapplication_p.h>
-#include <private/qtextcontrol_p.h>
+#include <private/qwidgettextcontrol_p.h>
Q_DECLARE_METATYPE(QDeclarative1TextEdit::SelectionMode)
QVERIFY(textEdit != 0);
// check initial value - QTBUG-17765
- QTextControl tc;
+ QWidgetTextControl tc;
QCOMPARE(textEdit->canPaste(), tc.canPaste());
#endif
QVERIFY(textEdit != 0);
// check initial value - QTBUG-17765
- QTextControl tc;
+ QWidgetTextControl tc;
QCOMPARE(textEdit->canPaste(), tc.canPaste());
#endif