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

#include <qdeclarativetextedit_p.h>

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

Public Types

enum  HAlignment { AlignLeft = Qt::AlignLeft, AlignRight = Qt::AlignRight, AlignHCenter = Qt::AlignHCenter, AlignJustify = Qt::AlignJustify }
 
enum  SelectionMode { SelectCharacters, SelectWords }
 
enum  TextFormat { PlainText = Qt::PlainText, RichText = Qt::RichText, AutoText = Qt::AutoText }
 
enum  VAlignment { AlignTop = Qt::AlignTop, AlignBottom = Qt::AlignBottom, AlignVCenter = Qt::AlignVCenter }
 
enum  WrapMode {
  NoWrap = QTextOption::NoWrap, WordWrap = QTextOption::WordWrap, WrapAnywhere = QTextOption::WrapAnywhere, WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere,
  Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
}
 
- 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 activeFocusOnPressChanged (bool activeFocusOnPressed)
 
void canPasteChanged ()
 
void colorChanged (const QColor &color)
 
void cursorDelegateChanged ()
 
void cursorPositionChanged ()
 
void cursorRectangleChanged ()
 
void cursorVisibleChanged (bool isCursorVisible)
 
void fontChanged (const QFont &font)
 
void horizontalAlignmentChanged (HAlignment alignment)
 
void inputMethodComposingChanged ()
 
void lineCountChanged ()
 
void linkActivated (const QString &link)
 
void mouseSelectionModeChanged (SelectionMode mode)
 
void paintedSizeChanged ()
 
void persistentSelectionChanged (bool isPersistentSelection)
 
void readOnlyChanged (bool isReadOnly)
 
void selectByMouseChanged (bool selectByMouse)
 
void selectedTextColorChanged (const QColor &color)
 
void selectionChanged ()
 
void selectionColorChanged (const QColor &color)
 
void selectionEndChanged ()
 
void selectionStartChanged ()
 
void textChanged (const QString &)
 
void textFormatChanged (TextFormat textFormat)
 
void textMarginChanged (qreal textMargin)
 
void verticalAlignmentChanged (VAlignment alignment)
 
void wrapModeChanged ()
 
- 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

QRectF boundingRect () const
 
bool canPaste () const
 
Q_INVOKABLE void closeSoftwareInputPanel ()
 
QColor color () const
 
virtual void componentComplete ()
 Ensures any delayed caching or data loading the class needs to performed is complete. More...
 
QDeclarativeComponentcursorDelegate () const
 
int cursorPosition () const
 
QRect cursorRectangle () const
 
HAlignment effectiveHAlign () const
 
bool focusOnPress () const
 
QFont font () const
 
HAlignment hAlign () 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 lineCount () const
 
SelectionMode mouseSelectionMode () const
 
Q_INVOKABLE void moveCursorSelection (int pos)
 
Q_INVOKABLE void moveCursorSelection (int pos, SelectionMode mode)
 
Q_INVOKABLE void openSoftwareInputPanel ()
 
qreal paintedHeight () const
 
qreal paintedWidth () const
 
bool persistentSelection () const
 
Q_INVOKABLE int positionAt (int x, int y) const
 
Q_INVOKABLE QRectF positionToRectangle (int) const
 
 QDeclarativeTextEdit (QDeclarativeItem *parent=0)
 This handler is called when the user clicks on a link embedded in the text. More...
 
void resetHAlign ()
 
bool selectByMouse () const
 
QString selectedText () const
 
QColor selectedTextColor () const
 
QColor selectionColor () const
 
int selectionEnd () const
 
int selectionStart () const
 
void setColor (const QColor &c)
 
void setCursorDelegate (QDeclarativeComponent *)
 
void setCursorPosition (int pos)
 
void setCursorVisible (bool on)
 
void setFocusOnPress (bool on)
 
void setFont (const QFont &font)
 
void setHAlign (HAlignment align)
 
void setMouseSelectionMode (SelectionMode mode)
 
void setPersistentSelection (bool on)
 
void setReadOnly (bool)
 
void setSelectByMouse (bool)
 
void setSelectedTextColor (const QColor &c)
 
void setSelectionColor (const QColor &c)
 
void setText (const QString &)
 
void setTextFormat (TextFormat format)
 
void setTextInteractionFlags (Qt::TextInteractionFlags flags)
 Sets how the text edit should interact with user input to the given flags. More...
 
void setTextMargin (qreal margin)
 
void setVAlign (VAlignment align)
 
void setWrapMode (WrapMode w)
 
QString text () const
 
TextFormat textFormat () const
 
Qt::TextInteractionFlags textInteractionFlags () const
 Returns the flags specifying how the text edit should interact with user input. More...
 
qreal textMargin () const
 
VAlignment vAlign () const
 
WrapMode wrapMode () const
 
- 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

void drawContents (QPainter *, const QRect &)
 Draws the contents of the text edit using the given painter within the given bounds. More...
 
bool event (QEvent *)
 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 event. More...
 
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 *e)
 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 input method event. More...
 
void keyPressEvent (QKeyEvent *)
 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 key event. More...
 
void keyReleaseEvent (QKeyEvent *)
 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 key event. More...
 
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 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 mousePressEvent (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 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...
 
- 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 ()
 
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 *)
 
void keyReleasePreHandler (QKeyEvent *)
 
 QDeclarativeItem (QDeclarativeItemPrivate &dd, QDeclarativeItem *parent=0)
 
virtual bool sceneEvent (QEvent *)
 
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 loadCursorDelegate ()
 
void moveCursorDelegate ()
 
void q_canPasteChanged ()
 
void q_textChanged ()
 
void updateImgCache (const QRectF &rect)
 
void updateSelectionMarkers ()
 

Private Functions

void updateSize ()
 
void updateTotalLines ()
 

Properties

bool activeFocusOnPress
 
bool canPaste
 
QColor color
 
QDeclarativeComponentcursorDelegate
 
int cursorPosition
 
QRect cursorRectangle
 
bool cursorVisible
 
QFont font
 
HAlignment horizontalAlignment
 
bool inputMethodComposing
 
Qt::InputMethodHints inputMethodHints
 
int lineCount
 
SelectionMode mouseSelectionMode
 
qreal paintedHeight
 
qreal paintedWidth
 
bool persistentSelection
 
bool readOnly
 
bool selectByMouse
 
QString selectedText
 
QColor selectedTextColor
 
QColor selectionColor
 
int selectionEnd
 
int selectionStart
 
QString text
 
TextFormat textFormat
 
qreal textMargin
 
VAlignment verticalAlignment
 
WrapMode wrapMode
 

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 qdeclarativetextedit_p.h.

Enumerations

◆ HAlignment

◆ SelectionMode

Enumerator
SelectCharacters 
SelectWords 

Definition at line 128 of file qdeclarativetextedit_p.h.

◆ TextFormat

◆ VAlignment

◆ WrapMode

Constructors and Destructors

◆ QDeclarativeTextEdit()

QDeclarativeTextEdit::QDeclarativeTextEdit ( QDeclarativeItem parent = 0)

This handler is called when the user clicks on a link embedded in the text.

TextEdit::onLinkActivated(string link)

Since
QtQuick 1.1

The link must be in rich text or HTML format and the link string provides access to the particular link.

