summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextinput_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextinput_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 64aff7d..c0c1e50 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -86,6 +86,9 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedIte
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
+ Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
+ Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
+ Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
public:
QDeclarativeTextInput(QDeclarativeItem* parent=0);
@@ -104,9 +107,9 @@ public:
AlignHCenter = Qt::AlignHCenter
};
- //### Should we have this function, x based properties,
- //### or copy TextEdit with x instead of QTextCursor?
- Q_INVOKABLE int xToPos(int x);
+ //Auxilliary functions needed to control the TextInput from QML
+ Q_INVOKABLE int xToPosition(int x);
+ Q_INVOKABLE void moveCursorSelection(int pos);
QString text() const;
void setText(const QString &);
@@ -157,12 +160,20 @@ public:
EchoMode echoMode() const;
void setEchoMode(EchoMode echo);
+ QString passwordCharacter() const;
+ void setPasswordCharacter(const QString &str);
+
+ QString displayText() const;
+
QDeclarativeComponent* cursorDelegate() const;
void setCursorDelegate(QDeclarativeComponent*);
bool focusOnPress() const;
void setFocusOnPress(bool);
+ bool autoScroll() const;
+ void setAutoScroll(bool);
+
bool hasAcceptableInput() const;
void drawContents(QPainter *p,const QRect &r);
@@ -188,13 +199,17 @@ Q_SIGNALS:
void validatorChanged();
void inputMaskChanged(const QString &inputMask);
void echoModeChanged(EchoMode echoMode);
+ void passwordCharacterChanged();
+ void displayTextChanged(const QString &text);
void focusOnPressChanged(bool focusOnPress);
+ void autoScrollChanged(bool autoScroll);
protected:
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void keyPressEvent(QKeyEvent* ev);
bool event(QEvent *e);
@@ -220,10 +235,8 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QDeclarativeTextInput)
QML_DECLARE_TYPE(QValidator)
QML_DECLARE_TYPE(QIntValidator)
-#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
QML_DECLARE_TYPE(QDoubleValidator)
QML_DECLARE_TYPE(QRegExpValidator)
-#endif
QT_END_HEADER