Qt 4.8
Public Types | Public Slots | Signals | Public Functions | Protected Functions | Private Slots | Properties | List of all members
QDeclarativeTextInput Class Reference

#include <qdeclarativetextinput_p.h>

Inheritance diagram for QDeclarativeTextInput:
QDeclarativeImplicitSizePaintedItem QDeclarativePaintedItem QDeclarativeItem QGraphicsObject QDeclarativeParserStatus QObject QGraphicsItem

Public Types

enum  CursorPosition { CursorBetweenCharacters, CursorOnCharacter }
 
enum  EchoMode { Normal, NoEcho, Password, PasswordEchoOnEdit }
 
enum  HAlignment { AlignLeft = Qt::AlignLeft, AlignRight = Qt::AlignRight, AlignHCenter = Qt::AlignHCenter }
 
enum  SelectionMode { SelectCharacters, SelectWords }
 
- Public Types inherited from QDeclarativeItem
enum  TransformOrigin {
  TopLeft, Top, TopRight, Left,
  Center, Right, BottomLeft, Bottom,
  BottomRight
}
 Controls the point about which simple transforms like scale apply. More...
 
- Public Types inherited from QGraphicsItem
enum  { Type = 1, UserType = 65536 }
 
enum  CacheMode { NoCache, ItemCoordinateCache, DeviceCoordinateCache }
 This enum describes QGraphicsItem's cache modes. More...
 
enum  GraphicsItemChange {
  ItemPositionChange, ItemMatrixChange, ItemVisibleChange, ItemEnabledChange,
  ItemSelectedChange, ItemParentChange, ItemChildAddedChange, ItemChildRemovedChange,
  ItemTransformChange, ItemPositionHasChanged, ItemTransformHasChanged, ItemSceneChange,
  ItemVisibleHasChanged, ItemEnabledHasChanged, ItemSelectedHasChanged, ItemParentHasChanged,
  ItemSceneHasChanged, ItemCursorChange, ItemCursorHasChanged, ItemToolTipChange,
  ItemToolTipHasChanged, ItemFlagsChange, ItemFlagsHaveChanged, ItemZValueChange,
  ItemZValueHasChanged, ItemOpacityChange, ItemOpacityHasChanged, ItemScenePositionHasChanged,
  ItemRotationChange, ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
  ItemTransformOriginPointChange, ItemTransformOriginPointHasChanged
}
 This enum describes the state changes that are notified by QGraphicsItem::itemChange(). More...
 
enum  GraphicsItemFlag {
  ItemIsMovable = 0x1, ItemIsSelectable = 0x2, ItemIsFocusable = 0x4, ItemClipsToShape = 0x8,
  ItemClipsChildrenToShape = 0x10, ItemIgnoresTransformations = 0x20, ItemIgnoresParentOpacity = 0x40, ItemDoesntPropagateOpacityToChildren = 0x80,
  ItemStacksBehindParent = 0x100, ItemUsesExtendedStyleOption = 0x200, ItemHasNoContents = 0x400, ItemSendsGeometryChanges = 0x800,
  ItemAcceptsInputMethod = 0x1000, ItemNegativeZStacksBehindParent = 0x2000, ItemIsPanel = 0x4000, ItemIsFocusScope = 0x8000,
  ItemSendsScenePositionChanges = 0x10000, ItemStopsClickFocusPropagation = 0x20000, ItemStopsFocusHandling = 0x40000
}
 This enum describes different flags that you can set on an item to toggle different features in the item's behavior. More...
 
enum  PanelModality { NonModal, PanelModal, SceneModal }
 This enum specifies the behavior of a modal panel. More...
 

Public Slots

void copy ()
 
void cut ()
 
void deselect ()
 
bool isRightToLeft (int start, int end)
 
void paste ()
 
void select (int start, int end)
 
void selectAll ()
 
void selectWord ()
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Signals

void acceptableInputChanged ()
 
void accepted ()
 
void activeFocusOnPressChanged (bool activeFocusOnPress)
 
void autoScrollChanged (bool autoScroll)
 
void canPasteChanged ()
 
void colorChanged (const QColor &color)
 
void cursorDelegateChanged ()
 
void cursorPositionChanged ()
 
void cursorRectangleChanged ()
 
void cursorVisibleChanged (bool isCursorVisible)
 
void displayTextChanged ()
 
void echoModeChanged (EchoMode echoMode)
 
void fontChanged (const QFont &font)
 
void horizontalAlignmentChanged (HAlignment alignment)
 
void inputMaskChanged (const QString &inputMask)
 
void inputMethodComposingChanged ()
 
void maximumLengthChanged (int maximumLength)
 
void mouseSelectionModeChanged (SelectionMode mode)
 
void passwordCharacterChanged ()
 
void readOnlyChanged (bool isReadOnly)
 
void selectByMouseChanged (bool selectByMouse)
 
void selectedTextChanged ()
 
void selectedTextColorChanged (const QColor &color)
 
void selectionColorChanged (const QColor &color)
 
void selectionEndChanged ()
 
void selectionStartChanged ()
 
void textChanged ()
 
void validatorChanged ()
 
- Signals inherited from QDeclarativeImplicitSizePaintedItem
void implicitHeightChanged ()
 
void implicitWidthChanged ()
 
- Signals inherited from QDeclarativePaintedItem
void contentsScaleChanged ()
 
void contentsSizeChanged ()
 
void fillColorChanged ()
 
- Signals inherited from QDeclarativeItem
void activeFocusChanged (bool)
 
void baselineOffsetChanged (qreal)
 
void childrenRectChanged (const QRectF &)
 
void clipChanged (bool)
 
void focusChanged (bool)
 
void implicitHeightChanged ()
 
void implicitWidthChanged ()
 
void parentChanged (QDeclarativeItem *)
 
void smoothChanged (bool)
 
void stateChanged (const QString &)
 
void transformOriginChanged (TransformOrigin)
 
- Signals inherited from QGraphicsObject
void childrenChanged ()
 This signal gets emitted whenever the children list changes. More...
 
void enabledChanged ()
 This signal gets emitted whenever the item get's enabled or disabled. More...
 
void heightChanged ()
 
void opacityChanged ()
 This signal gets emitted whenever the opacity of the item changes. More...
 
void parentChanged ()
 This signal gets emitted whenever the parent of the item changes. More...
 
void rotationChanged ()
 This signal gets emitted whenever the roation of the item changes. More...
 
void scaleChanged ()
 This signal is emitted when the scale of the item changes. More...
 
void visibleChanged ()
 This signal gets emitted whenever the visibility of the item changes. More...
 
void widthChanged ()
 
void xChanged ()
 This signal gets emitted whenever the x position of the item changes. More...
 
void yChanged ()
 This signal gets emitted whenever the y position of the item changes. More...
 
void zChanged ()
 This signal gets emitted whenever the z value of the item changes. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

bool autoScroll () const
 
QRectF boundingRect () const
 
bool canPaste () const
 
Q_INVOKABLE void closeSoftwareInputPanel ()
 
QColor color () const
 
QDeclarativeComponentcursorDelegate () const
 
int cursorPosition () const
 
QRect cursorRectangle () const
 
QString displayText () const
 
void drawContents (QPainter *p, const QRect &r)
 This function is called when the cache needs to be refreshed. More...
 
EchoMode echoMode () const
 
HAlignment effectiveHAlign () const
 
bool focusOnPress () const
 
QFont font () const
 
HAlignment hAlign () const
 
bool hasAcceptableInput () const
 
Qt::InputMethodHints imHints () const
 
QString inputMask () const
 
QVariant inputMethodQuery (Qt::InputMethodQuery property) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns the value of the given property. More...
 
bool isCursorVisible () const
 
bool isInputMethodComposing () const
 
bool isReadOnly () const
 
int maxLength () const
 
SelectionMode mouseSelectionMode () const
 
Q_INVOKABLE void moveCursorSelection (int pos)
 
Q_INVOKABLE void moveCursorSelection (int pos, SelectionMode mode)
 
Q_INVOKABLE void openSoftwareInputPanel ()
 
QString passwordCharacter () const
 
Q_INVOKABLE int positionAt (int x) const
 
Q_INVOKABLE int positionAt (int x, CursorPosition position) const
 
Q_INVOKABLE QRectF positionToRectangle (int pos) const
 
 QDeclarativeTextInput (QDeclarativeItem *parent=0)
 
void resetHAlign ()
 
bool selectByMouse () const
 
QString selectedText () const
 
QColor selectedTextColor () const
 
QColor selectionColor () const
 
int selectionEnd () const
 
int selectionStart () const
 
void setAutoScroll (bool)
 
void setColor (const QColor &c)
 
void setCursorDelegate (QDeclarativeComponent *)
 
void setCursorPosition (int cp)
 
void setCursorVisible (bool on)
 
void setEchoMode (EchoMode echo)
 
void setFocusOnPress (bool)
 
void setFont (const QFont &font)
 
void setHAlign (HAlignment align)
 
void setIMHints (Qt::InputMethodHints hints)
 
void setInputMask (const QString &im)
 
void setMaxLength (int ml)
 
void setMouseSelectionMode (SelectionMode mode)
 
void setPasswordCharacter (const QString &str)
 
void setReadOnly (bool)
 
void setSelectByMouse (bool)
 
void setSelectedTextColor (const QColor &c)
 
void setSelectionColor (const QColor &c)
 
void setText (const QString &)
 
void setValidator (QValidator *v)
 
QString text () const
 
QValidatorvalidator () const
 
 ~QDeclarativeTextInput ()
 
- Public Functions inherited from QDeclarativeImplicitSizePaintedItem
 QDeclarativeImplicitSizePaintedItem (QDeclarativeItem *parent=0)
 
- Public Functions inherited from QDeclarativePaintedItem
qreal contentsScale () const
 
QSize contentsSize () const
 
QColor fillColor () const
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
 
int pixelCacheSize () const
 
 QDeclarativePaintedItem (QDeclarativeItem *parent=0)
 Constructs a new QDeclarativePaintedItem with the given parent. More...
 
void setContentsScale (qreal)
 
void setContentsSize (const QSize &)
 Sets the size of the contents to the given size. More...
 
void setFillColor (const QColor &)
 
void setPixelCacheSize (int pixels)
 
void setSmoothCache (bool on)
 
bool smoothCache () const
 
 ~QDeclarativePaintedItem ()
 Destroys the image item. More...
 
- Public Functions inherited from QDeclarativeItem
qreal baselineOffset () const
 
Q_INVOKABLE QDeclarativeItemchildAt (qreal x, qreal y) const
 Returns the visible child item at point (x, y), which is in this item's coordinate system, or 0 if there is no such item. More...
 
QRectF childrenRect ()
 
bool clip () const
 
Q_INVOKABLE void forceActiveFocus ()
 Forces active focus on the item. More...
 
bool hasActiveFocus () const
 
bool hasFocus () const
 
qreal height () const
 
qreal implicitHeight () const
 
qreal implicitWidth () const
 
bool keepMouseGrab () const
 Returns a value indicating whether mouse input should remain with this item exclusively. More...
 
