2011-04-27 12:13:26 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2015-01-28 11:55:39 +00:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
** Contact: http://www.qt.io/licensing/
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
2013-09-30 05:28:31 +00:00
|
|
|
** This file is part of the QtQuick module of the Qt Toolkit.
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
2014-08-22 06:13:59 +00:00
|
|
|
** $QT_BEGIN_LICENSE:LGPL21$
|
2012-09-20 05:21:40 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-28 11:55:39 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see http://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at http://www.qt.io/contact-us.
|
2012-09-20 05:21:40 +00:00
|
|
|
**
|
2011-04-27 12:13:26 +00:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-09-20 05:21:40 +00:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-08-22 06:13:59 +00:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2011-04-27 12:13:26 +00:00
|
|
|
**
|
2015-01-28 11:55:39 +00:00
|
|
|
** As a special exception, The Qt Company gives you certain additional
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2011-04-27 12:13:26 +00:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
#ifndef QQUICKTEXTINPUT_P_H
|
|
|
|
#define QQUICKTEXTINPUT_P_H
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
#include "qquickimplicitsizeitem_p.h"
|
2011-12-15 01:36:54 +00:00
|
|
|
#include <QtGui/qtextoption.h>
|
2011-04-27 12:13:26 +00:00
|
|
|
#include <QtGui/qvalidator.h>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
class QQuickTextInputPrivate;
|
2011-04-27 12:13:26 +00:00
|
|
|
class QValidator;
|
2013-01-16 09:06:11 +00:00
|
|
|
class Q_QUICK_PRIVATE_EXPORT QQuickTextInput : public QQuickImplicitSizeItem
|
2011-04-27 12:13:26 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_ENUMS(HAlignment)
|
2011-12-15 01:36:54 +00:00
|
|
|
Q_ENUMS(VAlignment)
|
|
|
|
Q_ENUMS(WrapMode)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_ENUMS(EchoMode)
|
|
|
|
Q_ENUMS(SelectionMode)
|
2011-12-15 01:36:54 +00:00
|
|
|
Q_ENUMS(CursorPosition)
|
2012-07-04 12:56:38 +00:00
|
|
|
Q_ENUMS(RenderType)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
|
2012-01-04 00:53:26 +00:00
|
|
|
Q_PROPERTY(int length READ length NOTIFY textChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
|
|
|
|
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
|
|
|
|
Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
|
|
|
|
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
|
|
|
|
Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
|
|
|
|
Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged)
|
2011-12-15 01:36:54 +00:00
|
|
|
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
|
|
|
|
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
|
|
|
|
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
|
|
|
|
Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
|
2012-02-23 04:11:48 +00:00
|
|
|
Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
|
2012-02-16 04:43:03 +00:00
|
|
|
Q_PROPERTY(QQmlComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
|
|
|
|
Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
|
|
|
|
Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
|
|
|
|
|
|
|
|
Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength NOTIFY maximumLengthChanged)
|
|
|
|
Q_PROPERTY(QValidator* validator READ validator WRITE setValidator NOTIFY validatorChanged)
|
|
|
|
Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask NOTIFY inputMaskChanged)
|
2012-02-15 12:30:44 +00:00
|
|
|
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
|
|
|
|
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
|
|
|
|
Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
|
|
|
|
Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
|
2014-03-11 10:04:52 +00:00
|
|
|
Q_PROPERTY(int passwordMaskDelay READ passwordMaskDelay WRITE setPasswordMaskDelay RESET resetPasswordMaskDelay NOTIFY passwordMaskDelayChanged REVISION 3)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
|
|
|
|
Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
|
|
|
|
Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
|
|
|
|
Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged)
|
2012-01-20 06:10:23 +00:00
|
|
|
Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged)
|
2012-01-10 01:52:43 +00:00
|
|
|
Q_PROPERTY(bool canUndo READ canUndo NOTIFY canUndoChanged)
|
|
|
|
Q_PROPERTY(bool canRedo READ canRedo NOTIFY canRedoChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged)
|
2012-02-07 01:57:42 +00:00
|
|
|
Q_PROPERTY(qreal contentWidth READ contentWidth NOTIFY contentSizeChanged)
|
|
|
|
Q_PROPERTY(qreal contentHeight READ contentHeight NOTIFY contentSizeChanged)
|
2012-07-04 12:56:38 +00:00
|
|
|
Q_PROPERTY(RenderType renderType READ renderType WRITE setRenderType NOTIFY renderTypeChanged)
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
public:
|
2011-10-14 08:51:42 +00:00
|
|
|
QQuickTextInput(QQuickItem * parent=0);
|
|
|
|
~QQuickTextInput();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2014-08-09 14:18:01 +00:00
|
|
|
void componentComplete() Q_DECL_OVERRIDE;
|
2011-12-15 01:36:54 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
enum EchoMode {//To match QLineEdit::EchoMode
|
|
|
|
Normal,
|
|
|
|
NoEcho,
|
|
|
|
Password,
|
|
|
|
PasswordEchoOnEdit
|
|
|
|
};
|
|
|
|
|
|
|
|
enum HAlignment {
|
|
|
|
AlignLeft = Qt::AlignLeft,
|
|
|
|
AlignRight = Qt::AlignRight,
|
|
|
|
AlignHCenter = Qt::AlignHCenter
|
|
|
|
};
|
|
|
|
|
2011-12-15 01:36:54 +00:00
|
|
|
enum VAlignment {
|
|
|
|
AlignTop = Qt::AlignTop,
|
|
|
|
AlignBottom = Qt::AlignBottom,
|
|
|
|
AlignVCenter = Qt::AlignVCenter
|
|
|
|
};
|
|
|
|
|
|
|
|
enum WrapMode {
|
|
|
|
NoWrap = QTextOption::NoWrap,
|
|
|
|
WordWrap = QTextOption::WordWrap,
|
|
|
|
WrapAnywhere = QTextOption::WrapAnywhere,
|
|
|
|
WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere, // COMPAT
|
|
|
|
Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
|
|
|
|
};
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
enum SelectionMode {
|
|
|
|
SelectCharacters,
|
|
|
|
SelectWords
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CursorPosition {
|
|
|
|
CursorBetweenCharacters,
|
|
|
|
CursorOnCharacter
|
|
|
|
};
|
|
|
|
|
2012-07-04 12:56:38 +00:00
|
|
|
enum RenderType { QtRendering,
|
|
|
|
NativeRendering
|
|
|
|
};
|
2011-12-15 01:36:54 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
//Auxilliary functions needed to control the TextInput from QML
|
2013-05-08 14:22:39 +00:00
|
|
|
Q_INVOKABLE void positionAt(QQmlV4Function *args) const;
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_INVOKABLE QRectF positionToRectangle(int pos) const;
|
|
|
|
Q_INVOKABLE void moveCursorSelection(int pos);
|
|
|
|
Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode);
|
|
|
|
|
2012-07-04 12:56:38 +00:00
|
|
|
RenderType renderType() const;
|
|
|
|
void setRenderType(RenderType renderType);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QString text() const;
|
|
|
|
void setText(const QString &);
|
|
|
|
|
2012-01-04 00:53:26 +00:00
|
|
|
int length() const;
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QFont font() const;
|
|
|
|
void setFont(const QFont &font);
|
|
|
|
|
|
|
|
QColor color() const;
|
|
|
|
void setColor(const QColor &c);
|
|
|
|
|
|
|
|
QColor selectionColor() const;
|
|
|
|
void setSelectionColor(const QColor &c);
|
|
|
|
|
|
|
|
QColor selectedTextColor() const;
|
|
|
|
void setSelectedTextColor(const QColor &c);
|
|
|
|
|
|
|
|
HAlignment hAlign() const;
|
|
|
|
void setHAlign(HAlignment align);
|
|
|
|
void resetHAlign();
|
|
|
|
HAlignment effectiveHAlign() const;
|
|
|
|
|
2011-12-15 01:36:54 +00:00
|
|
|
VAlignment vAlign() const;
|
|
|
|
void setVAlign(VAlignment align);
|
|
|
|
|
|
|
|
WrapMode wrapMode() const;
|
|
|
|
void setWrapMode(WrapMode w);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool isReadOnly() const;
|
|
|
|
void setReadOnly(bool);
|
|
|
|
|
|
|
|
bool isCursorVisible() const;
|
|
|
|
void setCursorVisible(bool on);
|
|
|
|
|
|
|
|
int cursorPosition() const;
|
|
|
|
void setCursorPosition(int cp);
|
|
|
|
|
2012-02-23 04:11:48 +00:00
|
|
|
QRectF cursorRectangle() const;
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
int selectionStart() const;
|
|
|
|
int selectionEnd() const;
|
|
|
|
|
|
|
|
QString selectedText() const;
|
|
|
|
|
|
|
|
int maxLength() const;
|
|
|
|
void setMaxLength(int ml);
|
|
|
|
|
|
|
|
QValidator * validator() const;
|
|
|
|
void setValidator(QValidator* v);
|
2014-09-09 15:35:33 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QString inputMask() const;
|
|
|
|
void setInputMask(const QString &im);
|
|
|
|
|
|
|
|
EchoMode echoMode() const;
|
|
|
|
void setEchoMode(EchoMode echo);
|
|
|
|
|
|
|
|
QString passwordCharacter() const;
|
|
|
|
void setPasswordCharacter(const QString &str);
|
|
|
|
|
2014-03-11 10:04:52 +00:00
|
|
|
int passwordMaskDelay() const;
|
|
|
|
void setPasswordMaskDelay(int delay);
|
|
|
|
void resetPasswordMaskDelay();
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QString displayText() const;
|
|
|
|
|
2012-02-16 04:43:03 +00:00
|
|
|
QQmlComponent* cursorDelegate() const;
|
|
|
|
void setCursorDelegate(QQmlComponent*);
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
bool focusOnPress() const;
|
|
|
|
void setFocusOnPress(bool);
|
|
|
|
|
|
|
|
bool autoScroll() const;
|
|
|
|
void setAutoScroll(bool);
|
|
|
|
|
|
|
|
bool selectByMouse() const;
|
|
|
|
void setSelectByMouse(bool);
|
|
|
|
|
|
|
|
SelectionMode mouseSelectionMode() const;
|
|
|
|
void setMouseSelectionMode(SelectionMode mode);
|
|
|
|
|
2012-01-20 06:10:23 +00:00
|
|
|
bool persistentSelection() const;
|
|
|
|
void setPersistentSelection(bool persist);
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool hasAcceptableInput() const;
|
|
|
|
|
2012-11-22 17:47:45 +00:00
|
|
|
#ifndef QT_NO_IM
|
2014-08-09 14:18:01 +00:00
|
|
|
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
|
2014-12-04 08:50:44 +00:00
|
|
|
Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
|
2012-11-22 17:47:45 +00:00
|
|
|
#endif
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2014-08-09 14:18:01 +00:00
|
|
|
QRectF boundingRect() const Q_DECL_OVERRIDE;
|
|
|
|
QRectF clipRect() const Q_DECL_OVERRIDE;
|
2012-04-19 01:08:28 +00:00
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool canPaste() const;
|
|
|
|
|
2012-01-10 01:52:43 +00:00
|
|
|
bool canUndo() const;
|
|
|
|
bool canRedo() const;
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
bool isInputMethodComposing() const;
|
|
|
|
|
2012-02-15 12:30:44 +00:00
|
|
|
Qt::InputMethodHints inputMethodHints() const;
|
|
|
|
void setInputMethodHints(Qt::InputMethodHints hints);
|
2011-05-04 07:53:51 +00:00
|
|
|
|
2012-01-04 00:53:26 +00:00
|
|
|
Q_INVOKABLE QString getText(int start, int end) const;
|
|
|
|
|
2012-02-07 01:57:42 +00:00
|
|
|
qreal contentWidth() const;
|
|
|
|
qreal contentHeight() const;
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void textChanged();
|
|
|
|
void cursorPositionChanged();
|
2011-07-25 02:55:57 +00:00
|
|
|
void cursorRectangleChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void selectionStartChanged();
|
|
|
|
void selectionEndChanged();
|
|
|
|
void selectedTextChanged();
|
|
|
|
void accepted();
|
|
|
|
void acceptableInputChanged();
|
2013-11-21 10:06:24 +00:00
|
|
|
Q_REVISION(2) void editingFinished();
|
2012-02-20 07:18:20 +00:00
|
|
|
void colorChanged();
|
|
|
|
void selectionColorChanged();
|
|
|
|
void selectedTextColorChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void fontChanged(const QFont &font);
|
|
|
|
void horizontalAlignmentChanged(HAlignment alignment);
|
2011-12-15 01:36:54 +00:00
|
|
|
void verticalAlignmentChanged(VAlignment alignment);
|
|
|
|
void wrapModeChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void readOnlyChanged(bool isReadOnly);
|
|
|
|
void cursorVisibleChanged(bool isCursorVisible);
|
|
|
|
void cursorDelegateChanged();
|
|
|
|
void maximumLengthChanged(int maximumLength);
|
|
|
|
void validatorChanged();
|
|
|
|
void inputMaskChanged(const QString &inputMask);
|
|
|
|
void echoModeChanged(EchoMode echoMode);
|
|
|
|
void passwordCharacterChanged();
|
2014-03-11 10:04:52 +00:00
|
|
|
Q_REVISION(3) void passwordMaskDelayChanged(int delay);
|
2011-04-27 12:13:26 +00:00
|
|
|
void displayTextChanged();
|
|
|
|
void activeFocusOnPressChanged(bool activeFocusOnPress);
|
|
|
|
void autoScrollChanged(bool autoScroll);
|
|
|
|
void selectByMouseChanged(bool selectByMouse);
|
|
|
|
void mouseSelectionModeChanged(SelectionMode mode);
|
2012-01-20 06:10:23 +00:00
|
|
|
void persistentSelectionChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void canPasteChanged();
|
2012-01-10 01:52:43 +00:00
|
|
|
void canUndoChanged();
|
|
|
|
void canRedoChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
void inputMethodComposingChanged();
|
|
|
|
void effectiveHorizontalAlignmentChanged();
|
2012-02-07 01:57:42 +00:00
|
|
|
void contentSizeChanged();
|
2012-02-15 12:30:44 +00:00
|
|
|
void inputMethodHintsChanged();
|
2012-07-04 12:56:38 +00:00
|
|
|
void renderTypeChanged();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2014-10-16 14:57:08 +00:00
|
|
|
private:
|
|
|
|
void invalidateFontCaches();
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
protected:
|
2014-08-09 14:18:01 +00:00
|
|
|
void geometryChanged(const QRectF &newGeometry,
|
|
|
|
const QRectF &oldGeometry) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE;
|
2012-11-22 17:47:45 +00:00
|
|
|
#ifndef QT_NO_IM
|
2014-08-09 14:18:01 +00:00
|
|
|
void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
|
2012-11-22 17:47:45 +00:00
|
|
|
#endif
|
2014-08-09 14:18:01 +00:00
|
|
|
void mouseUngrabEvent() Q_DECL_OVERRIDE;
|
|
|
|
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
|
|
|
void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE;
|
2014-10-16 14:57:08 +00:00
|
|
|
void updatePolish();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void selectAll();
|
|
|
|
void selectWord();
|
|
|
|
void select(int start, int end);
|
|
|
|
void deselect();
|
|
|
|
bool isRightToLeft(int start, int end);
|
|
|
|
#ifndef QT_NO_CLIPBOARD
|
|
|
|
void cut();
|
|
|
|
void copy();
|
|
|
|
void paste();
|
|
|
|
#endif
|
2012-01-10 01:52:43 +00:00
|
|
|
void undo();
|
|
|
|
void redo();
|
2012-01-04 00:53:26 +00:00
|
|
|
void insert(int position, const QString &text);
|
|
|
|
void remove(int start, int end);
|
2014-05-16 12:35:23 +00:00
|
|
|
Q_REVISION(3) void ensureVisible(int position);
|
2011-04-27 12:13:26 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void selectionChanged();
|
|
|
|
void createCursor();
|
2014-05-16 12:35:23 +00:00
|
|
|
void updateCursorRectangle(bool scroll = true);
|
2011-04-27 12:13:26 +00:00
|
|
|
void q_canPasteChanged();
|
2012-01-09 11:41:36 +00:00
|
|
|
void q_updateAlignment();
|
2011-11-24 12:48:19 +00:00
|
|
|
void triggerPreprocess();
|
2011-04-27 12:13:26 +00:00
|
|
|
|
2012-06-21 06:44:30 +00:00
|
|
|
#ifndef QT_NO_VALIDATOR
|
|
|
|
void q_validatorChanged();
|
|
|
|
#endif
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
private:
|
2012-05-04 06:07:32 +00:00
|
|
|
friend class QQuickTextUtil;
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
Q_DECLARE_PRIVATE(QQuickTextInput)
|
2011-04-27 12:13:26 +00:00
|
|
|
};
|
|
|
|
|
2012-01-19 05:53:20 +00:00
|
|
|
#ifndef QT_NO_VALIDATOR
|
|
|
|
class Q_AUTOTEST_EXPORT QQuickIntValidator : public QIntValidator
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString locale READ localeName WRITE setLocaleName RESET resetLocaleName NOTIFY localeNameChanged)
|
|
|
|
public:
|
|
|
|
QQuickIntValidator(QObject *parent = 0);
|
|
|
|
|
|
|
|
QString localeName() const;
|
|
|
|
void setLocaleName(const QString &name);
|
|
|
|
void resetLocaleName();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void localeNameChanged();
|
|
|
|
};
|
|
|
|
|
|
|
|
class Q_AUTOTEST_EXPORT QQuickDoubleValidator : public QDoubleValidator
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString locale READ localeName WRITE setLocaleName RESET resetLocaleName NOTIFY localeNameChanged)
|
|
|
|
public:
|
|
|
|
QQuickDoubleValidator(QObject *parent = 0);
|
|
|
|
|
|
|
|
QString localeName() const;
|
|
|
|
void setLocaleName(const QString &name);
|
|
|
|
void resetLocaleName();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void localeNameChanged();
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2011-04-27 12:13:26 +00:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
QML_DECLARE_TYPE(QQuickTextInput)
|
2011-04-27 12:13:26 +00:00
|
|
|
#ifndef QT_NO_VALIDATOR
|
|
|
|
QML_DECLARE_TYPE(QValidator)
|
2012-01-19 05:53:20 +00:00
|
|
|
QML_DECLARE_TYPE(QQuickIntValidator)
|
|
|
|
QML_DECLARE_TYPE(QQuickDoubleValidator)
|
2011-04-27 12:13:26 +00:00
|
|
|
QML_DECLARE_TYPE(QRegExpValidator)
|
|
|
|
#endif
|
|
|
|
|
2011-10-14 08:51:42 +00:00
|
|
|
#endif // QQUICKTEXTINPUT_P_H
|