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

The QTextFragment class holds a piece of text in a QTextDocument with a single QTextCharFormat. More...

Inheritance diagram for QtGui.QTextFragment:
Collaboration diagram for QtGui.QTextFragment:

Public Member Functions

override bool Equals (object o)
 
override int GetHashCode ()
 
 QTextFragment ()
 
 
 QTextFragment (QTextFragment o)
 
 
virtual void CreateProxy ()
 
new QTextCharFormat CharFormat ()
 
 
new int CharFormatIndex ()
 
 
new bool Contains (int position)
 
 
new
System.Collections.Generic.List
< QGlyphRun
GlyphRuns ()
 
 
new bool IsValid ()
 
 
new int Length ()
 
 
new int Position ()
 
 
new string Text ()
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator!= (QTextFragment arg1, QTextFragment arg2)
 
 
static bool operator< (QTextFragment arg1, QTextFragment arg2)
 
 
static bool operator== (QTextFragment arg1, QTextFragment arg2)
 
 
static bool operator> (QTextFragment arg1, QTextFragment arg2)
 

Protected Member Functions

 QTextFragment (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QTextFragment class holds a piece of text in a QTextDocument with a single QTextCharFormat.

A text fragment describes a piece of text that is stored with a single character format. Text in which the character format changes can be represented by sequences of text fragments with different formats.

If the user edits the text in a fragment and introduces a different character format, the fragment's text will be split at each point where the format changes, and new fragments will be created. For example, changing the style of some text in the middle of a sentence will cause the fragment to be broken into three separate fragments: the first and third with the same format as before, and the second with the new style. The first fragment will contain the text from the beginning of the sentence, the second will contain the text from the middle, and the third takes the text from the end of the sentence.

A fragment's text and character format can be obtained with the text() and charFormat() functions. The length() function gives the length of the text in the fragment. position() gives the position in the document of the start of the fragment. To determine whether the fragment contains a particular position within the document, use the contains() function.

See also QTextDocument and Rich Text Document Structure.

Constructor & Destructor Documentation

QtGui.QTextFragment.QTextFragment ( System.Type  dummy)
protected
QtGui.QTextFragment.QTextFragment ( )

Creates a new empty text fragment.

QtGui.QTextFragment.QTextFragment ( QTextFragment  o)

Copies the content (text and format) of the other text fragment to this text fragment.

Member Function Documentation

new QTextCharFormat QtGui.QTextFragment.CharFormat ( )

Returns the text fragment's character format.

See also text().

new int QtGui.QTextFragment.CharFormatIndex ( )

Returns an index into the document's internal list of character formats for the text fragment's character format.

See also QTextDocument::allFormats().

new bool QtGui.QTextFragment.Contains ( int  position)

Returns true if the text fragment contains the text at the given position in the document; otherwise returns false.

virtual void QtGui.QTextFragment.CreateProxy ( )
virtual
new void QtGui.QTextFragment.Dispose ( )
override bool QtGui.QTextFragment.Equals ( object  o)
override int QtGui.QTextFragment.GetHashCode ( )
new System.Collections.Generic.List<QGlyphRun> QtGui.QTextFragment.GlyphRuns ( )

Returns the glyphs of this text fragment. The positions of the glyphs are relative to the position of the QTextBlock's layout.

See also QGlyphRun, QTextBlock::layout(), QTextLayout::position(), and QPainter::drawGlyphRun().

new bool QtGui.QTextFragment.IsValid ( )

Returns true if this is a valid text fragment (i.e. has a valid position in a document); otherwise returns false.

new int QtGui.QTextFragment.Length ( )

Returns the number of characters in the text fragment.

See also text().

static bool QtGui.QTextFragment.operator!= ( QTextFragment  arg1,
QTextFragment  arg2 
)
static

Returns true if this text fragment is different (at a different position) from the other text fragment; otherwise returns false.

static bool QtGui.QTextFragment.operator< ( QTextFragment  arg1,
QTextFragment  arg2 
)
static

Returns true if this text fragment appears earlier in the document than the other text fragment; otherwise returns false.

static bool QtGui.QTextFragment.operator== ( QTextFragment  arg1,
QTextFragment  arg2 
)
static

Returns true if this text fragment is the same (at the same position) as the other text fragment; otherwise returns false.

static bool QtGui.QTextFragment.operator> ( QTextFragment  arg1,
QTextFragment  arg2 
)
static
new int QtGui.QTextFragment.Position ( )

Returns the position of this text fragment in the document.

new string QtGui.QTextFragment.Text ( )

Returns the text fragment's as plain text.

See also length() and charFormat().

Member Data Documentation

SmokeInvocation QtGui.QTextFragment.interceptor
protected

Property Documentation

virtual System.IntPtr QtGui.QTextFragment.SmokeObject
getset