Q_INVOKABLE QScriptValue mapFromItem (const QScriptValue &item, qreal x, qreal y) const
 Maps the point (x, y), which is in item's coordinate system, to this item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate. More...
 
Q_INVOKABLE QScriptValue mapToItem (const QScriptValue &item, qreal x, qreal y) const
 Maps the point (x, y), which is in this item's coordinate system, to item's coordinate system, and returns a script value with x and y properties matching the mapped cooordinate. More...
 
QDeclarativeItemparentItem () const
 Returns the QDeclarativeItem parent of this item. More...
 
 QDeclarativeItem (QDeclarativeItem *parent=0)
 Constructs a QDeclarativeItem with the given parent. More...
 
void resetHeight ()
 
void resetWidth ()
 
void setBaselineOffset (qreal)
 
void setClip (bool)
 
void setFocus (bool)
 
void setHeight (qreal)
 
void setKeepMouseGrab (bool)
 The flag indicating whether the mouse should remain with this item is set to keep. More...
 
void setParentItem (QDeclarativeItem *parent)
 
void setSize (const QSizeF &size)
 
void setSmooth (bool)
 Sets whether the item should be drawn with antialiasing and smooth pixmap filtering to smooth. More...
 
void setTransformOrigin (TransformOrigin)
 Set the transform origin. More...
 
void setWidth (qreal)
 
bool smooth () const
 
QDeclarativeListProperty< QGraphicsTransformtransform ()
 
TransformOrigin transformOrigin () const
 
qreal width () const
 
virtual ~QDeclarativeItem ()
 Destroys the QDeclarativeItem. More...
 
- Public Functions inherited from QGraphicsObject
void grabGesture (Qt::GestureType type, Qt::GestureFlags flags=Qt::GestureFlags())
 Subscribes the graphics object to the given gesture with specific flags. More...
 
 QGraphicsObject (QGraphicsItem *parent=0)
 Constructs a QGraphicsObject with parent. More...
 
void ungrabGesture (Qt::GestureType type)
 Unsubscribes the graphics object from the given gesture. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QGraphicsItem
bool acceptDrops () const
 Returns true if this item can accept drag and drop events; otherwise, returns false. More...
 
Qt::MouseButtons acceptedMouseButtons () const
 Returns the mouse buttons that this item accepts mouse events for. More...
 
bool acceptHoverEvents () const
 Returns true if an item accepts hover events (QGraphicsSceneHoverEvent); otherwise, returns false. More...
 
bool acceptsHoverEvents () const
 Call acceptHoverEvents() instead. More...
 
bool acceptTouchEvents () const
 Returns true if an item accepts touch events; otherwise, returns false. More...
 
virtual void advance (int phase)
 This virtual function is called twice for all items by the QGraphicsScene::advance() slot. More...
 
QRegion boundingRegion (const QTransform &itemToDeviceTransform) const
 Returns the bounding region for this item. More...
 
qreal boundingRegionGranularity () const
 Returns the item's bounding region granularity; a value between and including 0 and 1. More...
 
CacheMode cacheMode () const
 Returns the cache mode for this item. More...
 
QList< QGraphicsItem * > childItems () const
 Returns a list of this item's children. More...
 
QList< QGraphicsItem * > children () const
 Use childItems() instead. More...
 
QRectF childrenBoundingRect () const
 Returns the bounding rect of this item's descendants (i.e., its children, their children, etc.) in local coordinates. More...
 
void clearFocus ()
 Takes keyboard input focus from the item. More...
 
QPainterPath clipPath () const
 Returns this item's clip path, or an empty QPainterPath if this item is not clipped. More...
 
virtual bool collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns true if this item collides with other; otherwise returns false. More...
 
virtual bool collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns true if this item collides with path. More...
 
QList< QGraphicsItem * > collidingItems (Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns a list of all items that collide with this item. More...
 
QGraphicsItemcommonAncestorItem (const QGraphicsItem *other) const
 Returns the closest common ancestor item of this item and other, or 0 if either other is 0, or there is no common ancestor. More...
 
virtual bool contains (const QPointF &point) const
 Returns true if this item contains point, which is in local coordinates; otherwise, false is returned. More...
 
QCursor cursor () const
 Returns the current cursor shape for the item. More...
 
QVariant data (int key) const
 Returns this item's custom data for the key key as a QVariant. More...
 
QTransform deviceTransform (const QTransform &viewportTransform) const
 Returns this item's device transformation matrix, using viewportTransform to map from scene to device coordinates. More...
 
qreal effectiveOpacity () const
 Returns this item's effective opacity, which is between 0. More...
 
void ensureVisible (const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
 If this item is part of a scene that is viewed by a QGraphicsView, this convenience function will attempt to scroll the view to ensure that rect is visible inside the view's viewport. More...
 
void ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin=50, int ymargin=50)
 This convenience function is equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin): More...
 