Definition at line 122 of file qdeclarativetextedit.cpp.

Functions

◆ activeFocusOnPressChanged

void QDeclarativeTextEdit::activeFocusOnPressChanged ( bool  activeFocusOnPressed)
signal

Referenced by setFocusOnPress().

◆ boundingRect()

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

Reimplemented from QDeclarativePaintedItem.

Definition at line 1777 of file qdeclarativetextedit.cpp.

Referenced by mouseReleaseEvent().

1778 {
1779  Q_D(const QDeclarativeTextEdit);
1781  int cursorWidth = 1;
1782  if(d->cursor)
1783  cursorWidth = d->cursor->width();
1784  if(!d->document->isEmpty())
1785  cursorWidth += 3;// ### Need a better way of accounting for space between char and cursor
1786 
1787  // Could include font max left/right bearings to either side of rectangle.
1788 
1789  r.setRight(r.right() + cursorWidth);
1790  return r.translated(0,d->yoff);
1791 }
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
QRectF translated(qreal dx, qreal dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:740

◆ canPaste()

bool QDeclarativeTextEdit::canPaste ( ) const

◆ canPasteChanged

void QDeclarativeTextEdit::canPasteChanged ( )
signal

Referenced by q_canPasteChanged().

◆ closeSoftwareInputPanel()

void QDeclarativeTextEdit::closeSoftwareInputPanel ( )

Definition at line 2014 of file qdeclarativetextedit.cpp.

2015 {
2017  if (qApp) {
2018  if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
2019  if (view->scene() && view->scene() == scene()) {
2021  }
2022  }
2023  }
2024 }
#define qApp
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
bool event(QEvent *)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 QDeclarativeTextEdit::color ( ) const

◆ colorChanged

void QDeclarativeTextEdit::colorChanged ( const QColor color)
signal

Referenced by setColor().

◆ componentComplete()

void QDeclarativeTextEdit::componentComplete ( )
virtual

Ensures any delayed caching or data loading the class needs to performed is complete.

Reimplemented from QDeclarativeItem.

Definition at line 1140 of file qdeclarativetextedit.cpp.

1141 {
1144  if (d->dirty) {
1145  d->determineHorizontalAlignment();
1146  d->updateDefaultTextOption();
1147  updateSize();
1148  d->dirty = false;
1149  }
1150 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void componentComplete()

◆ copy

void QDeclarativeTextEdit::copy ( )
slot

Definition at line 1463 of file qdeclarativetextedit.cpp.

1464 {
1466  d->control->copy();
1467 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ cursorDelegate()

QDeclarativeComponent* QDeclarativeTextEdit::cursorDelegate ( ) const

Referenced by setCursorPosition().

◆ cursorDelegateChanged

void QDeclarativeTextEdit::cursorDelegateChanged ( )
signal

Referenced by setCursorDelegate().

◆ cursorPosition()

int QDeclarativeTextEdit::cursorPosition ( ) const

Referenced by setCursorVisible().

◆ cursorPositionChanged

void QDeclarativeTextEdit::cursorPositionChanged ( )
signal

◆ cursorRectangle()

QRect QDeclarativeTextEdit::cursorRectangle ( ) const

◆ cursorRectangleChanged

void QDeclarativeTextEdit::cursorRectangleChanged ( )
signal

Referenced by moveCursorDelegate().

◆ cursorVisibleChanged

void QDeclarativeTextEdit::cursorVisibleChanged ( bool  isCursorVisible)
signal

Referenced by setCursorVisible().

◆ cut

void QDeclarativeTextEdit::cut ( )
slot

Definition at line 1449 of file qdeclarativetextedit.cpp.

1450 {
1452  d->control->cut();
1453 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ deselect

void QDeclarativeTextEdit::deselect ( )
slot

Definition at line 1350 of file qdeclarativetextedit.cpp.

1351 {
1353  QTextCursor c = d->control->textCursor();
1354  c.clearSelection();
1355  d->control->setTextCursor(c);
1356 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
void clearSelection()
Clears the current selection by setting the anchor to the cursor position.

◆ drawContents()

void QDeclarativeTextEdit::drawContents ( QPainter painter,
const QRect bounds 
)
protectedvirtual

Draws the contents of the text edit using the given painter within the given bounds.

Reimplemented from QDeclarativeImplicitSizePaintedItem.

Definition at line 1587 of file qdeclarativetextedit.cpp.

1588 {
1590 
1591  painter->setRenderHint(QPainter::TextAntialiasing, true);
1592  painter->translate(0,d->yoff);
1593 
1594  d->control->drawContents(painter, bounds.translated(0,-d->yoff));
1595 
1596  painter->translate(0,-d->yoff);
1597 }
QDeclarativeParserStatus ** d
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
#define Q_D(Class)
Definition: qglobal.h:2482
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
Definition: qpainter.cpp:7620
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
Definition: qpainter.cpp:3311

◆ effectiveHAlign()

QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::effectiveHAlign ( ) const

Definition at line 570 of file qdeclarativetextedit.cpp.

571 {
572  Q_D(const QDeclarativeTextEdit);
573  QDeclarativeTextEdit::HAlignment effectiveAlignment = d->hAlign;
574  if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
575  switch (d->hAlign) {
577  effectiveAlignment = QDeclarativeTextEdit::AlignRight;
578  break;
580  effectiveAlignment = QDeclarativeTextEdit::AlignLeft;
581  break;
582  default:
583  break;
584  }
585  }
586  return effectiveAlignment;
587 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ event()

bool QDeclarativeTextEdit::event ( QEvent 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 event.

Reimplemented from QDeclarativeItem.

Definition at line 1296 of file qdeclarativetextedit.cpp.

Referenced by closeSoftwareInputPanel(), and openSoftwareInputPanel().

1297 {
1299  if (event->type() == QEvent::ShortcutOverride) {
1300  d->control->processEvent(event, QPointF(0, -d->yoff));
1301  return event->isAccepted();
1302  }
1303  return QDeclarativePaintedItem::event(event);
1304 }
QDeclarativeParserStatus ** d
virtual bool event(QEvent *)
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
Type type() const
Returns the event type.
Definition: qcoreevent.h:303

◆ focusInEvent()

void QDeclarativeTextEdit::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 2026 of file qdeclarativetextedit.cpp.

2027 {
2028  Q_D(const QDeclarativeTextEdit);
2029  if (d->showInputPanelOnFocus) {
2030  if (d->focusOnPress && !isReadOnly()) {
2032  }
2033  }
2035 }
QDeclarativeParserStatus ** d
Q_INVOKABLE void openSoftwareInputPanel()
#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...

◆ focusOnPress()

bool QDeclarativeTextEdit::focusOnPress ( ) const

Definition at line 1068 of file qdeclarativetextedit.cpp.

1069 {
1070  Q_D(const QDeclarativeTextEdit);
1071  return d->focusOnPress;
1072 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ font()

QFont QDeclarativeTextEdit::font ( ) const

◆ fontChanged

void QDeclarativeTextEdit::fontChanged ( const QFont font)
signal

Referenced by setFont().

◆ geometryChanged()

void QDeclarativeTextEdit::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 1128 of file qdeclarativetextedit.cpp.

1130 {
1131  if (newGeometry.width() != oldGeometry.width())
1132  updateSize();
1133  QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
1134 }
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()

QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign ( ) const

Definition at line 543 of file qdeclarativetextedit.cpp.

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

544 {
545  Q_D(const QDeclarativeTextEdit);
546  return d->hAlign;
547 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ horizontalAlignmentChanged

void QDeclarativeTextEdit::horizontalAlignmentChanged ( HAlignment  alignment)
signal

◆ inputMethodComposingChanged

void QDeclarativeTextEdit::inputMethodComposingChanged ( )
signal

Referenced by inputMethodEvent().

◆ inputMethodEvent()

void QDeclarativeTextEdit::inputMethodEvent ( QInputMethodEvent e)
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 input method event.

Reimplemented from QDeclarativeItem.

Definition at line 1564 of file qdeclarativetextedit.cpp.

1565 {
1567  const bool wasComposing = isInputMethodComposing();
1568  d->control->processEvent(event, QPointF(0, -d->yoff));
1569  if (wasComposing != isInputMethodComposing())
1571 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
void inputMethodComposingChanged()
#define emit
Definition: qobjectdefs.h:76
bool event(QEvent *)
This is an overloaded member function, provided for convenience. It differs from the above function o...

◆ inputMethodQuery()

QVariant QDeclarativeTextEdit::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 1577 of file qdeclarativetextedit.cpp.

1578 {
1579  Q_D(const QDeclarativeTextEdit);
1580  return d->control->inputMethodQuery(property);
1581 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807

◆ isCursorVisible()

bool QDeclarativeTextEdit::isCursorVisible ( ) const

Definition at line 891 of file qdeclarativetextedit.cpp.

892 {
893  Q_D(const QDeclarativeTextEdit);
894  return d->cursorVisible;
895 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isInputMethodComposing()

bool QDeclarativeTextEdit::isInputMethodComposing ( ) const

Definition at line 1668 of file qdeclarativetextedit.cpp.

Referenced by inputMethodEvent().

1669 {
1670  Q_D(const QDeclarativeTextEdit);
1671  if (QTextLayout *layout = d->control->textCursor().block().layout())
1672  return layout->preeditAreaText().length() > 0;
1673  return false;
1674 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
const char * layout
The QTextLayout class is used to lay out and render text.
Definition: qtextlayout.h:105

◆ isReadOnly()

bool QDeclarativeTextEdit::isReadOnly ( ) const

Definition at line 1250 of file qdeclarativetextedit.cpp.

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

1251 {
1252  Q_D(const QDeclarativeTextEdit);
1253  return !(d->control->textInteractionFlags() & Qt::TextEditable);
1254 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isRightToLeft

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

Definition at line 1429 of file qdeclarativetextedit.cpp.

1430 {
1432  if (start > end) {
1433  qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
1434  return false;
1435  } else {
1436  return d->text.mid(start, end - start).isRightToLeft();
1437  }
1438 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeInfo qmlInfo(const QObject *me)
static const KeyPair *const end

◆ keyPressEvent()

void QDeclarativeTextEdit::keyPressEvent ( QKeyEvent 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 key event.

Reimplemented from QDeclarativeItem.

Definition at line 1310 of file qdeclarativetextedit.cpp.

1311 {
1313  keyPressPreHandler(event);
1314  if (!event->isAccepted())
1315  d->control->processEvent(event, QPointF(0, -d->yoff));
1316  if (!event->isAccepted())
1318 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
virtual void keyPressEvent(QKeyEvent *event)
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
void keyPressPreHandler(QKeyEvent *)

◆ keyReleaseEvent()

void QDeclarativeTextEdit::keyReleaseEvent ( QKeyEvent 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 key event.

Reimplemented from QDeclarativeItem.

Definition at line 1324 of file qdeclarativetextedit.cpp.

1325 {
1327  keyReleasePreHandler(event);
1328  if (!event->isAccepted())
1329  d->control->processEvent(event, QPointF(0, -d->yoff));
1330  if (!event->isAccepted())
1332 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
void keyReleasePreHandler(QKeyEvent *)
virtual void keyReleaseEvent(QKeyEvent *event)

◆ lineCount()

int QDeclarativeTextEdit::lineCount ( ) const

Referenced by setWrapMode().

◆ lineCountChanged

void QDeclarativeTextEdit::lineCountChanged ( )
signal

Referenced by updateTotalLines().

◆ linkActivated

void QDeclarativeTextEdit::linkActivated ( const QString link)
signal

◆ loadCursorDelegate

void QDeclarativeTextEdit::loadCursorDelegate ( )
privateslot

Definition at line 980 of file qdeclarativetextedit.cpp.

Referenced by setCursorDelegate().

981 {
983  if(d->cursorComponent->isLoading())
984  return;
985  d->cursor = qobject_cast<QDeclarativeItem*>(d->cursorComponent->create(qmlContext(this)));
986  if(d->cursor){
987  d->control->setCursorWidth(0);
989  QDeclarative_setParent_noEvent(d->cursor, this);
990  d->cursor->setParentItem(this);
991  d->cursor->setHeight(QFontMetrics(d->font).height());
993  }else{
994  qmlInfo(this) << "Error loading cursor delegate.";
995  }
996 }
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QDeclarativeParserStatus ** d
T * qobject_cast(QObject *object)
Definition: qobject.h:375
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
#define Q_D(Class)
Definition: qglobal.h:2482
The QDeclarativeItem class provides the most basic of all visual items in QML.
QRect cursorRectangle() const
void dirtyCache(const QRect &)
Marks areas of the cache that intersect with the given rect as dirty and in need of being refreshed...
void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QDeclarativeInfo qmlInfo(const QObject *me)
int height() const
Returns the height of the font.

◆ mouseDoubleClickEvent()

void QDeclarativeTextEdit::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 1538 of file qdeclarativetextedit.cpp.

1539 {
1541 
1542  d->control->processEvent(event, QPointF(0, -d->yoff));
1543  if (!event->isAccepted())
1545 
1546 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
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
bool isAccepted() const
Definition: qcoreevent.h:307

◆ mouseMoveEvent()

void QDeclarativeTextEdit::mouseMoveEvent ( 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 1552 of file qdeclarativetextedit.cpp.

1553 {
1555  d->control->processEvent(event, QPointF(0, -d->yoff));
1556  if (!event->isAccepted())
1558 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...

◆ mousePressEvent()

void QDeclarativeTextEdit::mousePressEvent ( 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 1488 of file qdeclarativetextedit.cpp.

1489 {
1491  if (d->focusOnPress){
1492  bool hadActiveFocus = hasActiveFocus();
1493  forceActiveFocus();
1494  if (d->showInputPanelOnFocus) {
1495  if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
1496  // re-open input panel on press if already focused
1498  }
1499  } else { // show input panel on click
1500  if (hasActiveFocus() && !hadActiveFocus) {
1501  d->clickCausedFocus = true;
1502  }
1503  }
1504  }
1505 
1506  d->control->processEvent(event, QPointF(0, -d->yoff));
1507  if (!event->isAccepted())
1509 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
Q_INVOKABLE void openSoftwareInputPanel()
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
#define Q_D(Class)
Definition: qglobal.h:2482
bool isAccepted() const
Definition: qcoreevent.h:307
bool hasActiveFocus() const
Q_INVOKABLE void forceActiveFocus()
Forces active focus on the item.

◆ mouseReleaseEvent()

void QDeclarativeTextEdit::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 1515 of file qdeclarativetextedit.cpp.

1516 {
1518  d->control->processEvent(event, QPointF(0, -d->yoff));
1519  if (!d->showInputPanelOnFocus) { // input panel on click
1520  if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
1521  if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
1522  if (view->scene() && view->scene() == scene()) {
1523  qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
1524  }
1525  }
1526  }
1527  }
1528  d->clickCausedFocus = false;
1529 
1530  if (!event->isAccepted())
1532 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
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...

◆ mouseSelectionMode()

SelectionMode QDeclarativeTextEdit::mouseSelectionMode ( ) const

Referenced by setSelectByMouse().

◆ mouseSelectionModeChanged

void QDeclarativeTextEdit::mouseSelectionModeChanged ( SelectionMode  mode)
signal

Referenced by setMouseSelectionMode().

◆ moveCursorDelegate

void QDeclarativeTextEdit::moveCursorDelegate ( )
privateslot

Definition at line 1734 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::init(), loadCursorDelegate(), setFont(), and setVAlign().

1735 {
1737  d->determineHorizontalAlignment();
1738  updateMicroFocus();
1740  if(!d->cursor)
1741  return;
1742  QRectF cursorRect = cursorRectangle();
1743  d->cursor->setX(cursorRect.x());
1744  d->cursor->setY(cursorRect.y());
1745 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
QDeclarativeParserStatus ** d
void updateMicroFocus()
Updates the item&#39;s micro focus.
#define Q_D(Class)
Definition: qglobal.h:2482
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
#define emit
Definition: qobjectdefs.h:76
QRect cursorRectangle() const
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ moveCursorSelection() [1/2]

void QDeclarativeTextEdit::moveCursorSelection ( int  pos)

Definition at line 780 of file qdeclarativetextedit.cpp.

781 {
782  //Note that this is the same as setCursorPosition but with the KeepAnchor flag set
784  QTextCursor cursor = d->control->textCursor();
785  if (cursor.position() == pos)
786  return;
788  d->control->setTextCursor(cursor);
789 }
QDeclarativeParserStatus ** d
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.
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
int position() const
Returns the absolute position of the cursor within the document.
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...

◆ moveCursorSelection() [2/2]

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

Definition at line 832 of file qdeclarativetextedit.cpp.

833 {
835  QTextCursor cursor = d->control->textCursor();
836  if (cursor.position() == pos)
837  return;
838  if (mode == SelectCharacters) {
840  } else if (cursor.anchor() < pos || (cursor.anchor() == pos && cursor.position() < pos)) {
841  if (cursor.anchor() > cursor.position()) {
842  cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
844  if (cursor.position() == cursor.anchor())
846  else
847  cursor.setPosition(cursor.position(), QTextCursor::MoveAnchor);
848  } else {
849  cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
851  }
852 
855  if (cursor.position() != pos)
857  } else if (cursor.anchor() > pos || (cursor.anchor() == pos && cursor.position() > pos)) {
858  if (cursor.anchor() < cursor.position()) {
859  cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
861  } else {
862  cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
865  if (cursor.position() != cursor.anchor()) {
866  cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
868  }
869  }
870 
873  if (cursor.position() != pos) {
876  }
877  }
878  d->control->setTextCursor(cursor);
879 }
int anchor() const
Returns the anchor position; this is the same as position() unless there is a selection in which case...
QDeclarativeParserStatus ** d
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.
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
int position() const
Returns the absolute position of the cursor within the document.
bool movePosition(MoveOperation op, MoveMode=MoveAnchor, int n=1)
Moves the cursor by performing the given operation n times, using the specified mode, and returns true if all operations were completed successfully; otherwise returns false.
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...

◆ openSoftwareInputPanel()

void QDeclarativeTextEdit::openSoftwareInputPanel ( )

Definition at line 1960 of file qdeclarativetextedit.cpp.

Referenced by focusInEvent(), and mousePressEvent().

1961 {
1963  if (qApp) {
1964  if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
1965  if (view->scene() && view->scene() == scene()) {
1967  }
1968  }
1969  }
1970 }
#define qApp
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
bool event(QEvent *)
This is an overloaded member function, provided for convenience. It differs from the above function o...
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

◆ paintedHeight()

qreal QDeclarativeTextEdit::paintedHeight ( ) const

Referenced by setWrapMode().

◆ paintedSizeChanged

void QDeclarativeTextEdit::paintedSizeChanged ( )
signal

Referenced by updateSize().

◆ paintedWidth()

qreal QDeclarativeTextEdit::paintedWidth ( ) const

Referenced by setWrapMode().

◆ paste

void QDeclarativeTextEdit::paste ( )
slot

Definition at line 1477 of file qdeclarativetextedit.cpp.

1478 {
1480  d->control->paste();
1481 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ persistentSelection()

bool QDeclarativeTextEdit::persistentSelection ( ) const

Referenced by setFocusOnPress().

◆ persistentSelectionChanged

void QDeclarativeTextEdit::persistentSelectionChanged ( bool  isPersistentSelection)
signal

Referenced by setPersistentSelection().

◆ positionAt()

int QDeclarativeTextEdit::positionAt ( int  x,
int  y 
) const

Definition at line 757 of file qdeclarativetextedit.cpp.

758 {
759  Q_D(const QDeclarativeTextEdit);
760  int r = d->document->documentLayout()->hitTest(QPoint(x,y-d->yoff), Qt::FuzzyHit);
761  QTextCursor cursor = d->control->textCursor();
762  if (r > cursor.position()) {
763  // The cursor position includes positions within the preedit text, but only positions in the
764  // same text block are offset so it is possible to get a position that is either part of the
765  // preedit or the next text block.
766  QTextLayout *layout = cursor.block().layout();
767  const int preeditLength = layout
768  ? layout->preeditAreaText().length()
769  : 0;
770  if (preeditLength > 0
771  && d->document->documentLayout()->blockBoundingRect(cursor.block()).contains(x,y-d->yoff)) {
772  r = r > cursor.position() + preeditLength
773  ? r - preeditLength
774  : cursor.position();
775  }
776  }
777  return r;
778 }
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
QCursor cursor() const
Returns the current cursor shape for the item.
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
const char * layout
int position() const
Returns the absolute position of the cursor within the document.
QTextBlock block() const
Returns the block that contains the cursor.
QString preeditAreaText() const
Returns the text that is inserted in the layout before editing occurs.
The QTextLayout class is used to lay out and render text.
Definition: qtextlayout.h:105
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise, false is returned.
QTextLayout * layout() const
Returns the QTextLayout that is used to lay out and display the block&#39;s contents. ...

◆ positionToRectangle()

QRectF QDeclarativeTextEdit::positionToRectangle ( int  pos) const

Definition at line 737 of file qdeclarativetextedit.cpp.

738 {
739  Q_D(const QDeclarativeTextEdit);
740  QTextCursor c(d->document);
741  c.setPosition(pos);
742  return d->control->cursorRect(c);
743 
744 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QDeclarativeParserStatus ** d
QPointF pos() const
Returns the position of the item in parent coordinates.
#define Q_D(Class)
Definition: qglobal.h:2482
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70

◆ q_canPasteChanged

void QDeclarativeTextEdit::q_canPasteChanged ( )
privateslot

Definition at line 2037 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::init().

2038 {
2040  bool old = d->canPaste;
2041  d->canPaste = d->control->canPaste();
2042  if(old!=d->canPaste)
2044 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ q_textChanged

void QDeclarativeTextEdit::q_textChanged ( )
privateslot

Definition at line 1722 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::init(), and setText().

1723 {
1725  d->text = text();
1726  d->rightToLeftText = d->document->begin().layout()->engine()->isRightToLeft();
1727  d->determineHorizontalAlignment();
1728  d->updateDefaultTextOption();
1729  updateSize();
1730  updateTotalLines();
1731  emit textChanged(d->text);
1732 }
QDeclarativeParserStatus ** d
QString text() const
#define Q_D(Class)
Definition: qglobal.h:2482
void textChanged(const QString &)
#define emit
Definition: qobjectdefs.h:76

◆ readOnlyChanged

void QDeclarativeTextEdit::readOnlyChanged ( bool  isReadOnly)
signal

◆ resetHAlign()

void QDeclarativeTextEdit::resetHAlign ( )

Definition at line 560 of file qdeclarativetextedit.cpp.

561 {
563  d->hAlignImplicit = true;
564  if (d->determineHorizontalAlignment() && isComponentComplete()) {
565  d->updateDefaultTextOption();
566  updateSize();
567  }
568 }
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

◆ select

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

Definition at line 1404 of file qdeclarativetextedit.cpp.

1405 {
1407  if (start < 0 || end < 0 || start > d->text.length() || end > d->text.length())
1408  return;
1409  QTextCursor cursor = d->control->textCursor();
1410  cursor.beginEditBlock();
1411  cursor.setPosition(start, QTextCursor::MoveAnchor);
1413  cursor.endEditBlock();
1414  d->control->setTextCursor(cursor);
1415 
1416  // QTBUG-11100
1418 }
void endEditBlock()
Indicates the end of a block of editing operations on the document that should appear as a single ope...
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
QCursor cursor() const
Returns the current cursor shape for the item.
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
void beginEditBlock()
Indicates the start of a block of editing operations on the document that should appear as a single o...
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...
static const KeyPair *const end

◆ selectAll

void QDeclarativeTextEdit::selectAll ( )
slot

Definition at line 1366 of file qdeclarativetextedit.cpp.

1367 {
1369  d->control->selectAll();
1370 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ selectByMouse()

bool QDeclarativeTextEdit::selectByMouse ( ) const

Referenced by componentComplete().

◆ selectByMouseChanged

void QDeclarativeTextEdit::selectByMouseChanged ( bool  selectByMouse)
signal

Referenced by setSelectByMouse().

◆ selectedText()

QString QDeclarativeTextEdit::selectedText ( ) const

Referenced by loadCursorDelegate().

◆ selectedTextColor()

QColor QDeclarativeTextEdit::selectedTextColor ( ) const

Referenced by setSelectionColor().

◆ selectedTextColorChanged

void QDeclarativeTextEdit::selectedTextColorChanged ( const QColor color)
signal

Referenced by setSelectedTextColor().

◆ selectionChanged

void QDeclarativeTextEdit::selectionChanged ( )
signal

◆ selectionColor()

QColor QDeclarativeTextEdit::selectionColor ( ) const

Referenced by setColor().

◆ selectionColorChanged

void QDeclarativeTextEdit::selectionColorChanged ( const QColor color)
signal

Referenced by setSelectionColor().

◆ selectionEnd()

int QDeclarativeTextEdit::selectionEnd ( ) const

Referenced by loadCursorDelegate().

◆ selectionEndChanged

void QDeclarativeTextEdit::selectionEndChanged ( )
signal

Referenced by updateSelectionMarkers().

◆ selectionStart()

int QDeclarativeTextEdit::selectionStart ( ) const

Referenced by loadCursorDelegate().

◆ selectionStartChanged

void QDeclarativeTextEdit::selectionStartChanged ( )
signal

Referenced by updateSelectionMarkers().

◆ selectWord

void QDeclarativeTextEdit::selectWord ( )
slot

Definition at line 1380 of file qdeclarativetextedit.cpp.

1381 {
1383  QTextCursor c = d->control->textCursor();
1385  d->control->setTextCursor(c);
1386 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
void select(SelectionType selection)
Selects text in the document according to the given selection.

◆ setColor()

void QDeclarativeTextEdit::setColor ( const QColor c)

Definition at line 438 of file qdeclarativetextedit.cpp.

439 {
441  if (d->color == color)
442  return;
443 
444  clearCache();
445  d->color = color;
446  QPalette pal = d->control->palette();
448  d->control->setPalette(pal);
449  update();
450  emit colorChanged(d->color);
451 }
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 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.
QColor color() const
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ setCursorDelegate()

void QDeclarativeTextEdit::setCursorDelegate ( QDeclarativeComponent c)

Definition at line 957 of file qdeclarativetextedit.cpp.

958 {
960  if(d->cursorComponent){
961  if(d->cursor){
962  d->control->setCursorWidth(-1);
964  delete d->cursor;
965  d->cursor = 0;
966  }
967  }
968  d->cursorComponent = c;
969  if(c && c->isReady()){
971  }else{
972  if(c)
973  connect(c, SIGNAL(statusChanged()),
974  this, SLOT(loadCursorDelegate()));
975  }
976 
978 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QDeclarativeParserStatus ** d
#define SLOT(a)
Definition: qobjectdefs.h:226
bool isReady() const
Returns true if status() == QDeclarativeComponent::Ready.
#define Q_D(Class)
Definition: qglobal.h:2482
#define SIGNAL(a)
Definition: qobjectdefs.h:227
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 rece...
Definition: qobject.cpp:2580
#define emit
Definition: qobjectdefs.h:76
QRect cursorRectangle() const
void dirtyCache(const QRect &)
Marks areas of the cache that intersect with the given rect as dirty and in need of being refreshed...

◆ setCursorPosition()

void QDeclarativeTextEdit::setCursorPosition ( int  pos)

Definition at line 923 of file qdeclarativetextedit.cpp.

924 {
926  if (pos < 0 || pos > d->text.length())
927  return;
928  QTextCursor cursor = d->control->textCursor();
929  if (cursor.position() == pos && cursor.anchor() == pos)
930  return;
931  cursor.setPosition(pos);
932  d->control->setTextCursor(cursor);
933 }
int anchor() const
Returns the anchor position; this is the same as position() unless there is a selection in which case...
QDeclarativeParserStatus ** d
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.
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:70
int position() const
Returns the absolute position of the cursor within the document.
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...

◆ setCursorVisible()

void QDeclarativeTextEdit::setCursorVisible ( bool  on)

Definition at line 897 of file qdeclarativetextedit.cpp.

898 {
900  if (d->cursorVisible == on)
901  return;
902  d->cursorVisible = on;
903  QFocusEvent focusEvent(on ? QEvent::FocusIn : QEvent::FocusOut);
904  if (!on && !d->persistentSelection)
905  d->control->setCursorIsFocusIndicator(true);
906  d->control->processEvent(&focusEvent, QPointF(0, -d->yoff));
907  emit cursorVisibleChanged(d->cursorVisible);
908 }
QDeclarativeParserStatus ** d
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void cursorVisibleChanged(bool isCursorVisible)
The QFocusEvent class contains event parameters for widget focus events.
Definition: qevent.h:275

◆ setFocusOnPress()

void QDeclarativeTextEdit::setFocusOnPress ( bool  on)

Definition at line 1074 of file qdeclarativetextedit.cpp.

1075 {
1077  if (d->focusOnPress == on)
1078  return;
1079  d->focusOnPress = on;
1080  emit activeFocusOnPressChanged(d->focusOnPress);
1081 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void activeFocusOnPressChanged(bool activeFocusOnPressed)

◆ setFont()

void QDeclarativeTextEdit::setFont ( const QFont font)

Definition at line 386 of file qdeclarativetextedit.cpp.

387 {
389  if (d->sourceFont == font)
390  return;
391 
392  d->sourceFont = font;
393  QFont oldFont = d->font;
394  d->font = font;
395  if (d->font.pointSizeF() != -1) {
396  // 0.5pt resolution
397  qreal size = qRound(d->font.pointSizeF()*2.0);
398  d->font.setPointSizeF(size/2.0);
399  }
400 
401  if (oldFont != d->font) {
402  clearCache();
403  d->document->setDefaultFont(d->font);
404  if(d->cursor){
405  d->cursor->setHeight(QFontMetrics(d->font).height());
407  }
408  updateSize();
409  update();
410  }
411  emit fontChanged(d->sourceFont);
412 }
double qreal
Definition: qglobal.h:1193
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QDeclarativeParserStatus ** d
QFont font() const
void fontChanged(const QFont &font)
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
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
void clearCache()
Marks the entirety of the contents cache as dirty.
int height() const
Returns the height of the font.
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ setHAlign()

void QDeclarativeTextEdit::setHAlign ( HAlignment  align)

Definition at line 549 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::determineHorizontalAlignment().

550 {
552  bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
553  d->hAlignImplicit = false;
554  if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
555  d->updateDefaultTextOption();
556  updateSize();
557  }
558 }
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

◆ setMouseSelectionMode()

void QDeclarativeTextEdit::setMouseSelectionMode ( SelectionMode  mode)

Definition at line 1209 of file qdeclarativetextedit.cpp.

1210 {
1212  if (d->mouseSelectionMode != mode) {
1213  d->mouseSelectionMode = mode;
1214  d->control->setWordSelectionEnabled(mode == SelectWords);
1216  }
1217 }
void mouseSelectionModeChanged(SelectionMode mode)
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setPersistentSelection()

void QDeclarativeTextEdit::setPersistentSelection ( bool  on)

Definition at line 1098 of file qdeclarativetextedit.cpp.

1099 {
1101  if (d->persistentSelection == on)
1102  return;
1103  d->persistentSelection = on;
1104  emit persistentSelectionChanged(d->persistentSelection);
1105 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void persistentSelectionChanged(bool isPersistentSelection)

◆ setReadOnly()

void QDeclarativeTextEdit::setReadOnly ( bool  r)

Definition at line 1230 of file qdeclarativetextedit.cpp.

1231 {
1233  if (r == isReadOnly())
1234  return;
1235 
1237 
1238  Qt::TextInteractionFlags flags = Qt::LinksAccessibleByMouse;
1239  if (d->selectByMouse)
1240  flags = flags | Qt::TextSelectableByMouse;
1241  if (!r)
1243  d->control->setTextInteractionFlags(flags);
1244  if (!r)
1245  d->control->moveCursor(QTextCursor::End);
1246 
1247  emit readOnlyChanged(r);
1248 }
QDeclarativeParserStatus ** d
void readOnlyChanged(bool isReadOnly)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
GraphicsItemFlags flags() const
Returns this item&#39;s flags.
void setFlag(GraphicsItemFlag flag, bool enabled=true)
If enabled is true, the item flag flag is enabled; otherwise, it is disabled.

◆ setSelectByMouse()

void QDeclarativeTextEdit::setSelectByMouse ( bool  on)

Definition at line 1171 of file qdeclarativetextedit.cpp.

1172 {
1174  if (d->selectByMouse != on) {
1175  d->selectByMouse = on;
1176  setKeepMouseGrab(on);
1177  if (on)
1178  setTextInteractionFlags(d->control->textInteractionFlags() | Qt::TextSelectableByMouse);
1179  else
1180  setTextInteractionFlags(d->control->textInteractionFlags() & ~Qt::TextSelectableByMouse);
1182  }
1183 }
QDeclarativeParserStatus ** d
void selectByMouseChanged(bool selectByMouse)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
Sets how the text edit should interact with user input to the given flags.
Definition: qnamespace.h:54
void setKeepMouseGrab(bool)
The flag indicating whether the mouse should remain with this item is set to keep.

◆ setSelectedTextColor()

void QDeclarativeTextEdit::setSelectedTextColor ( const QColor c)

Definition at line 496 of file qdeclarativetextedit.cpp.

497 {
499  if (d->selectedTextColor == color)
500  return;
501 
502  clearCache();
503  d->selectedTextColor = color;
504  QPalette pal = d->control->palette();
506  d->control->setPalette(pal);
507  update();
508  emit selectedTextColorChanged(d->selectedTextColor);
509 }
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 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.
QColor color() const
void selectedTextColorChanged(const QColor &color)
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ setSelectionColor()

void QDeclarativeTextEdit::setSelectionColor ( const QColor c)

Definition at line 467 of file qdeclarativetextedit.cpp.

468 {
470  if (d->selectionColor == color)
471  return;
472 
473  clearCache();
474  d->selectionColor = color;
475  QPalette pal = d->control->palette();
477  d->control->setPalette(pal);
478  update();
479  emit selectionColorChanged(d->selectionColor);
480 }
QDeclarativeParserStatus ** d
void selectionColorChanged(const QColor &color)
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 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.
QColor color() const
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61

◆ setText()

void QDeclarativeTextEdit::setText ( const QString text)

Definition at line 290 of file qdeclarativetextedit.cpp.

291 {
293  if (QDeclarativeTextEdit::text() == text)
294  return;
295 
296  d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
297  if (d->richText) {
298 #ifndef QT_NO_TEXTHTMLPARSER
299  d->control->setHtml(text);
300 #else
301  d->control->setPlainText(text);
302 #endif
303  } else {
304  d->control->setPlainText(text);
305  }
306  q_textChanged();
307 }
QDeclarativeParserStatus ** d
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
QString text() const
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setTextFormat()

void QDeclarativeTextEdit::setTextFormat ( TextFormat  format)

Definition at line 356 of file qdeclarativetextedit.cpp.

357 {
359  if (format == d->format)
360  return;
361  bool wasRich = d->richText;
362  d->richText = format == RichText || (format == AutoText && Qt::mightBeRichText(d->text));
363 
364  if (wasRich && !d->richText) {
365  d->control->setPlainText(d->text);
366  updateSize();
367  } else if (!wasRich && d->richText) {
368 #ifndef QT_NO_TEXTHTMLPARSER
369  d->control->setHtml(d->text);
370 #else
371  d->control->setPlainText(d->text);
372 #endif
373  updateSize();
374  }
375  d->format = format;
376  d->control->setAcceptRichText(d->format != PlainText);
377  emit textFormatChanged(d->format);
378 }
QDeclarativeParserStatus ** d
void textFormatChanged(TextFormat textFormat)
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ setTextInteractionFlags()

void QDeclarativeTextEdit::setTextInteractionFlags ( Qt::TextInteractionFlags  flags)

Sets how the text edit should interact with user input to the given flags.

Definition at line 1260 of file qdeclarativetextedit.cpp.

Referenced by setSelectByMouse().

1261 {
1263  d->control->setTextInteractionFlags(flags);
1264 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
GraphicsItemFlags flags() const
Returns this item&#39;s flags.

◆ setTextMargin()

void QDeclarativeTextEdit::setTextMargin ( qreal  margin)

Definition at line 1118 of file qdeclarativetextedit.cpp.

1119 {
1121  if (d->textMargin == margin)
1122  return;
1123  d->textMargin = margin;
1124  d->document->setDocumentMargin(d->textMargin);
1125  emit textMarginChanged(d->textMargin);
1126 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
void textMarginChanged(qreal textMargin)

◆ setVAlign()

void QDeclarativeTextEdit::setVAlign ( QDeclarativeTextEdit::VAlignment  alignment)

Definition at line 635 of file qdeclarativetextedit.cpp.

636 {
638  if (alignment == d->vAlign)
639  return;
640  d->vAlign = alignment;
641  d->updateDefaultTextOption();
642  updateSize();
645 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
void verticalAlignmentChanged(VAlignment alignment)
#define emit
Definition: qobjectdefs.h:76

◆ setWrapMode()

void QDeclarativeTextEdit::setWrapMode ( WrapMode  w)

Definition at line 671 of file qdeclarativetextedit.cpp.

672 {
674  if (mode == d->wrapMode)
675  return;
676  d->wrapMode = mode;
677  d->updateDefaultTextOption();
678  updateSize();
680 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ text()

QString QDeclarativeTextEdit::text ( ) const

◆ textChanged

void QDeclarativeTextEdit::textChanged ( const QString )
signal

◆ textFormat()

TextFormat QDeclarativeTextEdit::textFormat ( ) const

Referenced by setText().

◆ textFormatChanged

void QDeclarativeTextEdit::textFormatChanged ( TextFormat  textFormat)
signal

Referenced by setTextFormat().

◆ textInteractionFlags()

Qt::TextInteractionFlags QDeclarativeTextEdit::textInteractionFlags ( ) const

Returns the flags specifying how the text edit should interact with user input.

Definition at line 1270 of file qdeclarativetextedit.cpp.

1271 {
1272  Q_D(const QDeclarativeTextEdit);
1273  return d->control->textInteractionFlags();
1274 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ textMargin()

qreal QDeclarativeTextEdit::textMargin ( ) const

◆ textMarginChanged

void QDeclarativeTextEdit::textMarginChanged ( qreal  textMargin)
signal

Referenced by setTextMargin().

◆ updateImgCache

void QDeclarativeTextEdit::updateImgCache ( const QRectF rect)
privateslot

Definition at line 1599 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::init().

1600 {
1601  Q_D(const QDeclarativeTextEdit);
1602  QRect r;
1603  if (!rf.isValid()) {
1604  r = QRect(0,0,INT_MAX,INT_MAX);
1605  } else {
1606  r = rf.toRect();
1607  if (r.height() > INT_MAX/2) {
1608  // Take care of overflow when translating "everything"
1609  r.setTop(r.y() + d->yoff);
1610  r.setBottom(INT_MAX/2);
1611  } else {
1612  r = r.translated(0,d->yoff);
1613  }
1614  }
1615  dirtyCache(r);
1616  emit update();
1617 }
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
Definition: qrect.h:267
QDeclarativeParserStatus ** d
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
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 setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
Definition: qrect.h:261
#define emit
Definition: qobjectdefs.h:76
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
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define INT_MAX

◆ updateSelectionMarkers

void QDeclarativeTextEdit::updateSelectionMarkers ( )
privateslot

Definition at line 1764 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::init(), and select().

1765 {
1767  if(d->lastSelectionStart != d->control->textCursor().selectionStart()){
1768  d->lastSelectionStart = d->control->textCursor().selectionStart();
1770  }
1771  if(d->lastSelectionEnd != d->control->textCursor().selectionEnd()){
1772  d->lastSelectionEnd = d->control->textCursor().selectionEnd();
1774  }
1775 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76

◆ updateSize()

void QDeclarativeTextEdit::updateSize ( )
private

Definition at line 1807 of file qdeclarativetextedit.cpp.

Referenced by componentComplete(), geometryChanged(), QDeclarativeTextEditPrivate::implicitWidth(), q_textChanged(), resetHAlign(), setFont(), setHAlign(), setTextFormat(), setVAlign(), and setWrapMode().

1808 {
1810  if (isComponentComplete()) {
1811  qreal naturalWidth = d->mImplicitWidth;
1812  // ### assumes that if the width is set, the text will fill to edges
1813  // ### (unless wrap is false, then clipping will occur)
1814  if (widthValid()) {
1815  if (!d->requireImplicitWidth) {
1817  // if the implicitWidth is used, then updateSize() has already been called (recursively)
1818  if (d->requireImplicitWidth)
1819  return;
1820  }
1821  if (d->requireImplicitWidth) {
1822  d->document->setTextWidth(-1);
1823  naturalWidth = d->document->idealWidth();
1824  }
1825  if (d->document->textWidth() != width())
1826  d->document->setTextWidth(width());
1827  } else {
1828  d->document->setTextWidth(-1);
1829  }
1830  QFontMetrics fm = QFontMetrics(d->font);
1831  int dy = height();
1832  dy -= (int)d->document->size().height();
1833 
1834  int nyoff;
1835  if (heightValid()) {
1836  if (d->vAlign == AlignBottom)
1837  nyoff = dy;
1838  else if (d->vAlign == AlignVCenter)
1839  nyoff = dy/2;
1840  else
1841  nyoff = 0;
1842  } else {
1843  nyoff = 0;
1844  }
1845  if (nyoff != d->yoff) {
1847  d->yoff = nyoff;
1848  }
1849  setBaselineOffset(fm.ascent() + d->yoff + d->textMargin);
1850 
1851  //### need to comfirm cost of always setting these
1852  int newWidth = qCeil(d->document->idealWidth());
1853  if (!widthValid() && d->document->textWidth() != newWidth)
1854  d->document->setTextWidth(newWidth); // ### Text does not align if width is not set (QTextDoc bug)
1855  // ### Setting the implicitWidth triggers another updateSize(), and unless there are bindings nothing has changed.
1856  if (!widthValid())
1857  setImplicitWidth(newWidth);
1858  else if (d->requireImplicitWidth)
1859  setImplicitWidth(naturalWidth);
1860  qreal newHeight = d->document->size().height();
1861  if (newHeight == 0)
1862  newHeight = fm.height();
1863  setImplicitHeight(newHeight);
1864 
1865  d->paintedSize = QSize(newWidth, newHeight);
1866  setContentsSize(d->paintedSize);
1868  } else {
1869  d->dirty = true;
1870  }
1871  emit update();
1872 }
double qreal
Definition: qglobal.h:1193
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QDeclarativeParserStatus ** d
int qCeil(qreal v)
Definition: qmath.h:63
bool widthValid() const
Returns whether the width property has been set explicitly.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
void setContentsSize(const QSize &)
Sets the size of the contents to the given size.
void setBaselineOffset(qreal)
bool heightValid() const
Returns whether the height property has been set explicitly.
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
int ascent() const
Returns the ascent of the font.
#define emit
Definition: qobjectdefs.h:76
void setImplicitWidth(qreal)
Sets the implied width of the item to w.
void prepareGeometryChange()
Prepares the item for a geometry change.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
int height() const
Returns the height of the font.
void setImplicitHeight(qreal)
Sets the implied height of the item to h.

◆ updateTotalLines()

void QDeclarativeTextEdit::updateTotalLines ( )
private

Definition at line 1874 of file qdeclarativetextedit.cpp.

Referenced by q_textChanged().

1875 {
1877 
1878  int subLines = 0;
1879 
1880  for (QTextBlock it = d->document->begin(); it != d->document->end(); it = it.next()) {
1881  QTextLayout *layout = it.layout();
1882  if (!layout)
1883  continue;
1884  subLines += layout->lineCount()-1;
1885  }
1886 
1887  int newTotalLines = d->document->lineCount() + subLines;
1888  if (d->lineCount != newTotalLines) {
1889  d->lineCount = newTotalLines;
1891  }
1892 }
QDeclarativeParserStatus ** d
#define it(className, varName)
#define Q_D(Class)
Definition: qglobal.h:2482
#define emit
Definition: qobjectdefs.h:76
const char * layout
The QTextBlock class provides a container for text fragments in a QTextDocument.
Definition: qtextobject.h:199
The QTextLayout class is used to lay out and render text.
Definition: qtextlayout.h:105
int lineCount() const
Returns the number of lines in this text layout.

◆ vAlign()

QDeclarativeTextEdit::VAlignment QDeclarativeTextEdit::vAlign ( ) const

Definition at line 629 of file qdeclarativetextedit.cpp.

Referenced by QDeclarativeTextEditPrivate::updateDefaultTextOption().

630 {
631  Q_D(const QDeclarativeTextEdit);
632  return d->vAlign;
633 }
QDeclarativeParserStatus ** d
#define Q_D(Class)
Definition: qglobal.h:2482

◆ verticalAlignmentChanged

void QDeclarativeTextEdit::verticalAlignmentChanged ( VAlignment  alignment)
signal

Referenced by setVAlign().

◆ wrapMode()

WrapMode QDeclarativeTextEdit::wrapMode ( ) const

◆ wrapModeChanged

void QDeclarativeTextEdit::wrapModeChanged ( )
signal

Referenced by setWrapMode().

Properties

◆ activeFocusOnPress

bool QDeclarativeTextEdit::activeFocusOnPress
private

Definition at line 90 of file qdeclarativetextedit_p.h.

◆ canPaste

bool QDeclarativeTextEdit::canPaste
private

Definition at line 96 of file qdeclarativetextedit_p.h.

◆ color

QColor QDeclarativeTextEdit::color
private

Definition at line 71 of file qdeclarativetextedit_p.h.

◆ cursorDelegate

QDeclarativeComponent * QDeclarativeTextEdit::cursorDelegate
private

Definition at line 86 of file qdeclarativetextedit_p.h.

◆ cursorPosition

int QDeclarativeTextEdit::cursorPosition
private

Definition at line 84 of file qdeclarativetextedit_p.h.

◆ cursorRectangle

QRect QDeclarativeTextEdit::cursorRectangle
private

Definition at line 85 of file qdeclarativetextedit_p.h.

◆ cursorVisible

bool QDeclarativeTextEdit::cursorVisible
private

Definition at line 83 of file qdeclarativetextedit_p.h.

◆ font

QFont QDeclarativeTextEdit::font
private

Definition at line 74 of file qdeclarativetextedit_p.h.

◆ horizontalAlignment

HAlignment QDeclarativeTextEdit::horizontalAlignment
private

◆ inputMethodComposing

bool QDeclarativeTextEdit::inputMethodComposing
private

Definition at line 97 of file qdeclarativetextedit_p.h.

◆ inputMethodHints

Qt::InputMethodHints QDeclarativeTextEdit::inputMethodHints
private

Definition at line 93 of file qdeclarativetextedit_p.h.

◆ lineCount

int QDeclarativeTextEdit::lineCount
private

Definition at line 78 of file qdeclarativetextedit_p.h.

◆ mouseSelectionMode

QDeclarativeTextEdit::SelectionMode QDeclarativeTextEdit::mouseSelectionMode
private

Definition at line 95 of file qdeclarativetextedit_p.h.

◆ paintedHeight

qreal QDeclarativeTextEdit::paintedHeight
private

Definition at line 80 of file qdeclarativetextedit_p.h.

◆ paintedWidth

qreal QDeclarativeTextEdit::paintedWidth
private

Definition at line 79 of file qdeclarativetextedit_p.h.

◆ persistentSelection

bool QDeclarativeTextEdit::persistentSelection
private

Definition at line 91 of file qdeclarativetextedit_p.h.

◆ readOnly

bool QDeclarativeTextEdit::readOnly
private

Definition at line 82 of file qdeclarativetextedit_p.h.

◆ selectByMouse

bool QDeclarativeTextEdit::selectByMouse
private

Definition at line 94 of file qdeclarativetextedit_p.h.

◆ selectedText

QString QDeclarativeTextEdit::selectedText
private

Definition at line 89 of file qdeclarativetextedit_p.h.

◆ selectedTextColor

QColor QDeclarativeTextEdit::selectedTextColor
private

Definition at line 73 of file qdeclarativetextedit_p.h.

◆ selectionColor

QColor QDeclarativeTextEdit::selectionColor
private

Definition at line 72 of file qdeclarativetextedit_p.h.

◆ selectionEnd

int QDeclarativeTextEdit::selectionEnd
private

Definition at line 88 of file qdeclarativetextedit_p.h.

◆ selectionStart

int QDeclarativeTextEdit::selectionStart
private

Definition at line 87 of file qdeclarativetextedit_p.h.

◆ text

QString QDeclarativeTextEdit::text
private

Definition at line 70 of file qdeclarativetextedit_p.h.

◆ textFormat

QDeclarativeTextEdit::TextFormat QDeclarativeTextEdit::textFormat
private

Definition at line 81 of file qdeclarativetextedit_p.h.

◆ textMargin

qreal QDeclarativeTextEdit::textMargin
private

Definition at line 92 of file qdeclarativetextedit_p.h.

◆ verticalAlignment

VAlignment QDeclarativeTextEdit::verticalAlignment
private

Definition at line 76 of file qdeclarativetextedit_p.h.

◆ wrapMode

QDeclarativeTextEdit::WrapMode QDeclarativeTextEdit::wrapMode
private

Definition at line 77 of file qdeclarativetextedit_p.h.


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