Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QTextEdit Class Reference

The QTextEdit class provides a widget that is used to edit and display both plain and rich text. More...

Inheritance diagram for QtGui.QTextEdit:
Collaboration diagram for QtGui.QTextEdit:

Classes

class  ExtraSelection
 The QTextEdit::ExtraSelection structure provides a way of specifying a character format for a given selection in a document More...
 

Public Types

enum  AutoFormattingFlag { AutoAll = -1, AutoBulletList = 1, AutoNone = 0 }
 
enum  LineWrapMode { FixedColumnWidth = 3, FixedPixelWidth = 2, NoWrap = 0, WidgetWidth = 1 }
 

Public Member Functions

 QTextEdit (QWidget parent=null)
 
 
 QTextEdit (string text, QWidget parent=null)
 
 
override void CreateProxy ()
 
new string AnchorAt (QPoint pos)
 
 
new void Append (string text)
 
 
new QTextEdit.AutoFormattingFlag autoFormatting ()
 
new bool CanPaste ()
 
 
new void Clear ()
 
 
new void Copy ()
 
 
new QMenu CreateStandardContextMenu ()
 
 
new QMenu CreateStandardContextMenu (QPoint position)
 
 
new QTextCursor CursorForPosition (QPoint pos)
 
 
new QRect CursorRect ()
 
 
new QRect CursorRect (QTextCursor cursor)
 
 
new void Cut ()
 
 
new void EnsureCursorVisible ()
 
 
override bool OnEvent (QEvent e)
 
 
new bool Find (string exp, QTextDocument.FindFlag options=0)
 
 
override object InputMethodQuery (Qt.InputMethodQuery property)
 
 
new void InsertHtml (string text)
 
 
new void InsertPlainText (string text)
 
 
virtual object LoadResource (int type, QUrl name)
 
 
new void MergeCurrentCharFormat (QTextCharFormat modifier)
 
 
new void MoveCursor (QTextCursor.MoveOperation operation, QTextCursor.MoveMode mode=QTextCursor.MoveMode.MoveAnchor)
 
 
new void Paste ()
 
 
new void Print (QPrinter printer)
 
 
new void Redo ()
 
 
new void ScrollToAnchor (string name)
 
 
new void SelectAll ()
 
 
new void SetAutoFormatting (QTextEdit.AutoFormattingFlag features)
 
new void SetText (string text)
 
 
new void SetTextInteractionFlags (Qt.TextInteractionFlag flags)
 
new Qt.TextInteractionFlag textInteractionFlags ()
 
new void Undo ()
 
 
new void ZoomIn (int range=1)
 
 
new void ZoomOut (int range=1)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QAbstractScrollArea
 QAbstractScrollArea (QWidget parent=null)
 
 
new void AddScrollBarWidget (QWidget widget, Qt.AlignmentFlag alignment)
 
 
new QSize MaximumViewportSize ()
 
 
override QSize MinimumSizeHint ()
 
 
new
System.Collections.Generic.List
< QWidget
ScrollBarWidgets (Qt.AlignmentFlag alignment)
 
 
override QSize SizeHint ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QFrame
 QFrame (QWidget parent=null, Qt.WindowType f=0)
 
 
override QSize SizeHint ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QWidget
 QWidget (QWidget parent=null, Qt.WindowType f=0)
 
 
override void CreateProxy ()
 
new
System.Collections.Generic.List
< QAction
Actions ()
 
 
new void ActivateWindow ()
 
 
new void AddAction (QAction action)
 
 
new void AddActions (System.Collections.Generic.List< QAction > actions)
 
 
new void AdjustSize ()
 
 
new QWidget ChildAt (QPoint p)
 
 
new QWidget ChildAt (int x, int y)
 
 
new void ClearFocus ()
 
 
new void ClearMask ()
 
 
new bool Close ()
 
 
new QRect ContentsRect ()
 
 
new void CreateWinId ()
 
virtual int DevType ()
 
new NativeULong EffectiveWinId ()
 
 
new void EnsurePolished ()
 
 
override bool OnEvent (QEvent arg1)
 
 
new QWidget FocusWidget ()
 
 
new QFont font ()
 
new QFontInfo FontInfo ()
 
 
new QFontMetrics FontMetrics ()
 
 
new QRect geometry ()
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
 
 
virtual System.IntPtr GetDC ()
 
 
new void GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0)
 
 
new void GrabKeyboard ()
 
 
new void GrabMouse ()
 
 
new void GrabMouse (QCursor arg1)
 
 
new int GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut)
 
 
new QGraphicsProxyWidget GraphicsProxyWidget ()
 
 
virtual int HeightForWidth (int arg1)
 
 
new void Hide ()
 
 
new Qt.InputMethodHint inputMethodHints ()
 
new void InsertAction (QAction before, QAction action)
 
 
new void InsertActions (QAction before, System.Collections.Generic.List< QAction > actions)
 
 
new NativeULong InternalWinId ()
 
new bool IsAncestorOf (QWidget child)
 
 
new bool IsEnabledTo (QWidget arg1)
 
 
new bool IsEnabledToTLW ()
 
 
new bool IsHidden ()
 
 
new bool IsLeftToRight ()
 
new bool IsRightToLeft ()
 
new bool IsTopLevel ()
 
 
new bool IsVisibleTo (QWidget arg1)
 
 
new bool IsWindow ()
 
 
new void Lower ()
 
 
new QPoint MapFrom (QWidget arg1, QPoint arg2)
 
 
new QPoint MapFromGlobal (QPoint arg1)
 
 
new QPoint MapFromParent (QPoint arg1)
 
 
new QPoint MapTo (QWidget arg1, QPoint arg2)
 
 
new QPoint MapToGlobal (QPoint arg1)
 
 
new QPoint MapToParent (QPoint arg1)
 
 
new void Move (int x, int y)
 
new QWidget NativeParentWidget ()
 
 
new QWidget NextInFocusChain ()
 
 
new void OverrideWindowFlags (Qt.WindowType type)
 
 
new void OverrideWindowState (Qt.WindowState state)
 
virtual QPaintEngine PaintEngine ()
 
 
new QPalette palette ()
 
new QWidget ParentWidget ()
 
 
new QWidget PreviousInFocusChain ()
 
 
new void Raise ()
 
 
virtual void ReleaseDC (System.IntPtr arg1)
 
 
new void ReleaseKeyboard ()
 
 
new void ReleaseMouse ()
 
 
new void ReleaseShortcut (int id)
 
 
new void RemoveAction (QAction action)
 
 
new void Render (IQPaintDevice target)
 
 
new void Render (QPainter painter)
 
 
new void Render (IQPaintDevice target, QPoint targetOffset)
 
 
new void Render (QPainter painter, QPoint targetOffset)
 
 
new void Render (IQPaintDevice target, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
 
 
new void Render (QPainter painter, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
 
 
new void Repaint ()
 
 
new void Repaint (QRect arg1)
 
 
new void Repaint (QRegion arg1)
 
 
new void Repaint (int x, int y, int w, int h)
 
 
new void Resize (int w, int h)
 
new bool RestoreGeometry (QByteArray geometry)
 
 
new QByteArray SaveGeometry ()
 
 
new void Scroll (int dx, int dy)
 
 
new void Scroll (int dx, int dy, QRect arg3)
 
 
new void SetAttribute (Qt.WidgetAttribute arg1, bool on=true)
 
 
new void SetBaseSize (int basew, int baseh)
 
new void SetContentsMargins (int left, int top, int right, int bottom)
 
 
new void SetDisabled (bool arg1)
 
 
new void SetFixedHeight (int h)
 
 
new void SetFixedSize (QSize arg1)
 
 
new void SetFixedSize (int w, int h)
 
 
new void SetFixedWidth (int w)
 
 
new void SetFocus ()
 
 
new void SetFocus (Qt.FocusReason reason)
 
 
new void SetGeometry (int x, int y, int w, int h)
 
new void SetHidden (bool hidden)
 
 
new void SetInputMethodHints (Qt.InputMethodHint hints)
 
new void SetMask (QBitmap arg1)
 
 
new void SetMaximumSize (int maxw, int maxh)
 
new void SetMinimumSize (int minw, int minh)
 
new void SetParent (QWidget parent)
 
 
new void SetParent (QWidget parent, Qt.WindowType f)
 
 
new void SetShortcutAutoRepeat (int id, bool enable=true)
 
 
new void SetShortcutEnabled (int id, bool enable=true)
 
 
new void SetShown (bool shown)
 
new void SetSizeIncrement (int w, int h)
 
new void SetSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical)
 
virtual void SetVisible (bool visible)
 
new void Show ()
 
 
new void ShowFullScreen ()
 
 
new void ShowMaximized ()
 
 
new void ShowMinimized ()
 
 
new void ShowNormal ()
 
 
new void StackUnder (QWidget arg1)
 
 
new bool TestAttribute (Qt.WidgetAttribute arg1)
 
 
new QWidget TopLevelWidget ()
 
 
new bool UnderMouse ()
 
 
new void UngrabGesture (Qt.GestureType type)
 
 
new void UnsetCursor ()
 
new void UnsetLayoutDirection ()
 
new void UnsetLocale ()
 
new void Update ()
 
 
new void Update (QRect arg1)
 
 
new void Update (QRegion arg1)
 
 
new void Update (int x, int y, int w, int h)
 
 
new void UpdateGeometry ()
 
 
new QRegion VisibleRegion ()
 
 
new NativeULong WinId ()
 
 
new QWidget Window ()
 
 
new Qt.WindowType WindowType ()
 
 
new void Dispose ()
 
new int ColorCount ()
 
new int Depth ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
new int WidthMM ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
- Public Member Functions inherited from QtGui.IQPaintDevice
new int ColorCount ()
 
new int Depth ()
 
int DevType ()
 
System.IntPtr GetDC ()
 
new int Height ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
QPaintEngine PaintEngine ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
void ReleaseDC (System.IntPtr hdc)
 
new int Width ()
 
new int WidthMM ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtGui.QAbstractScrollArea
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtGui.QFrame
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtGui.QWidget
static QWidget Find (NativeULong arg1)
 
 
static QWidget KeyboardGrabber ()
 
 
static QWidget MouseGrabber ()
 
 
static void SetTabOrder (QWidget arg1, QWidget arg2)
 
 
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QTextEdit (System.Type dummy)
 
virtual bool CanInsertFromMimeData (QMimeData source)
 
 
override void OnChangeEvent (QEvent e)
 
 
override void OnContextMenuEvent (QContextMenuEvent e)
 
 
new void OnCopyAvailable (bool b)
 
 
virtual QMimeData CreateMimeDataFromSelection ()
 
 
new void OnCurrentCharFormatChanged (QTextCharFormat format)
 
 
new void OnCursorPositionChanged ()
 
 
override void OnDragEnterEvent (QDragEnterEvent e)
 
 
override void OnDragLeaveEvent (QDragLeaveEvent e)
 
 
override void OnDragMoveEvent (QDragMoveEvent e)
 
 
override void OnDropEvent (QDropEvent e)
 
 
override void OnFocusInEvent (QFocusEvent e)
 
 
override bool FocusNextPrevChild (bool next)
 
 
override void OnFocusOutEvent (QFocusEvent e)
 
 
override void OnInputMethodEvent (QInputMethodEvent arg1)
 
 
virtual void InsertFromMimeData (QMimeData source)
 
 
override void OnKeyPressEvent (QKeyEvent e)
 
 
override void OnKeyReleaseEvent (QKeyEvent e)
 
 
override void OnMouseDoubleClickEvent (QMouseEvent e)
 
 
override void OnMouseMoveEvent (QMouseEvent e)
 
 
override void OnMousePressEvent (QMouseEvent e)
 
 
override void OnMouseReleaseEvent (QMouseEvent e)
 
 
override void OnPaintEvent (QPaintEvent e)
 
 
new void OnRedoAvailable (bool b)
 
 
override void OnResizeEvent (QResizeEvent e)
 
 
override void ScrollContentsBy (int dx, int dy)
 
 
new void OnSelectionChanged ()
 
 
override void OnShowEvent (QShowEvent arg1)
 
 
new void OnTextChanged ()
 
 
override void OnTimerEvent (QTimerEvent e)
 
 
new void OnUndoAvailable (bool b)
 
 
override void OnWheelEvent (QWheelEvent e)
 
 
- Protected Member Functions inherited from QtGui.QAbstractScrollArea
 QAbstractScrollArea (System.Type dummy)
 
new void SetViewportMargins (QMargins margins)
 
 
new void SetViewportMargins (int left, int top, int right, int bottom)
 
 
new void SetupViewport (QWidget viewport)
 
 
virtual bool OnViewportEvent (QEvent arg1)
 
 
- Protected Member Functions inherited from QtGui.QFrame
 QFrame (System.Type dummy)
 
new void DrawFrame (QPainter arg1)
 
- Protected Member Functions inherited from QtGui.QWidget
 QWidget (System.Type dummy)
 
virtual void OnActionEvent (QActionEvent arg1)
 
 
virtual void OnCloseEvent (QCloseEvent arg1)
 
 
new void Create ()
 
 
new void Create (NativeULong arg1, bool initializeWindow=true, bool destroyOldWindow=true)
 
 
new void OnCustomContextMenuRequested (QPoint pos)
 
 
new void Destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
 
virtual void EnabledChange (bool arg1)
 
virtual void OnEnterEvent (QEvent arg1)
 
 
new bool FocusNextChild ()
 
 
new bool FocusPreviousChild ()
 
 
virtual void FontChange (QFont arg1)
 
virtual void OnHideEvent (QHideEvent arg1)
 
 
virtual void LanguageChange ()
 
 
virtual void OnLeaveEvent (QEvent arg1)
 
 
virtual int Metric (QPaintDevice.PaintDeviceMetric arg1)
 
 
virtual void OnMoveEvent (QMoveEvent arg1)
 
 
virtual void PaletteChange (QPalette arg1)
 
new void ResetInputContext ()
 
 
virtual void StyleChange (QStyle arg1)
 
virtual void OnTabletEvent (QTabletEvent arg1)
 
 
new void UpdateMicroFocus ()
 
 
virtual void WindowActivationChange (bool arg1)
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 

Properties

Slot TextChanged
 
 
Slot< System.Boolean > UndoAvailable
 
 
Slot< System.Boolean > RedoAvailable
 
 
Slot< QTextCharFormatCurrentCharFormatChanged
 
 
Slot< System.Boolean > CopyAvailable
 
 
Slot SelectionChanged
 
 
Slot CursorPositionChanged
 
 
Slot< QFontCurrentFontChanged
 
Slot< QColorCurrentColorChanged
 
new Qt.AlignmentFlag Alignment [get, set]
 
 
new QTextCharFormat CurrentCharFormat [get, set]
 
 
new QFont CurrentFont [get, set]
 
 
new QTextDocument Document [get, set]
 
 
new
System.Collections.Generic.List
< QTextEdit.ExtraSelection
ExtraSelections [get, set]
 
 
new string FontFamily [get, set]
 
 
new bool FontItalic [get, set]
 
 
new double FontPointSize [get, set]
 
 
new bool FontUnderline [get, set]
 
 
new int FontWeight [get, set]
 
 
new QColor TextBackgroundColor [get, set]
 
 
new QColor TextColor [get, set]
 
 
new QTextCursor TextCursor [get, set]
 
 
new QTextOption.WrapMode WordWrapMode [get, set]
 
new AutoFormattingFlag AutoFormatting [get, set]
 
 
new bool TabChangesFocus [get, set]
 
 
new string DocumentTitle [get, set]
 
 
new bool UndoRedoEnabled [get, set]
 
 
new LineWrapMode lineWrapMode [get, set]
 
 
new int LineWrapColumnOrWidth [get, set]
 
 
new bool ReadOnly [get, set]
 
 
new string Html [get, set]
 
 
new string PlainText [get, set]
 
 
new bool OverwriteMode [get, set]
 
 
new int TabStopWidth [get, set]
 
 
new bool AcceptRichText [get, set]
 
 
new int CursorWidth [get, set]
 
 
new Qt.TextInteractionFlag TextInteractionFlags [get, set]
 
static new QMetaObject StaticMetaObject [get]
 
new IQTextEditSignals Emit [get]
 
- Properties inherited from QtGui.QAbstractScrollArea
virtual EventHandler
< QEventArgs< QEvent > > 
ViewportEvent
 
 
new QWidget CornerWidget [get, set]
 
 
new QScrollBar HorizontalScrollBar [get, set]
 
 
new QScrollBar VerticalScrollBar [get, set]
 
 
new QWidget Viewport [get, set]
 
 
override EventHandler
< QEventArgs< QPaintEvent > > 
PaintEvent
 
 
override EventHandler
< QEventArgs< QActionEvent > > 
ActionEvent
 
 
override EventHandler
< QEventArgs< QEvent > > 
ChangeEvent
 
 
override EventHandler
< QEventArgs< QCloseEvent > > 
CloseEvent
 
 
override EventHandler
< QEventArgs
< QContextMenuEvent > > 
ContextMenuEvent
 
 
override EventHandler
< QEventArgs< QDragEnterEvent > > 
DragEnterEvent
 
 
override EventHandler
< QEventArgs< QDragLeaveEvent > > 
DragLeaveEvent
 
 
override EventHandler
< QEventArgs< QDragMoveEvent > > 
DragMoveEvent
 
 
override EventHandler
< QEventArgs< QDropEvent > > 
DropEvent
 
 
override EventHandler
< QEventArgs< QEvent > > 
EnterEvent
 
 
override EventHandler
< QEventArgs< QFocusEvent > > 
FocusInEvent
 
 
override EventHandler
< QEventArgs< QFocusEvent > > 
FocusOutEvent
 
 
override EventHandler
< QEventArgs< QHideEvent > > 
HideEvent
 
 
override EventHandler
< QEventArgs
< QInputMethodEvent > > 
InputMethodEvent
 
 
override EventHandler
< QEventArgs< QKeyEvent > > 
KeyPressEvent
 
 
override EventHandler
< QEventArgs< QKeyEvent > > 
KeyReleaseEvent
 
 
override EventHandler
< QEventArgs< QEvent > > 
LeaveEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MouseDoubleClickEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MouseMoveEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MousePressEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MouseReleaseEvent
 
 
override EventHandler
< QEventArgs< QMoveEvent > > 
MoveEvent
 
 
override EventHandler
< QEventArgs< QResizeEvent > > 
ResizeEvent
 
 
override EventHandler
< QEventArgs< QShowEvent > > 
ShowEvent
 
 
override EventHandler
< QEventArgs< QTabletEvent > > 
TabletEvent
 
 
override EventHandler
< QEventArgs< QWheelEvent > > 
WheelEvent
 
 
new Qt.ScrollBarPolicy VerticalScrollBarPolicy [get, set]
 
 
new Qt.ScrollBarPolicy HorizontalScrollBarPolicy [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractScrollAreaSignals Emit [get]
 
- Properties inherited from QtGui.QFrame
new int FrameStyle [get, set]
 
 
new Shape FrameShape [get, set]
 
 
new Shadow FrameShadow [get, set]
 
 
new int LineWidth [get, set]
 
 
new int MidLineWidth [get, set]
 
 
new int FrameWidth [get]
 
 
new QRect FrameRect [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQFrameSignals Emit [get]
 
- Properties inherited from QtGui.QWidget
virtual EventHandler
< QEventArgs< QActionEvent > > 
ActionEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
ChangeEvent
 
 
virtual EventHandler
< QEventArgs< QCloseEvent > > 
CloseEvent
 
 
virtual EventHandler
< QEventArgs
< QContextMenuEvent > > 
ContextMenuEvent
 
 
virtual EventHandler
< QEventArgs< QDragEnterEvent > > 
DragEnterEvent
 
 
virtual EventHandler
< QEventArgs< QDragLeaveEvent > > 
DragLeaveEvent
 
 
virtual EventHandler
< QEventArgs< QDragMoveEvent > > 
DragMoveEvent
 
 
virtual EventHandler
< QEventArgs< QDropEvent > > 
DropEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
EnterEvent
 
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusInEvent
 
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusOutEvent
 
 
virtual EventHandler
< QEventArgs< QHideEvent > > 
HideEvent
 
 
virtual EventHandler
< QEventArgs
< QInputMethodEvent > > 
InputMethodEvent
 
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyPressEvent
 
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyReleaseEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
LeaveEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseDoubleClickEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseMoveEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MousePressEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseReleaseEvent
 
 
virtual EventHandler
< QEventArgs< QMoveEvent > > 
MoveEvent
 
 
virtual EventHandler
< QEventArgs< QPaintEvent > > 
PaintEvent
 
 
virtual EventHandler
< QEventArgs< QResizeEvent > > 
ResizeEvent
 
 
virtual EventHandler
< QEventArgs< QShowEvent > > 
ShowEvent
 
 
virtual EventHandler
< QEventArgs< QTabletEvent > > 
TabletEvent
 
 
virtual EventHandler
< QEventArgs< QWheelEvent > > 
WheelEvent
 
 
Slot< QPointCustomContextMenuRequested
 
 
new QPalette.ColorRole BackgroundRole [get, set]
 
 
new QMargins ContentsMargins [get, set]
 
 
new QWidget FocusProxy [get, set]
 
 
new QPalette.ColorRole ForegroundRole [get, set]
 
 
new QGraphicsEffect GraphicsEffect [get, set]
 
 
new QInputContext InputContext [get, set]
 
 
new QLayout Layout [get, set]
 
 
new QRegion Mask [get, set]
 
 
new QStyle Style [get, set]
 
 
new Qt.WindowType WindowFlags [get, set]
 
new string WindowRole [get, set]
 
 
new Qt.WindowState WindowState [get, set]
 
 
new bool Modal [get]
 
 
new Qt.WindowModality WindowModality [get, set]
 
 
new bool Enabled [get, set]
 
 
new QRect Geometry [get, set]
 
 
new QRect FrameGeometry [get]
 
 
new QRect NormalGeometry [get]
 
 
new int X [get]
 
 
new int Y [get]
 
 
new QPoint Pos [get, set]
 
 
new QSize FrameSize [get]
 
 
new QSize Size [get, set]
 
 
new int Width [get]
 
 
new int Height [get]
 
 
new QRect Rect [get]
 
 
new QRect ChildrenRect [get]
 
 
new QRegion ChildrenRegion [get]
 
 
new QSizePolicy SizePolicy [get, set]
 
 
new QSize MinimumSize [get, set]
 
 
new QSize MaximumSize [get, set]
 
 
new int MinimumWidth [get, set]
 
 
new int MinimumHeight [get, set]
 
 
new int MaximumWidth [get, set]
 
 
new int MaximumHeight [get, set]
 
 
new QSize SizeIncrement [get, set]
 
 
new QSize BaseSize [get, set]
 
 
new QPalette Palette [get, set]
 
 
new QFont Font [get, set]
 
 
new QCursor Cursor [get, set]
 
 
new bool MouseTracking [get, set]
 
 
new bool IsActiveWindow [get]
 
 
new Qt.FocusPolicy FocusPolicy [get, set]
 
 
new bool Focus [get]
 
 
new Qt.ContextMenuPolicy ContextMenuPolicy [get, set]
 
 
new bool UpdatesEnabled [get, set]
 
 
new bool Visible [get, set]
 
 
new bool Minimized [get]
 
 
new bool Maximized [get]
 
 
new bool FullScreen [get]
 
 
new bool AcceptDrops [get, set]
 
 
new string WindowTitle [get, set]
 
 
new QIcon WindowIcon [get, set]
 
 
new string WindowIconText [get, set]
 
 
new double WindowOpacity [get, set]
 
 
new bool WindowModified [get, set]
 
 
new string ToolTip [get, set]
 
 
new string StatusTip [get, set]
 
 
new string WhatsThis [get, set]
 
 
new string AccessibleName [get, set]
 
 
new string AccessibleDescription [get, set]
 
 
new Qt.LayoutDirection LayoutDirection [get, set]
 
 
new bool AutoFillBackground [get, set]
 
 
new string StyleSheet [get, set]
 
 
new QLocale Locale [get, set]
 
 
new string WindowFilePath [get, set]
 
 
new Qt.InputMethodHint InputMethodHints [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new ushort Painters [get, set]
 
new IQWidgetSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QTextEdit class provides a widget that is used to edit and display both plain and rich text.

Introduction and Concepts

QTextEdit is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond quickly to user input.

QTextEdit works on paragraphs and characters. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. By default when reading plain text, one newline signifies a paragraph. A document consists of zero or more paragraphs. The words in the paragraph are aligned in accordance with the paragraph's alignment. Paragraphs are separated by hard line breaks. Each character within a paragraph has its own attributes, for example, font and color.

QTextEdit can display images, lists and tables. If the text is too large to view within the text edit's viewport, scroll bars will appear. The text edit can load both plain text and HTML files (a subset of HTML 3.2 and 4).

If you just need to display a small piece of rich text use QLabel.

The rich text support in Qt is designed to provide a fast, portable and efficient way to add reasonable online help facilities to applications, and to provide a basis for rich text editors. If you find the HTML support insufficient for your needs you may consider the use of QtWebKit, which provides a full-featured web browser widget.

The shape of the mouse cursor on a QTextEdit is Qt::IBeamCursor by default. It can be changed through the viewport()'s cursor property.

Using QTextEdit as a Display Widget

QTextEdit can display a large HTML subset, including tables and images.

The text is set or replaced using setHtml() which deletes any existing text and replaces it with the text passed in the setHtml() call. If you call setHtml() with legacy HTML, and then call toHtml(), the text that is returned may have different markup, but will render the same. The entire text can be deleted with clear().

Text itself can be inserted using the QTextCursor class or using the convenience functions insertHtml(), insertPlainText(), append() or paste(). QTextCursor is also able to insert complex objects like tables or lists into the document, and it deals with creating selections and applying changes to selected text.

By default the text edit wraps words at whitespace to fit within the text edit widget. The setLineWrapMode() function is used to specify the kind of line wrap you want, or NoWrap if you don't want any wrapping. Call setLineWrapMode() to set a fixed pixel width FixedPixelWidth, or character column (e.g. 80 column) FixedColumnWidth with the pixels or columns specified with setLineWrapColumnOrWidth(). If you use word wrap to the widget's width WidgetWidth, you can specify whether to break on whitespace or anywhere with setWordWrapMode().

The find() function can be used to find and select a given string within the text.

If you want to limit the total number of paragraphs in a QTextEdit, as for example it is often useful in a log viewer, then you can use QTextDocument's maximumBlockCount property for that.

Read-only Key Bindings

When QTextEdit is used read-only the key bindings are limited to navigation, and text may only be selected with the mouse:

KeypressesAction

Up Moves one line up.

Down Moves one line down.

Left Moves one character to the left.

Right Moves one character to the right.

PageUp Moves one (viewport) page up.

PageDown Moves one (viewport) page down.

Home Moves to the beginning of the text.

End Moves to the end of the text.

Alt+Wheel Scrolls the page horizontally (the Wheel is the mouse wheel).

Ctrl+Wheel Zooms the text.

Ctrl+A Selects all text.

The text edit may be able to provide some meta-information. For example, the documentTitle() function will return the text from within HTML <title> tags.

Using QTextEdit as an Editor

All the information about using QTextEdit as a display widget also applies here.

The current char format's attributes are set with setFontItalic(), setFontWeight(), setFontUnderline(), setFontFamily(), setFontPointSize(), setTextColor() and setCurrentFont(). The current paragraph's alignment is set with setAlignment().

Selection of text is handled by the QTextCursor class, which provides functionality for creating selections, retrieving the text contents or deleting selections. You can retrieve the object that corresponds with the user-visible cursor using the textCursor() method. If you want to set a selection in QTextEdit just create one on a QTextCursor object and then make that cursor the visible cursor using setTextCursor(). The selection can be copied to the clipboard with copy(), or cut to the clipboard with cut(). The entire text can be selected using selectAll().

When the cursor is moved and the underlying formatting attributes change, the currentCharFormatChanged() signal is emitted to reflect the new attributes at the new cursor position.

QTextEdit holds a QTextDocument object which can be retrieved using the document() method. You can also set your own document object using setDocument(). QTextDocument emits a textChanged() signal if the text changes and it also provides a isModified() function which will return true if the text has been modified since it was either loaded or since the last call to setModified with false as argument. In addition it provides methods for undo and redo.

Drag and Drop

QTextEdit also supports custom drag and drop behavior. By default, QTextEdit will insert plain text, HTML and rich text when the user drops data of these MIME types onto a document. Reimplement canInsertFromMimeData() and insertFromMimeData() to add support for additional MIME types.

For example, to allow the user to drag and drop an image onto a QTextEdit, you could the implement these functions in the following way:

bool TextEdit::canInsertFromMimeData( const QMimeData *source ) const

{

if (source->hasImage())

return true;

else

return QTextEdit::canInsertFromMimeData(source);

}

We add support for image MIME types by returning true. For all other MIME types, we use the default implementation.

void TextEdit::insertFromMimeData( const QMimeData *source )

{

if (source->hasImage())

{

QImage image = qvariant_cast<QImage>(source->imageData());

QTextCursor cursor = this->textCursor();

QTextDocument *document = this->document();

document->addResource(QTextDocument::ImageResource, QUrl("image"), image);

cursor.insertImage("image");

}

}

We unpack the image from the QVariant held by the MIME source and insert it into the document as a resource.

Editing Key Bindings

The list of key bindings which are implemented for editing:

KeypressesAction

Backspace Deletes the character to the left of the cursor.

Delete Deletes the character to the right of the cursor.

Ctrl+C Copy the selected text to the clipboard.

Ctrl+Insert Copy the selected text to the clipboard.

Ctrl+K Deletes to the end of the line.

Ctrl+V Pastes the clipboard text into text edit.

Shift+Insert Pastes the clipboard text into text edit.

Ctrl+X Deletes the selected text and copies it to the clipboard.

Shift+Delete Deletes the selected text and copies it to the clipboard.

Ctrl+Z Undoes the last operation.

Ctrl+Y Redoes the last operation.

Left Moves the cursor one character to the left.

Ctrl+Left Moves the cursor one word to the left.

Right Moves the cursor one character to the right.

Ctrl+Right Moves the cursor one word to the right.

Up Moves the cursor one line up.

Down Moves the cursor one line down.

PageUp Moves the cursor one page up.

PageDown Moves the cursor one page down.

Home Moves the cursor to the beginning of the line.

Ctrl+Home Moves the cursor to the beginning of the text.

End Moves the cursor to the end of the line.

Ctrl+End Moves the cursor to the end of the text.

Alt+Wheel Scrolls the page horizontally (the Wheel is the mouse wheel).

To select (mark) text hold down the Shift key whilst pressing one of the movement keystrokes, for example, Shift+Right will select the character to the right, and Shift+Ctrl+Right will select the word to the right, etc.

See also QTextDocument, QTextCursor, Application Example, Syntax Highlighter Example, and Rich Text Processing.

Member Enumeration Documentation

Enumerator:
AutoAll 

Apply all automatic formatting. Currently only automatic bullet lists are supported.

AutoBulletList 

Automatically create bullet lists (e.g. when the user enters an asterisk ('*') in the left most column, or presses Enter in an existing list item.

AutoNone 

Don't do any automatic formatting.

Enumerator:
FixedColumnWidth 
FixedPixelWidth 
NoWrap 
WidgetWidth 

Constructor & Destructor Documentation

QtGui.QTextEdit.QTextEdit ( System.Type  dummy)
protected
QtGui.QTextEdit.QTextEdit ( QWidget  parent = null)

Constructs an empty QTextEdit with parent parent.

QtGui.QTextEdit.QTextEdit ( string  text,
QWidget  parent = null 
)

Constructs a QTextEdit with parent parent. The text edit will display the text text. The text is interpreted as html.

Member Function Documentation

new string QtGui.QTextEdit.AnchorAt ( QPoint  pos)

Returns the reference of the anchor at position pos, or an empty string if no anchor exists at that point.

new void QtGui.QTextEdit.Append ( string  text)

Appends a new paragraph with text to the end of the text edit.

Note: The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor.

See also currentCharFormat() and QTextCursor::blockFormat().

new QTextEdit.AutoFormattingFlag QtGui.QTextEdit.autoFormatting ( )
virtual bool QtGui.QTextEdit.CanInsertFromMimeData ( QMimeData  source)
protectedvirtual

This function returns true if the contents of the MIME data object, specified by source, can be decoded and inserted into the document. It is called for example when during a drag operation the mouse enters this widget and it is necessary to determine whether it is possible to accept the drag and drop operation.

Reimplement this function to enable drag and drop support for additional MIME types.

new bool QtGui.QTextEdit.CanPaste ( )

Returns whether text can be pasted from the clipboard into the textedit.

This function was introduced in Qt 4.2.

new void QtGui.QTextEdit.Clear ( )

Deletes all the text in the text edit.

Note that the undo/redo history is cleared by this function.

See also cut(), setPlainText(), and setHtml().

new void QtGui.QTextEdit.Copy ( )

Copies any selected text to the clipboard.

See also copyAvailable().

virtual QMimeData QtGui.QTextEdit.CreateMimeDataFromSelection ( )
protectedvirtual

This function returns a new MIME data object to represent the contents of the text edit's current selection. It is called when the selection needs to be encapsulated into a new QMimeData object; for example, when a drag and drop operation is started, or when data is copyied to the clipboard.

If you reimplement this function, note that the ownership of the returned QMimeData object is passed to the caller. The selection can be retrieved by using the textCursor() function.

override void QtGui.QTextEdit.CreateProxy ( )
virtual

Reimplemented from QtGui.QAbstractScrollArea.

new QMenu QtGui.QTextEdit.CreateStandardContextMenu ( )

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler. The popup menu's ownership is transferred to the caller.

We recommend that you use the createStandardContextMenu(QPoint) version instead which will enable the actions that are sensitive to where the user clicked.

new QMenu QtGui.QTextEdit.CreateStandardContextMenu ( QPoint  position)

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler and it takes the position of where the mouse click was. This can enable actions that are sensitive to the position where the user clicked. The popup menu's ownership is transferred to the caller.

This function was introduced in Qt 4.4.

new QTextCursor QtGui.QTextEdit.CursorForPosition ( QPoint  pos)

returns a QTextCursor at position pos (in viewport coordinates).

new QRect QtGui.QTextEdit.CursorRect ( )

returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.

new QRect QtGui.QTextEdit.CursorRect ( QTextCursor  cursor)

returns a rectangle (in viewport coordinates) that includes the cursor.

new void QtGui.QTextEdit.Cut ( )

Copies the selected text to the clipboard and deletes it from the text edit.

If there is no selected text nothing happens.

See also copy() and paste().

new void QtGui.QTextEdit.Dispose ( )
new void QtGui.QTextEdit.EnsureCursorVisible ( )

Ensures that the cursor is visible by scrolling the text edit if necessary.

new bool QtGui.QTextEdit.Find ( string  exp,
QTextDocument.FindFlag  options = 0 
)

Finds the next occurrence of the string, exp, using the given options. Returns true if exp was found and changes the cursor to select the match; otherwise returns false.

override bool QtGui.QTextEdit.FocusNextPrevChild ( bool  next)
protectedvirtual

Reimplemented from QWidget::focusNextPrevChild().

Reimplemented from QtGui.QWidget.

override object QtGui.QTextEdit.InputMethodQuery ( Qt.InputMethodQuery  property)
virtual

Reimplemented from QWidget::inputMethodQuery().

Reimplemented from QtGui.QWidget.

virtual void QtGui.QTextEdit.InsertFromMimeData ( QMimeData  source)
protectedvirtual

This function inserts the contents of the MIME data object, specified by source, into the text edit at the current cursor position. It is called whenever text is inserted as the result of a clipboard paste operation, or when the text edit accepts data from a drag and drop operation.

Reimplement this function to enable drag and drop support for additional MIME types.

new void QtGui.QTextEdit.InsertHtml ( string  text)

Convenience slot that inserts text which is assumed to be of html formatting at the current cursor position.

It is equivalent to:

edit->textCursor().insertHtml(fragment);

Note: When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style sheet throughout a document, use QTextDocument::setDefaultStyleSheet() instead.

new void QtGui.QTextEdit.InsertPlainText ( string  text)

Convenience slot that inserts text at the current cursor position.

It is equivalent to

edit->textCursor().insertText(text);

virtual object QtGui.QTextEdit.LoadResource ( int  type,
QUrl  name 
)
virtual

Loads the resource specified by the given type and name.

This function is an extension of QTextDocument::loadResource().

See also QTextDocument::loadResource().

Reimplemented in QtGui.QTextBrowser.

new void QtGui.QTextEdit.MergeCurrentCharFormat ( QTextCharFormat  modifier)

Merges the properties specified in modifier into the current character format by calling QTextCursor::mergeCharFormat on the editor's cursor. If the editor has a selection then the properties of modifier are directly applied to the selection.

See also QTextCursor::mergeCharFormat().

new void QtGui.QTextEdit.MoveCursor ( QTextCursor.MoveOperation  operation,
QTextCursor.MoveMode  mode = QTextCursor.MoveMode.MoveAnchor 
)

Moves the cursor by performing the given operation.

If mode is QTextCursor::KeepAnchor, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.

This function was introduced in Qt 4.2.

See also QTextCursor::movePosition().

override void QtGui.QTextEdit.OnChangeEvent ( QEvent  e)
protectedvirtual

Reimplemented from QWidget::changeEvent().

Reimplemented from QtGui.QFrame.

override void QtGui.QTextEdit.OnContextMenuEvent ( QContextMenuEvent  e)
protectedvirtual

Reimplemented from QWidget::contextMenuEvent().

Shows the standard context menu created with createStandardContextMenu().

If you do not want the text edit to have a context menu, you can set its contextMenuPolicy to Qt::NoContextMenu. If you want to customize the context menu, reimplement this function. If you want to extend the standard context menu, reimplement this function, call createStandardContextMenu() and extend the menu returned.

Information about the event is passed in the event object.

void MyTextEdit::contextMenuEvent(QContextMenuEvent *event)

{

QMenu *menu = createStandardContextMenu();

menu->addAction(tr("My Menu Item"));

//...

menu->exec(event->globalPos());

delete menu;

}

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QTextEdit.OnCopyAvailable ( bool  b)
protected

This signal is emitted when text is selected or de-selected in the text edit.

When text is selected this signal will be emitted with yes set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with yes set to false.

If yes is true then copy() can be used to copy the selection to the clipboard. If yes is false then copy() does nothing.

See also selectionChanged().

new void QtGui.QTextEdit.OnCurrentCharFormatChanged ( QTextCharFormat  format)
protected

This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.

The new format is f.

See also setCurrentCharFormat().

new void QtGui.QTextEdit.OnCursorPositionChanged ( )
protected

This signal is emitted whenever the position of the cursor changed.

override void QtGui.QTextEdit.OnDragEnterEvent ( QDragEnterEvent  e)
protectedvirtual

Reimplemented from QWidget::dragEnterEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnDragLeaveEvent ( QDragLeaveEvent  e)
protectedvirtual

Reimplemented from QWidget::dragLeaveEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnDragMoveEvent ( QDragMoveEvent  e)
protectedvirtual

Reimplemented from QWidget::dragMoveEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnDropEvent ( QDropEvent  e)
protectedvirtual

Reimplemented from QWidget::dropEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override bool QtGui.QTextEdit.OnEvent ( QEvent  arg1)
virtual

Reimplemented from QObject::event().

This is the main event handler for the QAbstractScrollArea widget (not the scrolling area viewport()). The specified event is a general event object that may need to be cast to the appropriate class depending on its type.

See also QEvent::type().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnFocusInEvent ( QFocusEvent  e)
protectedvirtual

Reimplemented from QWidget::focusInEvent().

Reimplemented from QtGui.QWidget.

override void QtGui.QTextEdit.OnFocusOutEvent ( QFocusEvent  e)
protectedvirtual

Reimplemented from QWidget::focusOutEvent().

Reimplemented from QtGui.QWidget.

override void QtGui.QTextEdit.OnInputMethodEvent ( QInputMethodEvent  arg1)
protectedvirtual

Reimplemented from QWidget::inputMethodEvent().

Reimplemented from QtGui.QWidget.

override void QtGui.QTextEdit.OnKeyPressEvent ( QKeyEvent  e)
protectedvirtual

Reimplemented from QWidget::keyPressEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnKeyReleaseEvent ( QKeyEvent  e)
protectedvirtual

Reimplemented from QWidget::keyReleaseEvent().

Reimplemented from QtGui.QWidget.

override void QtGui.QTextEdit.OnMouseDoubleClickEvent ( QMouseEvent  e)
protectedvirtual

Reimplemented from QWidget::mouseDoubleClickEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnMouseMoveEvent ( QMouseEvent  e)
protectedvirtual

Reimplemented from QWidget::mouseMoveEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnMousePressEvent ( QMouseEvent  e)
protectedvirtual

Reimplemented from QWidget::mousePressEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnMouseReleaseEvent ( QMouseEvent  e)
protectedvirtual

Reimplemented from QWidget::mouseReleaseEvent().

Reimplemented from QtGui.QAbstractScrollArea.

override void QtGui.QTextEdit.OnPaintEvent ( QPaintEvent  e)
protectedvirtual

Reimplemented from QWidget::paintEvent().

This event handler can be reimplemented in a subclass to receive paint events passed in event. It is usually unnecessary to reimplement this function in a subclass of QTextEdit.

Warning: The underlying text document must not be modified from within a reimplementation of this function.

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QTextEdit.OnRedoAvailable ( bool  b)
protected

This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false).

override void QtGui.QTextEdit.OnResizeEvent ( QResizeEvent  e)
protectedvirtual

Reimplemented from QWidget::resizeEvent().

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QTextEdit.OnSelectionChanged ( )
protected

This signal is emitted whenever the selection changes.

See also copyAvailable().

override void QtGui.QTextEdit.OnShowEvent ( QShowEvent  arg1)
protectedvirtual

Reimplemented from QWidget::showEvent().

Reimplemented from QtGui.QWidget.

new void QtGui.QTextEdit.OnTextChanged ( )
protected

This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.

override void QtGui.QTextEdit.OnTimerEvent ( QTimerEvent  arg1)
protectedvirtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also startTimer(), killTimer(), and event().

Reimplemented from QtCore.QObject.

new void QtGui.QTextEdit.OnUndoAvailable ( bool  b)
protected

This signal is emitted whenever undo operations become available (available is true) or unavailable (available is false).

override void QtGui.QTextEdit.OnWheelEvent ( QWheelEvent  e)
protectedvirtual

Reimplemented from QWidget::wheelEvent().

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QTextEdit.Paste ( )

Pastes the text from the clipboard into the text edit at the current cursor position.

If there is no text in the clipboard nothing happens.

To change the behavior of this function, i.e. to modify what QTextEdit can paste and how it is being pasted, reimplement the virtual canInsertFromMimeData() and insertFromMimeData() functions.

See also cut() and copy().

new void QtGui.QTextEdit.Print ( QPrinter  printer)

Convenience function to print the text edit's document to the given printer. This is equivalent to calling the print method on the document directly except that this function also supports QPrinter::Selection as print range.

This function was introduced in Qt 4.3.

See also QTextDocument::print().

new void QtGui.QTextEdit.Redo ( )

Redoes the last operation.

If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.

This function was introduced in Qt 4.2.

See also undo().

override void QtGui.QTextEdit.ScrollContentsBy ( int  dx,
int  dy 
)
protectedvirtual

Reimplemented from QAbstractScrollArea::scrollContentsBy().

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QTextEdit.ScrollToAnchor ( string  name)

Scrolls the text edit so that the anchor with the given name is visible; does nothing if the name is empty, or is already visible, or isn't found.

new void QtGui.QTextEdit.SelectAll ( )

Selects all text.

See also copy(), cut(), and textCursor().

new void QtGui.QTextEdit.SetAutoFormatting ( QTextEdit.AutoFormattingFlag  features)
new void QtGui.QTextEdit.SetText ( string  text)

Sets the text edit's text. The text can be plain text or HTML and the text edit will try to guess the right format.

Use setHtml() or setPlainText() directly to avoid text edit's guessing.

This function was introduced in Qt 4.2.

See also text(), toPlainText(), and toHtml().

new void QtGui.QTextEdit.SetTextInteractionFlags ( Qt.TextInteractionFlag  flags)
new Qt.TextInteractionFlag QtGui.QTextEdit.textInteractionFlags ( )
static string QtGui.QTextEdit.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QTextEdit.Tr ( string  s,
string  c,
int  n 
)
static
static string QtGui.QTextEdit.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QTextEdit.TrUtf8 ( string  s,
string  c,
int  n 
)
static
new void QtGui.QTextEdit.Undo ( )

Undoes the last operation.

If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.

This function was introduced in Qt 4.2.

See also redo().

new void QtGui.QTextEdit.ZoomIn ( int  range = 1)

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomOut().

new void QtGui.QTextEdit.ZoomOut ( int  range = 1)

This is an overloaded function.

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomIn().

Property Documentation

new bool QtGui.QTextEdit.AcceptRichText
getset

This property holds whether the text edit accepts rich text insertions by the user.

When this propery is set to false text edit will accept only plain text input from the user. For example through clipboard or drag and drop.

This property's default is true.

This property was introduced in Qt 4.1.

new Qt.AlignmentFlag QtGui.QTextEdit.Alignment
getset

Returns the alignment of the current paragraph.

Sets the alignment of the current paragraph to a. Valid alignments are Qt::AlignLeft, Qt::AlignRight, Qt::AlignJustify and Qt::AlignCenter (which centers horizontally).

new AutoFormattingFlag QtGui.QTextEdit.AutoFormatting
getset

This property holds the enabled set of auto formatting features.

The value can be any combination of the values in the AutoFormattingFlag enum. The default is AutoNone. Choose AutoAll to enable all automatic formatting.

Currently, the only automatic formatting feature provided is AutoBulletList; future versions of Qt may offer more.

Slot<System.Boolean> QtGui.QTextEdit.CopyAvailable
addremove

This signal is emitted when text is selected or de-selected in the text edit.

When text is selected this signal will be emitted with yes set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with yes set to false.

If yes is true then copy() can be used to copy the selection to the clipboard. If yes is false then copy() does nothing.

See also selectionChanged().

new QTextCharFormat QtGui.QTextEdit.CurrentCharFormat
getset

Returns the char format that is used when inserting new text.

Sets the char format that is be used when inserting new text to format by calling QTextCursor::setCharFormat() on the editor's cursor. If the editor has a selection then the char format is directly applied to the selection.

Slot<QTextCharFormat> QtGui.QTextEdit.CurrentCharFormatChanged
addremove

This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.

The new format is f.

See also setCurrentCharFormat().

Slot<QColor> QtGui.QTextEdit.CurrentColorChanged
addremove
new QFont QtGui.QTextEdit.CurrentFont
getset

Returns the font of the current format.

Sets the font of the current format to f.

Slot<QFont> QtGui.QTextEdit.CurrentFontChanged
addremove
Slot QtGui.QTextEdit.CursorPositionChanged
addremove

This signal is emitted whenever the position of the cursor changed.

new int QtGui.QTextEdit.CursorWidth
getset

This property specifies the width of the cursor in pixels. The default value is 1.

This property was introduced in Qt 4.2.

new QTextDocument QtGui.QTextEdit.Document
getset

Returns a pointer to the underlying document.

Makes document the new document of the text editor.

Note: The editor does not take ownership of the document unless it is the document's parent object. The parent object of the provided document remains the owner of the object.

The editor does not delete the current document, even if it is a child of the editor.

new string QtGui.QTextEdit.DocumentTitle
getset

This property holds the title of the document parsed from the text.

By default, for a newly-created, empty document, this property contains an empty string.

new IQTextEditSignals QtGui.QTextEdit.Emit
getprotected
new System.Collections.Generic.List<QTextEdit.ExtraSelection> QtGui.QTextEdit.ExtraSelections
getset

Returns previously set extra selections.

This function was introduced in Qt 4.2.

This function allows temporarily marking certain regions in the document with a given color, specified as selections. This can be useful for example in a programming editor to mark a whole line of text with a given background color to indicate the existence of a breakpoint.

This function was introduced in Qt 4.2.

new string QtGui.QTextEdit.FontFamily
getset

Returns the font family of the current format.

Sets the font family of the current format to fontFamily.

new bool QtGui.QTextEdit.FontItalic
getset

Returns true if the font of the current format is italic; otherwise returns false.

If italic is true, sets the current format to italic; otherwise sets the current format to non-italic.

new double QtGui.QTextEdit.FontPointSize
getset

Returns the point size of the font of the current format.

Sets the point size of the current format to s.

Note that if s is zero or negative, the behavior of this function is not defined.

new bool QtGui.QTextEdit.FontUnderline
getset

Returns true if the font of the current format is underlined; otherwise returns false.

If underline is true, sets the current format to underline; otherwise sets the current format to non-underline.

new int QtGui.QTextEdit.FontWeight
getset

Returns the font weight of the current format.

Sets the font weight of the current format to the given weight, where the value used is in the range defined by the QFont::Weight enum.

new string QtGui.QTextEdit.Html
getset

This property provides an HTML interface to the text of the text edit.

toHtml() returns the text of the text edit as html.

setHtml() changes the text of the text edit. Any previous text is removed and the undo/redo history is cleared. The input text is interpreted as rich text in html format.

Note: It is the responsibility of the caller to make sure that the text is correctly decoded when a QString containing HTML is created and passed to setHtml().

By default, for a newly-created, empty document, this property contains text to describe an HTML 4.0 document with no body text.

new int QtGui.QTextEdit.LineWrapColumnOrWidth
getset

This property holds the position (in pixels or columns depending on the wrap mode) where text will be wrapped.

If the wrap mode is FixedPixelWidth, the value is the number of pixels from the left edge of the text edit at which text should be wrapped. If the wrap mode is FixedColumnWidth, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped.

By default, this property contains a value of 0.

new LineWrapMode QtGui.QTextEdit.lineWrapMode
getset

This property holds the line wrap mode.

The default mode is WidgetWidth which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use setWordWrapMode(). If you set a wrap mode of FixedPixelWidth or FixedColumnWidth you should also call setLineWrapColumnOrWidth() with the width you want.

new bool QtGui.QTextEdit.OverwriteMode
getset

This property holds whether text entered by the user will overwrite existing text.

As with many text editors, the text editor widget can be configured to insert or overwrite existing text with new text entered by the user.

If this property is true, existing text is overwritten, character-for-character by new text; otherwise, text is inserted at the cursor position, displacing existing text.

By default, this property is false (new text does not overwrite existing text).

This property was introduced in Qt 4.1.

new string QtGui.QTextEdit.PlainText
getset

This property gets and sets the text editor's contents as plain text. Previous contents are removed and undo/redo history is reset when the property is set.

If the text edit has another content type, it will not be replaced by plain text if you call toPlainText(). The only exception to this is the non-break space, nbsp;, that will be converted into standard space.

By default, for an editor with no contents, this property contains an empty string.

This property was introduced in Qt 4.3.

new bool QtGui.QTextEdit.ReadOnly
getset

This property holds whether the text edit is read-only.

In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.

This property's default is false.

Slot<System.Boolean> QtGui.QTextEdit.RedoAvailable
addremove

This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false).

Slot QtGui.QTextEdit.SelectionChanged
addremove

This signal is emitted whenever the selection changes.

See also copyAvailable().

new QMetaObject QtGui.QTextEdit.StaticMetaObject
staticget
new bool QtGui.QTextEdit.TabChangesFocus
getset

This property holds whether Tab changes focus or is accepted as input.

In some occasions text edits should not allow the user to input tabulators or change indentation using the Tab key, as this breaks the focus chain. The default is false.

new int QtGui.QTextEdit.TabStopWidth
getset

This property holds the tab stop width in pixels.

By default, this property contains a value of 80 pixels.

This property was introduced in Qt 4.1.

new QColor QtGui.QTextEdit.TextBackgroundColor
getset

Returns the text background color of the current format.

This function was introduced in Qt 4.4.

Sets the text background color of the current format to c.

This function was introduced in Qt 4.4.

Slot QtGui.QTextEdit.TextChanged
addremove

This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.

new QColor QtGui.QTextEdit.TextColor
getset

Returns the text color of the current format.

Sets the text color of the current format to c.

new QTextCursor QtGui.QTextEdit.TextCursor
getset

Returns a copy of the QTextCursor that represents the currently visible cursor. Note that changes on the returned cursor do not affect QTextEdit's cursor; use setTextCursor() to update the visible cursor.

Sets the visible cursor.

new Qt.TextInteractionFlag QtGui.QTextEdit.TextInteractionFlags
getset
Slot<System.Boolean> QtGui.QTextEdit.UndoAvailable
addremove

This signal is emitted whenever undo operations become available (available is true) or unavailable (available is false).

new bool QtGui.QTextEdit.UndoRedoEnabled
getset

This property holds whether undo and redo are enabled.

Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).

new QTextOption.WrapMode QtGui.QTextEdit.WordWrapMode
getset