bool filtersChildEvents () const
 Returns true if this item filters child events (i. More...
 
GraphicsItemFlags flags () const
 Returns this item's flags. More...
 
QGraphicsItemfocusItem () const
 If this item, a child or descendant of this item currently has input focus, this function will return a pointer to that item. More...
 
QGraphicsItemfocusProxy () const
 Returns this item's focus proxy, or 0 if this item has no focus proxy. More...
 
QGraphicsItemfocusScopeItem () const
 Returns this item's focus scope item. More...
 
void grabKeyboard ()
 Grabs the keyboard input. More...
 
void grabMouse ()
 Grabs the mouse input. More...
 
QGraphicsEffectgraphicsEffect () const
 Returns a pointer to this item's effect if it has one; otherwise 0. More...
 
QGraphicsItemGroupgroup () const
 Returns a pointer to this item's item group, or 0 if this item is not member of a group. More...
 
bool handlesChildEvents () const
 Returns true if this item handles child events (i. More...
 
bool hasCursor () const
 Returns true if this item has a cursor set; otherwise, false is returned. More...
 
bool hasFocus () const
 Returns true if this item is active, and it or its focus proxy has keyboard input focus; otherwise, returns false. More...
 
void hide ()
 Hides the item. More...
 
Qt::InputMethodHints inputMethodHints () const
 Returns the current input method hints of this item. More...
 
void installSceneEventFilter (QGraphicsItem *filterItem)
 Installs an event filter for this item on filterItem, causing all events for this item to first pass through filterItem's sceneEventFilter() function. More...
 
bool isActive () const
 Returns true if this item is active; otherwise returns false. More...
 
bool isAncestorOf (const QGraphicsItem *child) const
 Returns true if this item is an ancestor of child (i.e., if this item is child's parent, or one of child's parent's ancestors). More...
 
bool isBlockedByModalPanel (QGraphicsItem **blockingPanel=0) const
 Returns true if this item is blocked by a modal panel, false otherwise. More...
 
bool isClipped () const
 Returns true if this item is clipped. More...
 
bool isEnabled () const
 Returns true if the item is enabled; otherwise, false is returned. More...
 
bool isObscured () const
 Returns true if this item's bounding rect is completely obscured by the opaque shape of any of colliding items above it (i.e., with a higher Z value than this item). More...
 
bool isObscured (const QRectF &rect) const
 Returns true if rect is completely obscured by the opaque shape of any of colliding items above it (i. More...
 
bool isObscured (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling isObscured(QRectF(x, y, w, h)). More...
 
virtual bool isObscuredBy (const QGraphicsItem *item) const
 Returns true if this item's bounding rect is completely obscured by the opaque shape of item. More...
 
bool isPanel () const
 Returns true if the item is a panel; otherwise returns false. More...
 
bool isSelected () const
 Returns true if this item is selected; otherwise, false is returned. More...
 
bool isUnderMouse () const
 Returns true if this item is currently under the mouse cursor in one of the views; otherwise, false is returned. More...
 
bool isVisible () const
 Returns true if the item is visible; otherwise, false is returned. More...
 
bool isVisibleTo (const QGraphicsItem *parent) const
 Returns true if the item is visible to parent; otherwise, false is returned. More...
 
bool isWidget () const
 Returns true if this item is a widget (i. More...
 
bool isWindow () const
 Returns true if the item is a QGraphicsWidget window, otherwise returns false. More...
 
QTransform itemTransform (const QGraphicsItem *other, bool *ok=0) const
 Returns a QTransform that maps coordinates from this item to other. More...
 
QPointF mapFromItem (const QGraphicsItem *item, const QPointF &point) const
 Maps the point point, which is in item's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 Maps the polygon polygon, which is in item's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const
 Maps the path path, which is in item's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapFromItem(item, QPointF(x, y)). More...
 
QPolygonF mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapFromParent (const QPointF &point) const
 Maps the point point, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromParent (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromParent (const QPainterPath &path) const
 Maps the path path, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromParent (qreal x, qreal y) const
 This convenience function is equivalent to calling mapFromParent(QPointF(x, y)). More...
 
QPolygonF mapFromParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapFromItem(QRectF(x, y, w, h)). More...
 
QPointF mapFromScene (const QPointF &point) const
 Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapFromScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapFromScene (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapFromScene (const QPainterPath &path) const
 Maps the path path, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped path. More...
 
QPointF mapFromScene (qreal x, qreal y) const
 This convenience function is equivalent to calling mapFromScene(QPointF(x, y)). More...
 
QPolygonF mapFromScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapFromScene(QRectF(x, y, w, h)). More...
 
QRectF mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectFromParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectFromParent(QRectF(x, y, w, h)). More...
 
QRectF mapRectFromScene (const QRectF &rect) const
 Maps the rectangle rect, which is in scene coordinates, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectFromScene(QRectF(x, y, w, h)). More...
 
QRectF mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QRectF mapRectToParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectToParent(QRectF(x, y, w, h)). More...
 
QRectF mapRectToScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to the scene coordinate system, and returns the mapped rectangle as a new rectangle (i. More...
 
QRectF mapRectToScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapRectToScene(QRectF(x, y, w, h)). More...
 
QPointF mapToItem (const QGraphicsItem *item, const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to item's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToItem (const QGraphicsItem *item, const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to item's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToItem (const QGraphicsItem *item, const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to item's coordinate system, and returns the mapped path. More...
 
QPointF mapToItem (const QGraphicsItem *item, qreal x, qreal y) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapToItem(item, QPointF(x, y)). More...
 
QPolygonF mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const
 
QPointF mapToParent (const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToParent (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToParent (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToParent (const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped path. More...
 
QPointF mapToParent (qreal x, qreal y) const
 This convenience function is equivalent to calling mapToParent(QPointF(x, y)). More...
 
QPolygonF mapToParent (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapToParent(QRectF(x, y, w, h)). More...
 
QPointF mapToScene (const QPointF &point) const
 Maps the point point, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped coordinate. More...
 
QPolygonF mapToScene (const QRectF &rect) const
 Maps the rectangle rect, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped rectangle as a polygon. More...
 
QPolygonF mapToScene (const QPolygonF &polygon) const
 Maps the polygon polygon, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped polygon. More...
 
QPainterPath mapToScene (const QPainterPath &path) const
 Maps the path path, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped path. More...
 
QPointF mapToScene (qreal x, qreal y) const
 This convenience function is equivalent to calling mapToScene(QPointF(x, y)). More...
 
QPolygonF mapToScene (qreal x, qreal y, qreal w, qreal h) const
 This convenience function is equivalent to calling mapToScene(QRectF(x, y, w, h)). More...
 
QMatrix matrix () const
 Returns the item's affine transformation matrix. More...
 
void moveBy (qreal dx, qreal dy)
 Moves the item by dx points horizontally, and dy point vertically. More...
 
qreal opacity () const
 Returns this item's local opacity, which is between 0. More...
 
virtual QPainterPath opaqueArea () const
 This virtual function returns a shape representing the area where this item is opaque. More...
 
QGraphicsItempanel () const
 Returns the item's panel, or 0 if this item does not have a panel. More...
 
PanelModality panelModality () const
 Returns the modality for this item. More...
 
QGraphicsItemparentItem () const
 Returns a pointer to this item's parent item. More...
 
QGraphicsObjectparentObject () const
 Returns a pointer to the item's parent, cast to a QGraphicsObject. More...
 
QGraphicsWidgetparentWidget () const
 Returns a pointer to the item's parent widget. More...
 
QPointF pos () const
 Returns the position of the item in parent coordinates. More...
 
 QGraphicsItem (QGraphicsItem *parent=0)
 Constructs a QGraphicsItem with the given parent item. More...
 
void removeSceneEventFilter (QGraphicsItem *filterItem)
 Removes an event filter on this item from filterItem. More...
 
void resetMatrix ()
 Use resetTransform() instead. More...
 
void resetTransform ()
 Resets this item's transformation matrix to the identity matrix or all the transformation properties to their default values. More...
 
void rotate (qreal angle)
 Use. More...
 
qreal rotation () const
 Returns the clockwise rotation, in degrees, around the Z axis. More...
 
void scale (qreal sx, qreal sy)
 Use. More...
 
qreal scale () const
 Returns the scale factor of the item. More...
 
QGraphicsScenescene () const
 Returns the current scene for the item, or 0 if the item is not stored in a scene. More...
 
QRectF sceneBoundingRect () const
 Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with boundingRect(). More...
 
QMatrix sceneMatrix () const
 Use sceneTransform() instead. More...
 
QPointF scenePos () const
 Returns the item's position in scene coordinates. More...
 
QTransform sceneTransform () const
 Returns this item's scene transformation matrix. More...
 
void scroll (qreal dx, qreal dy, const QRectF &rect=QRectF())
 Scrolls the contents of rect by dx, dy. More...
 
void setAcceptDrops (bool on)
 If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and drop events. More...
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 Sets the mouse buttons that this item accepts mouse events for. More...
 
void setAcceptHoverEvents (bool enabled)
 If enabled is true, this item will accept hover events; otherwise, it will ignore them. More...
 
void setAcceptsHoverEvents (bool enabled)
 Use setAcceptHoverEvents(enabled) instead. More...
 
void setAcceptTouchEvents (bool enabled)
 If enabled is true, this item will accept touch events; otherwise, it will ignore them. More...
 
void setActive (bool active)
 If active is true, and the scene is active, this item's panel will be activated. More...
 
void setBoundingRegionGranularity (qreal granularity)
 Sets the bounding region granularity to granularity; a value between and including 0 and 1. More...
 
void setCacheMode (CacheMode mode, const QSize &cacheSize=QSize())
 Sets the item's cache mode to mode. More...
 
void setCursor (const QCursor &cursor)
 Sets the current cursor shape for the item to cursor. More...
 
void setData (int key, const QVariant &value)
 Sets this item's custom data for the key key to value. More...
 
void setEnabled (bool enabled)
 If enabled is true, the item is enabled; otherwise, it is disabled. More...
 
void setFiltersChildEvents (bool enabled)
 If enabled is true, this item is set to filter all events for all its children (i. More...
 
void setFlag (GraphicsItemFlag flag, bool enabled=true)
 If enabled is true, the item flag flag is enabled; otherwise, it is disabled. More...
 
void setFlags (GraphicsItemFlags flags)
 Sets the item flags to flags. More...
 
void setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason)
 Gives keyboard input focus to this item. More...
 
void setFocusProxy (QGraphicsItem *item)
 Sets the item's focus proxy to item. More...
 
void setGraphicsEffect (QGraphicsEffect *effect)
 Sets effect as the item's effect. More...
 
void setGroup (QGraphicsItemGroup *group)
 Adds this item to the item group group. More...
 
void setHandlesChildEvents (bool enabled)
 If enabled is true, this item is set to handle all events for all its children (i. More...
 
void setInputMethodHints (Qt::InputMethodHints hints)
 Sets the current input method hints of this item to hints. More...
 
void setMatrix (const QMatrix &matrix, bool combine=false)
 Sets the item's affine transformation matrix. More...
 
void setOpacity (qreal opacity)
 Sets this item's local opacity, between 0. More...
 
void setPanelModality (PanelModality panelModality)
 Sets the modality for this item to panelModality. More...
 
void setParentItem (QGraphicsItem *parent)
 Sets this item's parent item to newParent. More...
 
void setPos (const QPointF &pos)
 Sets the position of the item to pos, which is in parent coordinates. More...
 
void setPos (qreal x, qreal y)
 This convenience function is equivalent to calling setPos(QPointF(x, y)). More...
 
void setRotation (qreal angle)
 Sets the clockwise rotation angle, in degrees, around the Z axis. More...
 
void setScale (qreal scale)
 Sets the scale factor of the item. More...
 
void setSelected (bool selected)
 If selected is true and this item is selectable, this item is selected; otherwise, it is unselected. More...
 
void setToolTip (const QString &toolTip)
 Sets the item's tool tip to toolTip. More...
 
void setTransform (const QTransform &matrix, bool combine=false)
 Sets the item's current transformation matrix to matrix. More...
 
void setTransformations (const QList< QGraphicsTransform *> &transformations)
 Sets a list of graphics transformations (QGraphicsTransform) that currently apply to this item. More...
 
void setTransformOriginPoint (const QPointF &origin)
 Sets the origin point for the transformation in item coordinates. More...
 
void setTransformOriginPoint (qreal ax, qreal ay)
 Sets the origin point for the transformation in item coordinates. More...
 
void setVisible (bool visible)
 If visible is true, the item is made visible. More...
 
void setX (qreal x)
 Set's the x coordinate of the item's position. More...
 
void setY (qreal y)
 Set's the y coordinate of the item's position. More...
 
void setZValue (qreal z)
 Sets the Z-value of the item to z. More...
 
virtual QPainterPath shape () const
 Returns the shape of this item as a QPainterPath in local coordinates. More...
 
void shear (qreal sh, qreal sv)
 Use. More...
 
void show ()
 Shows the item. More...
 
void stackBefore (const QGraphicsItem *sibling)
 Stacks this item before sibling, which must be a sibling item (i. More...
 
QGraphicsObjecttoGraphicsObject ()
 Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object, 0 otherwise. More...
 
const QGraphicsObjecttoGraphicsObject () const
 Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object, 0 otherwise. More...
 
QString toolTip () const
 Returns the item's tool tip, or an empty QString if no tool tip has been set. More...
 
QGraphicsItemtopLevelItem () const
 Returns this item's top-level item. More...
 
QGraphicsWidgettopLevelWidget () const
 Returns a pointer to the item's top level widget (i. More...
 
QTransform transform () const
 Returns this item's transformation matrix. More...
 
QList< QGraphicsTransform * > transformations () const
 Returns a list of graphics transforms that currently apply to this item. More...
 
QPointF transformOriginPoint () const
 Returns the origin point for the transformation in item coordinates. More...
 
void translate (qreal dx, qreal dy)
 Use setPos() or setTransformOriginPoint() instead. More...
 
virtual int type () const
 Returns the type of an item as an int. More...
 
void ungrabKeyboard ()
 Releases the keyboard grab. More...
 
void ungrabMouse ()
 Releases the mouse grab. More...
 
void unsetCursor ()
 Clears the cursor from this item. More...
 
void update (const QRectF &rect=QRectF())
 Schedules a redraw of the area covered by rect in this item. More...
 
void update (qreal x, qreal y, qreal width, qreal height)
 This convenience function is equivalent to calling update(QRectF(x, y, width, height)). More...
 
QGraphicsWidgetwindow () const
 Returns the item's window, or 0 if this item does not have a window. More...
 
qreal x () const
 This convenience function is equivalent to calling pos(). More...
 
qreal y () const
 This convenience function is equivalent to calling pos(). More...
 
qreal zValue () const
 Returns the Z-value of the item. More...
 
virtual ~QGraphicsItem ()
 Destroys the QGraphicsItem and all its children. More...
 
- Public Functions inherited from QDeclarativeParserStatus
 QDeclarativeParserStatus ()
 
virtual ~QDeclarativeParserStatus ()
 

Protected Functions

bool event (QEvent *e)
 
void focusInEvent (QFocusEvent *event)
 This event handler, for event event, can be reimplemented to receive focus in events for this item. More...
 
virtual void geometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry)
 This function is called to handle this item's changes in geometry from oldGeometry to newGeometry. More...
 
void inputMethodEvent (QInputMethodEvent *)
 
void keyPressEvent (QKeyEvent *ev)
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event. More...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse move events for this item. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event event, can be reimplemented to receive mouse press events for this item. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event. More...
 
bool sceneEvent (QEvent *event)
 
- Protected Functions inherited from QDeclarativeImplicitSizePaintedItem
 QDeclarativeImplicitSizePaintedItem (QDeclarativeImplicitSizePaintedItemPrivate &dd, QDeclarativeItem *parent)
 
- Protected Functions inherited from QDeclarativePaintedItem
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is not called during initial widget polishing. More...
 
 QDeclarativePaintedItem (QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent)
 Constructs a new QDeclarativePaintedItem with the given parent and initialized private data member dd. More...
 
void setCacheFrozen (bool)
 
- Protected Functions inherited from QDeclarativeItem
virtual void classBegin ()
 
virtual void componentComplete ()
 
bool heightValid () const
 Returns whether the height property has been set explicitly. More...
 
void inputMethodPreHandler (QInputMethodEvent *)
 
bool isComponentComplete () const
 Returns true if construction of the QML component is complete; otherwise returns false. More...
 
void keyPressPreHandler (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
void keyReleasePreHandler (QKeyEvent *)
 
 QDeclarativeItem (QDeclarativeItemPrivate &dd, QDeclarativeItem *parent=0)
 
void setImplicitHeight (qreal)
 Sets the implied height of the item to h. More...
 
void setImplicitWidth (qreal)
 Sets the implied width of the item to w. More...
 
bool widthValid () const
 Returns whether the width property has been set explicitly. More...
 
- Protected Functions inherited from QGraphicsObject
 QGraphicsObject (QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Functions inherited from QGraphicsItem
void addToIndex ()
 Adds this item to the scene's index. More...
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 This event handler can be reimplemented in a subclass to process context menu events. More...
 
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag enter events for this item. More...
 
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag leave events for this item. More...
 
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drag move events for this item. More...
 
virtual void dropEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented to receive drop events for this item. More...
 
virtual QVariant extension (const QVariant &variant) const
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
virtual void focusOutEvent (QFocusEvent *event)
 This event handler, for event event, can be reimplemented to receive focus out events for this item. More...
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover enter events for this item. More...
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover leave events for this item. More...
 
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event)
 This event handler, for event event, can be reimplemented to receive hover move events for this item. More...
 
void prepareGeometryChange ()
 Prepares the item for a geometry change. More...
 
 QGraphicsItem (QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene)
 
void removeFromIndex ()
 Removes this item from the scene's index. More...
 
virtual bool sceneEventFilter (QGraphicsItem *watched, QEvent *event)
 Filters events for the item watched. More...
 
virtual void setExtension (Extension extension, const QVariant &variant)
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
virtual bool supportsExtension (Extension extension) const
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
void updateMicroFocus ()
 Updates the item's micro focus. More...
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)
 This event handler, for event event, can be reimplemented to receive wheel events for this item. More...
 

Private Slots

void createCursor ()
 
void cursorPosChanged ()
 
void q_canPasteChanged ()
 
void q_textChanged ()
 
void selectionChanged ()
 
void updateCursorRectangle ()
 
void updateRect (const QRect &r=QRect())
 
void updateSize (bool needsRedraw=true)
 

Properties

bool acceptableInput
 
bool activeFocusOnPress
 
bool autoScroll
 
bool canPaste
 
QColor color
 
QDeclarativeComponentcursorDelegate
 
int cursorPosition
 
QRect cursorRectangle
 Returns a Rect which encompasses the cursor, but which may be larger than is required. More...
 
bool cursorVisible
 
QString displayText
 
EchoMode echoMode
 
QFont font
 
HAlignment horizontalAlignment
 
QString inputMask
 
bool inputMethodComposing
 
Qt::InputMethodHints inputMethodHints
 
int maximumLength
 
SelectionMode mouseSelectionMode
 
QString passwordCharacter
 
bool readOnly
 
bool selectByMouse
 
QString selectedText
 
QColor selectedTextColor
 
QColor selectionColor
 
int selectionEnd
 
int selectionStart
 
QString text
 
QValidatorvalidator
 

Additional Inherited Members

- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Types inherited from QGraphicsItem
enum  Extension { UserExtension = 0x80000000 }
 Note: This is provided as a hook to avoid future problems related to adding virtual functions. More...
 
- Protected Slots inherited from QDeclarativePaintedItem
void clearCache ()
 Marks the entirety of the contents cache as dirty. More...
 
void dirtyCache (const QRect &)
 Marks areas of the cache that intersect with the given rect as dirty and in need of being refreshed. More...
 
- Protected Slots inherited from QGraphicsObject
void updateMicroFocus ()
 Updates the item's micro focus. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QGraphicsItem
QScopedPointer< QGraphicsItemPrivated_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 61 of file qdeclarativetextinput_p.h.

Enumerations

◆ CursorPosition

Enumerator
CursorBetweenCharacters 
CursorOnCharacter 

Definition at line 123 of file qdeclarativetextinput_p.h.

◆ EchoMode

Enumerator
Normal 
NoEcho 
Password 
PasswordEchoOnEdit 

Definition at line 105 of file qdeclarativetextinput_p.h.

◆ HAlignment

◆ SelectionMode

Enumerator
SelectCharacters 
SelectWords 

Definition at line 118 of file qdeclarativetextinput_p.h.

Constructors and Destructors

◆ QDeclarativeTextInput()

QDeclarativeTextInput::QDeclarativeTextInput ( QDeclarativeItem parent = 0)

◆ ~QDeclarativeTextInput()

QDeclarativeTextInput::~QDeclarativeTextInput ( )

Definition at line 90 of file qdeclarativetextinput.cpp.

91 {
92 }

Functions

◆ acceptableInputChanged

void QDeclarativeTextInput::acceptableInputChanged ( )
signal

Referenced by q_textChanged(), and setValidator().

◆ accepted

void QDeclarativeTextInput::accepted ( )
signal

◆ activeFocusOnPressChanged

void QDeclarativeTextInput::activeFocusOnPressChanged ( bool  activeFocusOnPress)
signal

Referenced by setFocusOnPress().

◆ autoScroll()

bool QDeclarativeTextInput::autoScroll ( ) const

◆ autoScrollChanged

void QDeclarativeTextInput::autoScrollChanged ( bool  autoScroll)
signal

Referenced by setAutoScroll().

◆ boundingRect()

QRectF QDeclarativeTextInput::boundingRect ( ) const
virtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativePaintedItem.

Definition at line 2159 of file qdeclarativetextinput.cpp.

Referenced by drawContents(), and mouseReleaseEvent().

2160 {
2161  Q_D(const QDeclarativeTextInput);
2163 
2164  int cursorWidth = d->cursorItem ? d->cursorItem->width() : d->control->cursorWidth();
2165 
2166  // Could include font max left/right bearings to either side of rectangle.
2167 
2168  r.setRight(r.right() + cursorWidth);
2169  return r;
2170 }
qreal right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:527
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void setRight(qreal pos)
Sets the right edge of the rectangle to the given x coordinate.
Definition: qrect.h:672
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511

◆ canPaste()

bool QDeclarativeTextInput::canPaste ( ) const

◆ canPasteChanged

void QDeclarativeTextInput::canPasteChanged ( )
signal

Referenced by q_canPasteChanged().

◆ closeSoftwareInputPanel()

void QDeclarativeTextInput::closeSoftwareInputPanel ( )

Definition at line 1996 of file qdeclarativetextinput.cpp.

1997 {
1999  if (qApp) {
2001  if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
2002  if (view->scene() && view->scene() == scene()) {
2004  }
2005  }
2006  }
2007 }
#define qApp
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Definition: qgraphicsview.h:64
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ color()

QColor QDeclarativeTextInput::color ( ) const

◆ colorChanged

void QDeclarativeTextInput::colorChanged ( const QColor color)
signal

Referenced by setColor().

◆ copy

void QDeclarativeTextInput::copy ( )
slot

Definition at line 1617 of file qdeclarativetextinput.cpp.

1618 {
1620  d->control->copy();
1621 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ createCursor

void QDeclarativeTextInput::createCursor ( )
privateslot

Definition at line 1091 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::startCreatingCursor().

1092 {
1094  if(d->cursorComponent->isError()){
1095  qmlInfo(this, d->cursorComponent->errors()) << tr("Could not load cursor delegate");
1096  return;
1097  }
1098 
1099  if(!d->cursorComponent->isReady())
1100  return;
1101 
1102  if(d->cursorItem)
1103  delete d->cursorItem;
1104  d->cursorItem = qobject_cast<QDeclarativeItem*>(d->cursorComponent->create());
1105  if(!d->cursorItem){
1106  qmlInfo(this, d->cursorComponent->errors()) << tr("Could not instantiate cursor delegate");
1107  return;
1108  }
1109 
1110  QDeclarative_setParent_noEvent(d->cursorItem, this);
1111  d->cursorItem->setParentItem(this);
1112  d->cursorItem->setX(d->control->cursorToX());
1113  d->cursorItem->setHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
1114 }
QDeclarativeParserStatus ** d
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
T * qobject_cast(QObject *object)
Definition: qobject.h:375
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QDeclarativeInfo qmlInfo(const QObject *me)

◆ cursorDelegate()

QDeclarativeComponent* QDeclarativeTextInput::cursorDelegate ( ) const

Referenced by setIMHints().

◆ cursorDelegateChanged

void QDeclarativeTextInput::cursorDelegateChanged ( )
signal

Referenced by setCursorDelegate().

◆ cursorPosChanged

void QDeclarativeTextInput::cursorPosChanged ( )
privateslot

Definition at line 2083 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::init().

2084 {
2088  d->control->resetCursorBlinkTimer();
2089 
2090  if(!d->control->hasSelectedText()){
2091  if(d->lastSelectionStart != d->control->cursor()){
2092  d->lastSelectionStart = d->control->cursor();
2094  }
2095  if(d->lastSelectionEnd != d->control->cursor()){
2096  d->lastSelectionEnd = d->control->cursor();
2098  }
2099  }
2100 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ cursorPosition()

int QDeclarativeTextInput::cursorPosition ( ) const

Referenced by keyPressEvent(), and setCursorVisible().

◆ cursorPositionChanged

void QDeclarativeTextInput::cursorPositionChanged ( )
signal

◆ cursorRectangle()

QRect QDeclarativeTextInput::cursorRectangle ( ) const

◆ cursorRectangleChanged

void QDeclarativeTextInput::cursorRectangleChanged ( )
signal

Referenced by updateCursorRectangle().

◆ cursorVisibleChanged

void QDeclarativeTextInput::cursorVisibleChanged ( bool  isCursorVisible)
signal

Referenced by setCursorVisible().

◆ cut

void QDeclarativeTextInput::cut ( )
slot

Definition at line 1602 of file qdeclarativetextinput.cpp.

1603 {
1605  d->control->copy();
1606  d->control->del();
1607 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ deselect

void QDeclarativeTextInput::deselect ( )
slot

Definition at line 1553 of file qdeclarativetextinput.cpp.

1554 {
1556  d->control->deselect();
1557 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ displayText()

QString QDeclarativeTextInput::displayText ( ) const

◆ displayTextChanged

void QDeclarativeTextInput::displayTextChanged ( )
signal

◆ drawContents()

void QDeclarativeTextInput::drawContents ( QPainter painter,
const QRect rect 
)
virtual

This function is called when the cache needs to be refreshed.

When sub-classing QDeclarativePaintedItem this function should be implemented so as to paint the contents of the item using the given painter for the area of the contents specified by rect.

Reimplemented from QDeclarativeImplicitSizePaintedItem.

Definition at line 1485 of file qdeclarativetextinput.cpp.

1486 {
1488  p->setRenderHint(QPainter::TextAntialiasing, true);
1489  p->save();
1490  p->setPen(QPen(d->color));
1492  if(!isReadOnly() && d->cursorVisible && !d->cursorItem)
1493  flags |= QLineControl::DrawCursor;
1494  if (d->control->hasSelectedText())
1496  QPoint offset = QPoint(0,0);
1497  QFontMetrics fm = QFontMetrics(d->font);
1498  QRect br(boundingRect().toRect());
1499  if (d->autoScroll) {
1500  // the y offset is there to keep the baseline constant in case we have script changes in the text.
1501  offset = br.topLeft() - QPoint(d->hscroll, d->control->ascent() - fm.ascent());
1502  } else {
1503  offset = QPoint(d->hscroll, 0);
1504  }
1505  d->control->draw(p, offset, r, flags);
1506  p->restore();
1507 }
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
int ascent() const
Returns the ascent of the font.
GraphicsItemFlags flags() const
Returns this item&#39;s flags.
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ echoMode()

EchoMode QDeclarativeTextInput::echoMode ( ) const

◆ echoModeChanged

void QDeclarativeTextInput::echoModeChanged ( EchoMode  echoMode)
signal

Referenced by setEchoMode().

◆ effectiveHAlign()

QDeclarativeTextInput::HAlignment QDeclarativeTextInput::effectiveHAlign ( ) const

Definition at line 425 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::updateHorizontalScroll().

426 {
427  Q_D(const QDeclarativeTextInput);
428  QDeclarativeTextInput::HAlignment effectiveAlignment = d->hAlign;
429  if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
430  switch (d->hAlign) {
432  effectiveAlignment = QDeclarativeTextInput::AlignRight;
433  break;
435  effectiveAlignment = QDeclarativeTextInput::AlignLeft;
436  break;
437  default:
438  break;
439  }
440  }
441  return effectiveAlignment;
442 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ event()

bool QDeclarativeTextInput::event ( QEvent ev)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativeItem.

Definition at line 1389 of file qdeclarativetextinput.cpp.

Referenced by closeSoftwareInputPanel(), and openSoftwareInputPanel().

1390 {
1392  //Anything we don't deal with ourselves, pass to the control
1393  bool handled = false;
1394  switch(ev->type()){
1395  case QEvent::KeyPress:
1396  case QEvent::KeyRelease://###Should the control be doing anything with release?
1397  case QEvent::InputMethod:
1402  break;
1403  default:
1404  handled = d->control->processEvent(ev);
1405  }
1406  if(!handled)
1407  handled = QDeclarativePaintedItem::event(ev);
1408  return handled;
1409 }
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
#define Q_D(Class)
Definition: qglobal.h:2482
Type type() const
Returns the event type.
Definition: qcoreevent.h:303

◆ focusInEvent()

void QDeclarativeTextInput::focusInEvent ( QFocusEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive focus in events for this item.

The default implementation calls ensureVisible().

See also
focusOutEvent(), sceneEvent(), setFocus()

Reimplemented from QGraphicsItem.

Definition at line 2009 of file qdeclarativetextinput.cpp.

2010 {
2011  Q_D(const QDeclarativeTextInput);
2012  if (d->showInputPanelOnFocus) {
2013  if (d->focusOnPress && !isReadOnly()) {
2015  }
2016  }
2018 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void focusInEvent(QFocusEvent *event)
This event handler, for event event, can be reimplemented to receive focus in events for this item...
Q_INVOKABLE void openSoftwareInputPanel()

◆ focusOnPress()

bool QDeclarativeTextInput::focusOnPress ( ) const

Definition at line 719 of file qdeclarativetextinput.cpp.

720 {
721  Q_D(const QDeclarativeTextInput);
722  return d->focusOnPress;
723 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ font()

QFont QDeclarativeTextInput::font ( ) const

Referenced by inputMethodQuery(), setFont(), and setText().

◆ fontChanged

void QDeclarativeTextInput::fontChanged ( const QFont font)
signal

Referenced by setFont().

◆ geometryChanged()

void QDeclarativeTextInput::geometryChanged ( const QRectF newGeometry,
const QRectF oldGeometry 
)
protectedvirtual

This function is called to handle this item's changes in geometry from oldGeometry to newGeometry.

If the two geometries are the same, it doesn't do anything.

Reimplemented from QDeclarativePaintedItem.

Definition at line 1411 of file qdeclarativetextinput.cpp.

1413 {
1414  if (newGeometry.width() != oldGeometry.width()) {
1415  updateSize();
1417  }
1418  QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
1419 }
void updateSize(bool needsRedraw=true)
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
This function is called to handle this item&#39;s changes in geometry from oldGeometry to newGeometry...

◆ hAlign()

QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign ( ) const

Definition at line 400 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::mirrorChange(), and QDeclarativeTextInputPrivate::setHAlign().

401 {
402  Q_D(const QDeclarativeTextInput);
403  return d->hAlign;
404 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ hasAcceptableInput()

bool QDeclarativeTextInput::hasAcceptableInput ( ) const

Definition at line 960 of file qdeclarativetextinput.cpp.

Referenced by q_textChanged().

961 {
962  Q_D(const QDeclarativeTextInput);
963  return d->control->hasAcceptableInput();
964 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ horizontalAlignmentChanged

void QDeclarativeTextInput::horizontalAlignmentChanged ( HAlignment  alignment)
signal

◆ imHints()

Qt::InputMethodHints QDeclarativeTextInput::imHints ( ) const

Definition at line 1024 of file qdeclarativetextinput.cpp.

1025 {
1026  Q_D(const QDeclarativeTextInput);
1027  return d->inputMethodHints;
1028 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ inputMask()

QString QDeclarativeTextInput::inputMask ( ) const

Referenced by setValidator().

◆ inputMaskChanged

void QDeclarativeTextInput::inputMaskChanged ( const QString inputMask)
signal

Referenced by setInputMask().

◆ inputMethodComposingChanged

void QDeclarativeTextInput::inputMethodComposingChanged ( )
signal

Referenced by inputMethodEvent().

◆ inputMethodEvent()

void QDeclarativeTextInput::inputMethodEvent ( QInputMethodEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativeItem.

Definition at line 1219 of file qdeclarativetextinput.cpp.

1220 {
1222  ev->ignore();
1223  const bool wasComposing = d->control->preeditAreaText().length() > 0;
1225  if (!ev->isAccepted()) {
1226  if (d->control->isReadOnly()) {
1227  ev->ignore();
1228  } else {
1229  d->control->processInputMethodEvent(ev);
1230  }
1231  }
1232  if (!ev->isAccepted())
1234 
1235  if (wasComposing != (d->control->preeditAreaText().length() > 0))
1237 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void inputMethodComposingChanged()
#define emit
Definition: qobjectdefs.h:76
void inputMethodPreHandler(QInputMethodEvent *)
virtual void inputMethodEvent(QInputMethodEvent *)

◆ inputMethodQuery()

QVariant QDeclarativeTextInput::inputMethodQuery ( Qt::InputMethodQuery  property) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns the value of the given property.

Reimplemented from QDeclarativeItem.

Definition at line 1513 of file qdeclarativetextinput.cpp.

1514 {
1515  Q_D(const QDeclarativeTextInput);
1516  switch(property) {
1517  case Qt::ImMicroFocus:
1518  return cursorRectangle();
1519  case Qt::ImFont:
1520  return font();
1521  case Qt::ImCursorPosition:
1522  return QVariant(d->control->cursor());
1523  case Qt::ImSurroundingText:
1524  if (d->control->echoMode() == PasswordEchoOnEdit && !d->control->passwordEchoEditing())
1525  return QVariant(displayText());
1526  else
1527  return QVariant(text());
1529  return QVariant(selectedText());
1531  return QVariant(maxLength());
1532  case Qt::ImAnchorPosition:
1533  if (d->control->selectionStart() == d->control->selectionEnd())
1534  return QVariant(d->control->cursor());
1535  else if (d->control->selectionStart() == d->control->cursor())
1536  return QVariant(d->control->selectionEnd());
1537  else
1538  return QVariant(d->control->selectionStart());
1539  default:
1540  return QVariant();
1541  }
1542 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QRect cursorRectangle() const
QString displayText() const
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
QString text() const
QString selectedText() const
QFont font() const

◆ isCursorVisible()

bool QDeclarativeTextInput::isCursorVisible ( ) const

Definition at line 569 of file qdeclarativetextinput.cpp.

570 {
571  Q_D(const QDeclarativeTextInput);
572  return d->cursorVisible;
573 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isInputMethodComposing()

bool QDeclarativeTextInput::isInputMethodComposing ( ) const

Definition at line 2036 of file qdeclarativetextinput.cpp.

2037 {
2038  Q_D(const QDeclarativeTextInput);
2039  return d->control->preeditAreaText().length() > 0;
2040 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isReadOnly()

bool QDeclarativeTextInput::isReadOnly ( ) const

Definition at line 494 of file qdeclarativetextinput.cpp.

Referenced by drawContents(), focusInEvent(), mousePressEvent(), and mouseReleaseEvent().

495 {
496  Q_D(const QDeclarativeTextInput);
497  return d->control->isReadOnly();
498 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isRightToLeft

bool QDeclarativeTextInput::isRightToLeft ( int  start,
int  end 
)
slot

Definition at line 1582 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::determineHorizontalAlignment().

1583 {
1585  if (start > end) {
1586  qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
1587  return false;
1588  } else {
1589  return d->control->text().mid(start, end - start).isRightToLeft();
1590  }
1591 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeInfo qmlInfo(const QObject *me)
static const KeyPair *const end

◆ keyPressEvent()

void QDeclarativeTextInput::keyPressEvent ( QKeyEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativeItem.

Definition at line 1192 of file qdeclarativetextinput.cpp.

1193 {
1195  keyPressPreHandler(ev);
1196  if (ev->isAccepted())
1197  return;
1198 
1199  // Don't allow MacOSX up/down support, and we don't allow a completer.
1200  bool ignore = (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier;
1201  if (!ignore && (d->lastSelectionStart == d->lastSelectionEnd) && (ev->key() == Qt::Key_Right || ev->key() == Qt::Key_Left)) {
1202  // Ignore when moving off the end unless there is a selection,
1203  // because then moving will do something (deselect).
1204  int cursorPosition = d->control->cursor();
1205  if (cursorPosition == 0)
1206  ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);
1207  if (!ignore && cursorPosition == d->control->text().length())
1208  ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);
1209  }
1210  if (ignore) {
1211  ev->ignore();
1212  } else {
1213  d->control->processKeyEvent(ev);
1214  }
1215  if (!ev->isAccepted())
1217 }
int cursorPosition() const
QDeclarativeParserStatus ** d
static bool ignore(const char *test, const char *const *table)
Definition: qaxserver.cpp:660
virtual void keyPressEvent(QKeyEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482
void keyPressPreHandler(QKeyEvent *)

◆ maximumLengthChanged

void QDeclarativeTextInput::maximumLengthChanged ( int  maximumLength)
signal

Referenced by setMaxLength().

◆ maxLength()

int QDeclarativeTextInput::maxLength ( ) const

Definition at line 523 of file qdeclarativetextinput.cpp.

Referenced by inputMethodQuery().

524 {
525  Q_D(const QDeclarativeTextInput);
526  return d->control->maxLength();
527 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ mouseDoubleClickEvent()

void QDeclarativeTextInput::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event.

Reimplemented from QGraphicsItem.

Definition at line 1243 of file qdeclarativetextinput.cpp.

1244 {
1246  if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonDblClick))
1247  return;
1248  if (d->selectByMouse) {
1249  int cursor = d->xToPos(event->pos().x());
1250  d->control->selectWordAtPos(cursor);
1251  event->setAccepted(true);
1252  } else {
1254  }
1255 }
QDeclarativeParserStatus ** d
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse doubleclick events for thi...
#define Q_D(Class)
Definition: qglobal.h:2482
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
QCursor cursor() const
Returns the current cursor shape for the item.
QPointF pos() const
Returns the mouse cursor position in item coordinates.

◆ mouseMoveEvent()

void QDeclarativeTextInput::mouseMoveEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse move events for this item.

If you do receive this event, you can be certain that this item also received a mouse press event, and that this item is the current mouse grabber.

Calling QEvent::ignore() or QEvent::accept() on event has no effect.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseMoveEvent() in your reimplementation.

Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.

See also
mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 1287 of file qdeclarativetextinput.cpp.

1288 {
1290  if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
1291  return;
1292  if (d->selectPressed) {
1293  if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
1294  setKeepMouseGrab(true);
1295  moveCursorSelection(d->xToPos(event->pos().x()), d->mouseSelectionMode);
1296  event->setAccepted(true);
1297  } else {
1299  }
1300 }
QDeclarativeParserStatus ** d
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_D(Class)
Definition: qglobal.h:2482
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
static int startDragDistance()
QPointF pos() const
Returns the mouse cursor position in item coordinates.
Q_INVOKABLE void moveCursorSelection(int pos)
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ mousePressEvent()

void QDeclarativeTextInput::mousePressEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This event handler, for event event, can be reimplemented to receive mouse press events for this item.

Mouse press events are only delivered to items that accept the mouse button that is pressed. By default, an item accepts all mouse buttons, but you can change this by calling setAcceptedMouseButtons().

The mouse press event decides which item should become the mouse grabber (see QGraphicsScene::mouseGrabberItem()). If you do not reimplement this function, the press event will propagate to any topmost item beneath this item, and no other mouse events will be delivered to this item.

If you do reimplement this function, event will by default be accepted (see QEvent::accept()), and this item is then the mouse grabber. This allows the item to receive future move, release and doubleclick events. If you call QEvent::ignore() on event, this item will lose the mouse grab, and event will propagate to any topmost item beneath. No further mouse events will be delivered to this item unless a new mouse press event is received.

The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mousePressEvent() in your reimplementation.

The event is for items that are neither QGraphicsItem::ItemIsMovable "movable" nor QGraphicsItem::ItemIsSelectable "selectable". mouseMoveEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), sceneEvent()

Reimplemented from QGraphicsItem.

Definition at line 1257 of file qdeclarativetextinput.cpp.

1258 {
1260  if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonPress))
1261  return;
1262  if(d->focusOnPress){
1263  bool hadActiveFocus = hasActiveFocus();
1264  forceActiveFocus();
1265  if (d->showInputPanelOnFocus) {
1266  if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
1267  // re-open input panel on press if already focused
1269  }
1270  } else { // show input panel on click
1271  if (hasActiveFocus() && !hadActiveFocus) {
1272  d->clickCausedFocus = true;
1273  }
1274  }
1275  }
1276  if (d->selectByMouse) {
1277  setKeepMouseGrab(false);
1278  d->selectPressed = true;
1279  d->pressPos = event->pos();
1280  }
1281  bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse;
1282  int cursor = d->xToPos(event->pos().x());
1283  d->control->moveCursor(cursor, mark);
1284  event->setAccepted(true);
1285 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
QCursor cursor() const
Returns the current cursor shape for the item.
bool hasActiveFocus() const
QPointF pos() const
Returns the mouse cursor position in item coordinates.
Q_INVOKABLE void openSoftwareInputPanel()
Q_INVOKABLE void forceActiveFocus()
Forces active focus on the item.
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ mouseReleaseEvent()

void QDeclarativeTextInput::mouseReleaseEvent ( QGraphicsSceneMouseEvent event)
protectedvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event.

Reimplemented from QGraphicsItem.

Definition at line 1306 of file qdeclarativetextinput.cpp.

1307 {
1309  if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonRelease))
1310  return;
1311  if (d->selectPressed) {
1312  d->selectPressed = false;
1313  setKeepMouseGrab(false);
1314  }
1315  if (!d->showInputPanelOnFocus) { // input panel on click
1316  if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
1317  if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
1318  if (view->scene() && view->scene() == scene()) {
1319  qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
1320  }
1321  }
1322  }
1323  }
1324  d->clickCausedFocus = false;
1325  d->control->processEvent(event);
1326  if (!event->isAccepted())
1328 }
QDeclarativeParserStatus ** d
Qt::MouseButton button() const
Returns the mouse button (if any) that caused the event.
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
#define qApp
void handleSoftwareInputPanel(Qt::MouseButton button, bool clickCausedFocus)
Definition: qwidget_p.h:669
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise, false is returned.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Definition: qgraphicsview.h:64
QPointF pos() const
Returns the mouse cursor position in item coordinates.
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
Q_GUI_EXPORT QWidgetPrivate * qt_widget_private(QWidget *widget)
Definition: qwidget.cpp:12920
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ mouseSelectionMode()

SelectionMode QDeclarativeTextInput::mouseSelectionMode ( ) const

Referenced by setSelectByMouse().

◆ mouseSelectionModeChanged

void QDeclarativeTextInput::mouseSelectionModeChanged ( SelectionMode  mode)
signal

Referenced by setMouseSelectionMode().

◆ moveCursorSelection() [1/2]

void QDeclarativeTextInput::moveCursorSelection ( int  pos)

Definition at line 1797 of file qdeclarativetextinput.cpp.

Referenced by mouseMoveEvent().

1798 {
1800  d->control->moveCursor(position, true);
1801 }
QDeclarativeParserStatus ** d
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
#define Q_D(Class)
Definition: qglobal.h:2482

◆ moveCursorSelection() [2/2]

void QDeclarativeTextInput::moveCursorSelection ( int  pos,
SelectionMode  mode 
)

Definition at line 1844 of file qdeclarativetextinput.cpp.

1845 {
1847 
1848  if (mode == SelectCharacters) {
1849  d->control->moveCursor(pos, true);
1850  } else if (pos != d->control->cursor()){
1851  const int cursor = d->control->cursor();
1852  int anchor;
1853  if (!d->control->hasSelectedText())
1854  anchor = d->control->cursor();
1855  else if (d->control->selectionStart() == d->control->cursor())
1856  anchor = d->control->selectionEnd();
1857  else
1858  anchor = d->control->selectionStart();
1859 
1860  if (anchor < pos || (anchor == pos && cursor < pos)) {
1861  const QString text = d->control->text();
1863  finder.setPosition(anchor);
1864 
1865  const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
1866  if (anchor < text.length() && (!(reasons & QTextBoundaryFinder::StartWord)
1867  || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor))) {
1868  finder.toPreviousBoundary();
1869  }
1870  anchor = finder.position() != -1 ? finder.position() : 0;
1871 
1872  finder.setPosition(pos);
1873  if (pos > 0 && !finder.boundaryReasons())
1874  finder.toNextBoundary();
1875  const int cursor = finder.position() != -1 ? finder.position() : text.length();
1876 
1877  d->control->setSelection(anchor, cursor - anchor);
1878  } else if (anchor > pos || (anchor == pos && cursor > pos)) {
1879  const QString text = d->control->text();
1881  finder.setPosition(anchor);
1882 
1883  const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
1884  if (anchor > 0 && (!(reasons & QTextBoundaryFinder::EndWord)
1885  || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor))) {
1886  finder.toNextBoundary();
1887  }
1888  anchor = finder.position() != -1 ? finder.position() : text.length();
1889 
1890  finder.setPosition(pos);
1891  if (pos < text.length() && !finder.boundaryReasons())
1892  finder.toPreviousBoundary();
1893  const int cursor = finder.position() != -1 ? finder.position() : 0;
1894 
1895  d->control->setSelection(anchor, cursor - anchor);
1896  }
1897  }
1898 }
QDeclarativeParserStatus ** d
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QPointF pos() const
Returns the position of the item in parent coordinates.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
QCursor cursor() const
Returns the current cursor shape for the item.
QString text() const
The QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string...

◆ openSoftwareInputPanel()

void QDeclarativeTextInput::openSoftwareInputPanel ( )

Definition at line 1942 of file qdeclarativetextinput.cpp.

Referenced by focusInEvent(), and mousePressEvent().

1943 {
1945  if (qApp) {
1946  if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
1947  if (view->scene() && view->scene() == scene()) {
1949  }
1950  }
1951  }
1952 }
#define qApp
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Definition: qgraphicsview.h:64
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ passwordCharacter()

QString QDeclarativeTextInput::passwordCharacter ( ) const

Referenced by selectWord().

◆ passwordCharacterChanged

void QDeclarativeTextInput::passwordCharacterChanged ( )
signal

Referenced by setPasswordCharacter().

◆ paste

void QDeclarativeTextInput::paste ( )
slot

Definition at line 1631 of file qdeclarativetextinput.cpp.

1632 {
1634  if(!d->control->isReadOnly())
1635  d->control->paste();
1636 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ positionAt() [1/2]

int QDeclarativeTextInput::positionAt ( int  x) const

Definition at line 1139 of file qdeclarativetextinput.cpp.

1140 {
1142 }
Q_INVOKABLE int positionAt(int x) const
qreal x() const
This convenience function is equivalent to calling pos().

◆ positionAt() [2/2]

int QDeclarativeTextInput::positionAt ( int  x,
CursorPosition  position 
) const

Definition at line 1166 of file qdeclarativetextinput.cpp.

1167 {
1168  Q_D(const QDeclarativeTextInput);
1169  int pos = d->control->xToPos(x + d->hscroll, QTextLine::CursorPosition(position));
1170  const int cursor = d->control->cursor();
1171  if (pos > cursor) {
1172  const int preeditLength = d->control->preeditAreaText().length();
1173  pos = pos > cursor + preeditLength
1174  ? pos - preeditLength
1175  : cursor;
1176  }
1177  return pos;
1178 }
QDeclarativeParserStatus ** d
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
QCursor cursor() const
Returns the current cursor shape for the item.
qreal x() const
This convenience function is equivalent to calling pos().

◆ positionToRectangle()

QRectF QDeclarativeTextInput::positionToRectangle ( int  pos) const

Definition at line 1128 of file qdeclarativetextinput.cpp.

1129 {
1130  Q_D(const QDeclarativeTextInput);
1131  if (pos > d->control->cursorPosition())
1132  pos += d->control->preeditAreaText().length();
1133  return QRectF(d->control->cursorToX(pos)-d->hscroll,
1134  0.0,
1135  d->control->cursorWidth(),
1136  cursorRectangle().height());
1137 }
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#define Q_D(Class)
Definition: qglobal.h:2482
QRect cursorRectangle() const
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511

◆ q_canPasteChanged

void QDeclarativeTextInput::q_canPasteChanged ( )
privateslot

Definition at line 2186 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::init().

2187 {
2189  bool old = d->canPaste;
2190 #ifndef QT_NO_CLIPBOARD
2191  d->canPaste = !d->control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
2192 #endif
2193  if(d->canPaste != old)
2195 }
QDeclarativeParserStatus ** d
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
#define Q_D(Class)
Definition: qglobal.h:2482
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
#define emit
Definition: qobjectdefs.h:76
QString text(Mode mode=Clipboard) const
Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any te...
Definition: qclipboard.cpp:357

◆ q_textChanged

void QDeclarativeTextInput::q_textChanged ( )
privateslot

Definition at line 2134 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::init(), and setEchoMode().

2135 {
2137  emit textChanged();
2139  updateSize();
2140  d->determineHorizontalAlignment();
2141  d->updateHorizontalScroll();
2142  updateMicroFocus();
2143  if(hasAcceptableInput() != d->oldValidity){
2144  d->oldValidity = hasAcceptableInput();
2146  }
2147 }
QDeclarativeParserStatus ** d
void updateMicroFocus()
Updates the item&#39;s micro focus.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void updateSize(bool needsRedraw=true)

◆ readOnlyChanged

void QDeclarativeTextInput::readOnlyChanged ( bool  isReadOnly)
signal

◆ resetHAlign()

void QDeclarativeTextInput::resetHAlign ( )

Definition at line 416 of file qdeclarativetextinput.cpp.

417 {
419  d->hAlignImplicit = true;
420  if (d->determineHorizontalAlignment() && isComponentComplete()) {
422  }
423 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ sceneEvent()

bool QDeclarativeTextInput::sceneEvent ( QEvent event)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QDeclarativeItem.

Definition at line 1378 of file qdeclarativetextinput.cpp.

1379 {
1381  bool rv = QDeclarativeItem::sceneEvent(event);
1382  if (event->type() == QEvent::UngrabMouse) {
1383  d->selectPressed = false;
1384  setKeepMouseGrab(false);
1385  }
1386  return rv;
1387 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual bool sceneEvent(QEvent *)
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ select

void QDeclarativeTextInput::select ( int  start,
int  end 
)
slot

Definition at line 679 of file qdeclarativetextinput.cpp.

680 {
682  if (start < 0 || end < 0 || start > d->control->text().length() || end > d->control->text().length())
683  return;
684  d->control->setSelection(start, end-start);
685 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
static const KeyPair *const end

◆ selectAll

void QDeclarativeTextInput::selectAll ( )
slot

Definition at line 1567 of file qdeclarativetextinput.cpp.

1568 {
1570  d->control->setSelection(0, d->control->text().length());
1571 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ selectByMouse()

bool QDeclarativeTextInput::selectByMouse ( ) const

Referenced by setPasswordCharacter().

◆ selectByMouseChanged

void QDeclarativeTextInput::selectByMouseChanged ( bool  selectByMouse)
signal

Referenced by setSelectByMouse().

◆ selectedText()

QString QDeclarativeTextInput::selectedText ( ) const

Referenced by inputMethodQuery(), and select().

◆ selectedTextChanged

void QDeclarativeTextInput::selectedTextChanged ( )
signal

Referenced by selectionChanged().

◆ selectedTextColor()

QColor QDeclarativeTextInput::selectedTextColor ( ) const

◆ selectedTextColorChanged

void QDeclarativeTextInput::selectedTextColorChanged ( const QColor color)
signal

Referenced by setSelectedTextColor().

◆ selectionChanged

void QDeclarativeTextInput::selectionChanged ( )
privateslot

Definition at line 2114 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::init().

2115 {
2117  updateRect();//TODO: Only update rect in selection
2119 
2120  if(d->lastSelectionStart != d->control->selectionStart()){
2121  d->lastSelectionStart = d->control->selectionStart();
2122  if(d->lastSelectionStart == -1)
2123  d->lastSelectionStart = d->control->cursor();
2125  }
2126  if(d->lastSelectionEnd != d->control->selectionEnd()){
2127  d->lastSelectionEnd = d->control->selectionEnd();
2128  if(d->lastSelectionEnd == -1)
2129  d->lastSelectionEnd = d->control->cursor();
2131  }
2132 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void updateRect(const QRect &r=QRect())

◆ selectionColor()

QColor QDeclarativeTextInput::selectionColor ( ) const

◆ selectionColorChanged

void QDeclarativeTextInput::selectionColorChanged ( const QColor color)
signal

Referenced by setSelectionColor().

◆ selectionEnd()

int QDeclarativeTextInput::selectionEnd ( ) const

Referenced by setCursorPosition().

◆ selectionEndChanged

void QDeclarativeTextInput::selectionEndChanged ( )
signal

◆ selectionStart()

int QDeclarativeTextInput::selectionStart ( ) const

Referenced by setCursorPosition().

◆ selectionStartChanged

void QDeclarativeTextInput::selectionStartChanged ( )
signal

◆ selectWord

void QDeclarativeTextInput::selectWord ( )
slot

Definition at line 1647 of file qdeclarativetextinput.cpp.

1648 {
1650  d->control->selectWordAtPos(d->control->cursor());
1651 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setAutoScroll()

void QDeclarativeTextInput::setAutoScroll ( bool  b)

Definition at line 751 of file qdeclarativetextinput.cpp.

752 {
754  if (d->autoScroll == b)
755  return;
756 
757  d->autoScroll = b;
758  //We need to repaint so that the scrolling is taking into account.
759  updateSize(true);
761  emit autoScrollChanged(d->autoScroll);
762 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void updateSize(bool needsRedraw=true)
void autoScrollChanged(bool autoScroll)

◆ setColor()

void QDeclarativeTextInput::setColor ( const QColor c)

Definition at line 301 of file qdeclarativetextinput.cpp.

302 {
304  if (c != d->color) {
305  d->color = c;
306  clearCache();
307  update();
308  emit colorChanged(c);
309  }
310 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QDeclarativeParserStatus ** d
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void colorChanged(const QColor &color)
void clearCache()
Marks the entirety of the contents cache as dirty.

◆ setCursorDelegate()

void QDeclarativeTextInput::setCursorDelegate ( QDeclarativeComponent c)

Definition at line 1061 of file qdeclarativetextinput.cpp.

1062 {
1064  if (d->cursorComponent == c)
1065  return;
1066 
1067  d->cursorComponent = c;
1068  if(!c){
1069  //note that the components are owned by something else
1070  delete d->cursorItem;
1071  }else{
1072  d->startCreatingCursor();
1073  }
1074 
1076 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setCursorPosition()

void QDeclarativeTextInput::setCursorPosition ( int  cp)

Definition at line 602 of file qdeclarativetextinput.cpp.

603 {
605  if (cp < 0 || cp > d->control->text().length())
606  return;
607  d->control->moveCursor(cp);
608 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setCursorVisible()

void QDeclarativeTextInput::setCursorVisible ( bool  on)

Definition at line 575 of file qdeclarativetextinput.cpp.

576 {
578  if (d->cursorVisible == on)
579  return;
580  d->cursorVisible = on;
581  d->control->setCursorBlinkPeriod(on?QApplication::cursorFlashTime():0);
582  QRect r = d->control->cursorRect();
583  if (d->control->inputMask().isEmpty())
584  updateRect(r);
585  else
586  updateRect();
587  emit cursorVisibleChanged(d->cursorVisible);
588 }
QDeclarativeParserStatus ** d
static int cursorFlashTime()
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void cursorVisibleChanged(bool isCursorVisible)
void updateRect(const QRect &r=QRect())
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ setEchoMode()

void QDeclarativeTextInput::setEchoMode ( QDeclarativeTextInput::EchoMode  echo)

Definition at line 1013 of file qdeclarativetextinput.cpp.

1014 {
1016  if (echoMode() == echo)
1017  return;
1018  d->control->setEchoMode((uint)echo);
1019  d->updateInputMethodHints();
1020  q_textChanged();
1022 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void echoModeChanged(EchoMode echoMode)
#define emit
Definition: qobjectdefs.h:76
unsigned int uint
Definition: qglobal.h:996
EchoMode echoMode() const

◆ setFocusOnPress()

void QDeclarativeTextInput::setFocusOnPress ( bool  b)

Definition at line 725 of file qdeclarativetextinput.cpp.

726 {
728  if (d->focusOnPress == b)
729  return;
730 
731  d->focusOnPress = b;
732 
733  emit activeFocusOnPressChanged(d->focusOnPress);
734 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void activeFocusOnPressChanged(bool activeFocusOnPress)

◆ setFont()

void QDeclarativeTextInput::setFont ( const QFont font)

Definition at line 261 of file qdeclarativetextinput.cpp.

262 {
264  if (d->sourceFont == font)
265  return;
266 
267  d->sourceFont = font;
268  QFont oldFont = d->font;
269  d->font = font;
270  if (d->font.pointSizeF() != -1) {
271  // 0.5pt resolution
272  qreal size = qRound(d->font.pointSizeF()*2.0);
273  d->font.setPointSizeF(size/2.0);
274  }
275 
276  if (oldFont != d->font) {
277  d->control->setFont(d->font);
278  updateSize();
280  if(d->cursorItem){
281  d->cursorItem->setHeight(QFontMetrics(d->font).height());
282  }
283  }
284  emit fontChanged(d->sourceFont);
285 }
double qreal
Definition: qglobal.h:1193
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void fontChanged(const QFont &font)
#define emit
Definition: qobjectdefs.h:76
void updateSize(bool needsRedraw=true)
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
int height() const
Returns the height of the font.
QFont font() const
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ setHAlign()

void QDeclarativeTextInput::setHAlign ( HAlignment  align)

Definition at line 406 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::determineHorizontalAlignment().

407 {
409  bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
410  d->hAlignImplicit = false;
411  if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
413  }
414 }
QDeclarativeParserStatus ** d
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setIMHints()

void QDeclarativeTextInput::setIMHints ( Qt::InputMethodHints  hints)

Definition at line 1030 of file qdeclarativetextinput.cpp.

1031 {
1033  if (d->inputMethodHints == hints)
1034  return;
1035  d->inputMethodHints = hints;
1036  d->updateInputMethodHints();
1037 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setInputMask()

void QDeclarativeTextInput::setInputMask ( const QString im)

Definition at line 939 of file qdeclarativetextinput.cpp.

940 {
942  if (d->control->inputMask() == im)
943  return;
944 
945  d->control->setInputMask(im);
946  emit inputMaskChanged(d->control->inputMask());
947 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void inputMaskChanged(const QString &inputMask)
#define emit
Definition: qobjectdefs.h:76

◆ setMaxLength()

void QDeclarativeTextInput::setMaxLength ( int  ml)

Definition at line 529 of file qdeclarativetextinput.cpp.

530 {
532  if (d->control->maxLength() == ml)
533  return;
534 
535  d->control->setMaxLength(ml);
536 
538 }
QDeclarativeParserStatus ** d
void maximumLengthChanged(int maximumLength)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setMouseSelectionMode()

void QDeclarativeTextInput::setMouseSelectionMode ( SelectionMode  mode)

Definition at line 1772 of file qdeclarativetextinput.cpp.

1773 {
1775  if (d->mouseSelectionMode != mode) {
1776  d->mouseSelectionMode = mode;
1778  }
1779 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void mouseSelectionModeChanged(SelectionMode mode)

◆ setPasswordCharacter()

void QDeclarativeTextInput::setPasswordCharacter ( const QString str)

Definition at line 1689 of file qdeclarativetextinput.cpp.

1690 {
1692  if(str.length() < 1)
1693  return;
1694  d->control->setPasswordCharacter(str.constData()[0]);
1695  EchoMode echoMode_ = echoMode();
1696  if (echoMode_ == Password || echoMode_ == PasswordEchoOnEdit) {
1697  updateSize();
1698  }
1700 }
QDeclarativeParserStatus ** d
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void updateSize(bool needsRedraw=true)
const QChar * constData() const
Returns a pointer to the data stored in the QString.
Definition: qstring.h:712
EchoMode echoMode() const

◆ setReadOnly()

void QDeclarativeTextInput::setReadOnly ( bool  ro)

Definition at line 500 of file qdeclarativetextinput.cpp.

501 {
503  if (d->control->isReadOnly() == ro)
504  return;
505 
507  d->control->setReadOnly(ro);
508 
509  emit readOnlyChanged(ro);
510 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void readOnlyChanged(bool isReadOnly)
#define emit
Definition: qobjectdefs.h:76
void setFlag(GraphicsItemFlag flag, bool enabled=true)
If enabled is true, the item flag flag is enabled; otherwise, it is disabled.

◆ setSelectByMouse()

void QDeclarativeTextInput::setSelectByMouse ( bool  on)

Definition at line 1740 of file qdeclarativetextinput.cpp.

1741 {
1743  if (d->selectByMouse != on) {
1744  d->selectByMouse = on;
1746  }
1747 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void selectByMouseChanged(bool selectByMouse)
#define emit
Definition: qobjectdefs.h:76

◆ setSelectedTextColor()

void QDeclarativeTextInput::setSelectedTextColor ( const QColor c)

Definition at line 358 of file qdeclarativetextinput.cpp.

359 {
361  if (d->selectedTextColor == color)
362  return;
363 
364  d->selectedTextColor = color;
365  QPalette p = d->control->palette();
366  p.setColor(QPalette::HighlightedText, d->selectedTextColor);
367  d->control->setPalette(p);
368  if (d->control->hasSelectedText()) {
369  clearCache();
370  update();
371  }
373 }
QDeclarativeParserStatus ** d
QColor color() const
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
void selectedTextColorChanged(const QColor &color)
#define emit
Definition: qobjectdefs.h:76
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
Definition: qpalette.h:201
void clearCache()
Marks the entirety of the contents cache as dirty.
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ setSelectionColor()

void QDeclarativeTextInput::setSelectionColor ( const QColor c)

Definition at line 327 of file qdeclarativetextinput.cpp.

328 {
330  if (d->selectionColor == color)
331  return;
332 
333  d->selectionColor = color;
334  QPalette p = d->control->palette();
335  p.setColor(QPalette::Highlight, d->selectionColor);
336  d->control->setPalette(p);
337  if (d->control->hasSelectedText()) {
338  clearCache();
339  update();
340  }
342 }
QDeclarativeParserStatus ** d
QColor color() const
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
void selectionColorChanged(const QColor &color)
#define emit
Definition: qobjectdefs.h:76
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
Definition: qpalette.h:201
void clearCache()
Marks the entirety of the contents cache as dirty.
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ setText()

void QDeclarativeTextInput::setText ( const QString s)

Definition at line 109 of file qdeclarativetextinput.cpp.

110 {
112  if(s == text())
113  return;
114  d->control->setText(s);
115 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QString text() const

◆ setValidator()

void QDeclarativeTextInput::setValidator ( QValidator v)

Definition at line 905 of file qdeclarativetextinput.cpp.

906 {
908  if (d->control->validator() == v)
909  return;
910 
911  d->control->setValidator(v);
912  if(!d->control->hasAcceptableInput()){
913  d->oldValidity = false;
915  }
916 
918 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ text()

QString QDeclarativeTextInput::text ( ) const

◆ textChanged

void QDeclarativeTextInput::textChanged ( )
signal

◆ updateCursorRectangle

void QDeclarativeTextInput::updateCursorRectangle ( )
privateslot

Definition at line 2102 of file qdeclarativetextinput.cpp.

Referenced by cursorPosChanged(), geometryChanged(), QDeclarativeTextInputPrivate::init(), resetHAlign(), setAutoScroll(), setFont(), and setHAlign().

2103 {
2105  d->determineHorizontalAlignment();
2106  d->updateHorizontalScroll();
2107  updateRect();//TODO: Only update rect between pos's
2108  updateMicroFocus();
2110  if (d->cursorItem)
2111  d->cursorItem->setX(d->control->cursorToX() - d->hscroll);
2112 }
QDeclarativeParserStatus ** d
void updateMicroFocus()
Updates the item&#39;s micro focus.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void updateRect(const QRect &r=QRect())

◆ updateRect

void QDeclarativeTextInput::updateRect ( const QRect r = QRect())
privateslot

Definition at line 2149 of file qdeclarativetextinput.cpp.

Referenced by QDeclarativeTextInputPrivate::init(), selectionChanged(), setCursorVisible(), and updateCursorRectangle().

2150 {
2152  if(r == QRect())
2153  clearCache();
2154  else
2155  dirtyCache(QRect(r.x() - d->hscroll, r.y(), r.width(), r.height()));
2156  update();
2157 }
QDeclarativeParserStatus ** d
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
void dirtyCache(const QRect &)
Marks areas of the cache that intersect with the given rect as dirty and in need of being refreshed...
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void clearCache()
Marks the entirety of the contents cache as dirty.

◆ updateSize

void QDeclarativeTextInput::updateSize ( bool  needsRedraw = true)
privateslot

Definition at line 2172 of file qdeclarativetextinput.cpp.

Referenced by geometryChanged(), q_textChanged(), setAutoScroll(), setFont(), and setPasswordCharacter().

2173 {
2175  int w = width();
2176  int h = height();
2177  setImplicitHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
2178  setImplicitWidth(d->calculateTextWidth());
2179  setContentsSize(QSize(width(), height()));//Repaints if changed
2180  if(w==width() && h==height() && needsRedraw){
2181  clearCache();
2182  update();
2183  }
2184 }
QDeclarativeParserStatus ** d
void setContentsSize(const QSize &)
Sets the size of the contents to the given size.
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
#define Q_D(Class)
Definition: qglobal.h:2482
void setImplicitWidth(qreal)
Sets the implied width of the item to w.
void clearCache()
Marks the entirety of the contents cache as dirty.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
void setImplicitHeight(qreal)
Sets the implied height of the item to h.

◆ validator()

QValidator* QDeclarativeTextInput::validator ( ) const

Referenced by setAutoScroll().

◆ validatorChanged

void QDeclarativeTextInput::validatorChanged ( )
signal

Referenced by setValidator().

Properties

◆ acceptableInput

bool QDeclarativeTextInput::acceptableInput
private

Definition at line 90 of file qdeclarativetextinput_p.h.

◆ activeFocusOnPress

bool QDeclarativeTextInput::activeFocusOnPress
private

Definition at line 92 of file qdeclarativetextinput_p.h.

◆ autoScroll

bool QDeclarativeTextInput::autoScroll
private

Definition at line 95 of file qdeclarativetextinput_p.h.

◆ canPaste

bool QDeclarativeTextInput::canPaste
private

Definition at line 98 of file qdeclarativetextinput_p.h.

◆ color

QColor QDeclarativeTextInput::color
private

Definition at line 69 of file qdeclarativetextinput_p.h.

◆ cursorDelegate

QDeclarativeComponent * QDeclarativeTextInput::cursorDelegate
private

Definition at line 78 of file qdeclarativetextinput_p.h.

◆ cursorPosition

int QDeclarativeTextInput::cursorPosition
private

Definition at line 76 of file qdeclarativetextinput_p.h.

◆ cursorRectangle

QRect QDeclarativeTextInput::cursorRectangle
private

Returns a Rect which encompasses the cursor, but which may be larger than is required.

Ignores custom cursor delegates.

Definition at line 77 of file qdeclarativetextinput_p.h.

◆ cursorVisible

bool QDeclarativeTextInput::cursorVisible
private

Definition at line 75 of file qdeclarativetextinput_p.h.

◆ displayText

QString QDeclarativeTextInput::displayText
private

Definition at line 94 of file qdeclarativetextinput_p.h.

◆ echoMode

QDeclarativeTextInput::EchoMode QDeclarativeTextInput::echoMode
private

Definition at line 91 of file qdeclarativetextinput_p.h.

◆ font

QFont QDeclarativeTextInput::font
private

Definition at line 72 of file qdeclarativetextinput_p.h.

◆ horizontalAlignment

HAlignment QDeclarativeTextInput::horizontalAlignment
private

Definition at line 73 of file qdeclarativetextinput_p.h.

◆ inputMask

QString QDeclarativeTextInput::inputMask
private

Definition at line 87 of file qdeclarativetextinput_p.h.

◆ inputMethodComposing

bool QDeclarativeTextInput::inputMethodComposing
private

Definition at line 99 of file qdeclarativetextinput_p.h.

◆ inputMethodHints

Qt::InputMethodHints QDeclarativeTextInput::inputMethodHints
private

Definition at line 88 of file qdeclarativetextinput_p.h.

◆ maximumLength

int QDeclarativeTextInput::maximumLength
private

Definition at line 83 of file qdeclarativetextinput_p.h.

◆ mouseSelectionMode

QDeclarativeTextInput::SelectionMode QDeclarativeTextInput::mouseSelectionMode
private

Definition at line 97 of file qdeclarativetextinput_p.h.

◆ passwordCharacter

QString QDeclarativeTextInput::passwordCharacter
private

Definition at line 93 of file qdeclarativetextinput_p.h.

◆ readOnly

bool QDeclarativeTextInput::readOnly
private

Definition at line 74 of file qdeclarativetextinput_p.h.

◆ selectByMouse

bool QDeclarativeTextInput::selectByMouse
private

Definition at line 96 of file qdeclarativetextinput_p.h.

◆ selectedText

QString QDeclarativeTextInput::selectedText
private

Definition at line 81 of file qdeclarativetextinput_p.h.

◆ selectedTextColor

QColor QDeclarativeTextInput::selectedTextColor
private

Definition at line 71 of file qdeclarativetextinput_p.h.

◆ selectionColor

QColor QDeclarativeTextInput::selectionColor
private

Definition at line 70 of file qdeclarativetextinput_p.h.

◆ selectionEnd

int QDeclarativeTextInput::selectionEnd
private

Definition at line 80 of file qdeclarativetextinput_p.h.

◆ selectionStart

int QDeclarativeTextInput::selectionStart
private

Definition at line 79 of file qdeclarativetextinput_p.h.

◆ text

QString QDeclarativeTextInput::text
private

Definition at line 68 of file qdeclarativetextinput_p.h.

◆ validator

QValidator * QDeclarativeTextInput::validator
private

Definition at line 85 of file qdeclarativetextinput_p.h.


The documentation for this class was generated from the following files: