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

The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument. More...

Inheritance diagram for QtGui.QTextBlockFormat:
Collaboration diagram for QtGui.QTextBlockFormat:

Public Types

enum  LineHeightTypes {
  FixedHeight = 2, LineDistanceHeight = 4, MinimumHeight = 3, ProportionalHeight = 1,
  SingleHeight = 0
}
  More...
 
- Public Types inherited from QtGui.QTextFormat
enum  FormatType {
  BlockFormat = 1, CharFormat = 2, FrameFormat = 5, InvalidFormat = -1,
  ListFormat = 3, TableFormat = 4, UserFormat = 100
}
  More...
 
enum  ObjectTypes {
  ImageObject = 1, NoObject = 0, TableCellObject = 3, TableObject = 2,
  UserObject = 4096
}
  More...
 
enum  PageBreakFlag { PageBreak_AlwaysAfter = 16, PageBreak_AlwaysBefore = 1, PageBreak_Auto = 0 }
  More...
 
enum  Property {
  AnchorHref = 8241, AnchorName = 8242, BackgroundBrush = 2080, BackgroundImageUrl = 2083,
  BlockAlignment = 4112, BlockBottomMargin = 4145, BlockIndent = 4160, BlockLeftMargin = 4146,
  BlockNonBreakableLines = 4176, BlockRightMargin = 4147, BlockTopMargin = 4144, BlockTrailingHorizontalRulerWidth = 4192,
  CssFloat = 2048, FirstFontProperty = 8160, FontCapitalization = 8160, FontFamily = 8192,
  FontFixedPitch = 8200, FontHintingPreference = 8166, FontItalic = 8196, FontKerning = 8165,
  FontLetterSpacing = 8161, FontOverline = 8198, FontPixelSize = 8201, FontPointSize = 8193,
  FontSizeAdjustment = 8194, FontSizeIncrement = 8194, FontStrikeOut = 8199, FontStyleHint = 8163,
  FontStyleStrategy = 8164, FontUnderline = 8197, FontWeight = 8195, FontWordSpacing = 8162,
  ForegroundBrush = 2081, FrameBorder = 16384, FrameBorderBrush = 16393, FrameBorderStyle = 16400,
  FrameBottomMargin = 16390, FrameHeight = 16388, FrameLeftMargin = 16391, FrameMargin = 16385,
  FramePadding = 16386, FrameRightMargin = 16392, FrameTopMargin = 16389, FrameWidth = 16387,
  FullWidthSelection = 24576, ImageHeight = 20497, ImageName = 20480, ImageWidth = 20496,
  IsAnchor = 8240, LastFontProperty = 8201, LayoutDirection = 2049, LineHeight = 4168,
  LineHeightType = 4169, ListIndent = 12289, ListNumberPrefix = 12290, ListNumberSuffix = 12291,
  ListStyle = 12288, ObjectIndex = 0, ObjectType = 12032, OutlinePen = 2064,
  PageBreakPolicy = 28672, TabPositions = 4149, TableCellBottomPadding = 18451, TableCellColumnSpan = 18449,
  TableCellLeftPadding = 18452, TableCellPadding = 16643, TableCellRightPadding = 18453, TableCellRowSpan = 18448,
  TableCellSpacing = 16642, TableCellTopPadding = 18450, TableColumnWidthConstraints = 16641, TableColumns = 16640,
  TableHeaderRowCount = 16644, TextIndent = 4148, TextOutline = 8226, TextToolTip = 8228,
  TextUnderlineColor = 8208, TextUnderlineStyle = 8227, TextVerticalAlignment = 8225, UserProperty = 1048576
}
  More...
 

Public Member Functions

 QTextBlockFormat ()
 
 
 QTextBlockFormat (QTextBlockFormat copy)
 
 
override void CreateProxy ()
 
new bool IsValid ()
 
 
new double LineHeight ()
 
 
new double LineHeight (double scriptLineHeight, double scaling)
 
 
new int LineHeightType ()
 
 
new void SetLineHeight (double height, int heightType)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QTextFormat
override bool Equals (object o)
 
override int GetHashCode ()
 
 QTextFormat ()
 
 
 QTextFormat (QTextFormat rhs)
 
 
 QTextFormat (int type)
 
 
new bool BoolProperty (int propertyId)
 
 
new QBrush BrushProperty (int propertyId)
 
 
new void ClearBackground ()
 
 
new void ClearForeground ()
 
 
new void ClearProperty (int propertyId)
 
 
new QColor ColorProperty (int propertyId)
 
 
new double DoubleProperty (int propertyId)
 
 
new bool HasProperty (int propertyId)
 
 
new int IntProperty (int propertyId)
 
 
new bool IsBlockFormat ()
 
 
new bool IsCharFormat ()
 
 
new bool IsFrameFormat ()
 
 
new bool IsImageFormat ()
 
 
new bool IsListFormat ()
 
 
new bool IsTableCellFormat ()
 
 
new bool IsTableFormat ()
 
 
new bool IsValid ()
 
 
new QTextLength LengthProperty (int propertyId)
 
 
new
System.Collections.Generic.List
< QTextLength
LengthVectorProperty (int propertyId)
 
 
new void Merge (QTextFormat other)
 
 
new QPen PenProperty (int propertyId)
 
 
new
System.Collections.Generic.Dictionary
< System.Int32, System.Object > 
Properties ()
 
 
new object property (int propertyId)
 
 
new int PropertyCount ()
 
 
new void SetProperty (int propertyId, object value)
 
 
new void SetProperty (int propertyId, System.Collections.Generic.List< QTextLength > lengths)
 
 
new string StringProperty (int propertyId)
 
 
new QTextBlockFormat ToBlockFormat ()
 
 
new QTextCharFormat ToCharFormat ()
 
 
new QTextFrameFormat ToFrameFormat ()
 
 
new QTextImageFormat ToImageFormat ()
 
 
new QTextListFormat ToListFormat ()
 
 
new QTextTableCellFormat ToTableCellFormat ()
 
 
new QTextTableFormat ToTableFormat ()
 
 
new int Type ()
 
 
new void Dispose ()
 

Protected Member Functions

 QTextBlockFormat (System.Type dummy)
 
 QTextBlockFormat (QTextFormat fmt)
 
 
- Protected Member Functions inherited from QtGui.QTextFormat
 QTextFormat (System.Type dummy)
 

Properties

new Qt.AlignmentFlag Alignment [get, set]
 
 
new double BottomMargin [get, set]
 
 
new int Indent [get, set]
 
 
new double LeftMargin [get, set]
 
 
new bool NonBreakableLines [get, set]
 
 
new QTextFormat.PageBreakFlag PageBreakPolicy [get, set]
 
 
new double RightMargin [get, set]
 
 
new
System.Collections.Generic.List
< QTextOption.Tab
TabPositions [get, set]
 
 
new double TextIndent [get, set]
 
 
new double TopMargin [get, set]
 
 
- Properties inherited from QtGui.QTextFormat
new QBrush Background [get, set]
 
 
new QBrush Foreground [get, set]
 
 
new Qt.LayoutDirection LayoutDirection [get, set]
 
 
new int ObjectIndex [get, set]
 
 
new int ObjectType [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
static new QMetaObject StaticMetaObject [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from QtGui.QTextFormat
static bool operator!= (QTextFormat arg1, QTextFormat arg2)
 
 
static bool operator== (QTextFormat arg1, QTextFormat arg2)
 
 
- Protected Attributes inherited from QtGui.QTextFormat
SmokeInvocation interceptor
 

Detailed Description

The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument.

A document is composed of a list of blocks, represented by QTextBlock objects. Each block can contain an item of some kind, such as a paragraph of text, a table, a list, or an image. Every block has an associated QTextBlockFormat that specifies its characteristics.

To cater for left-to-right and right-to-left languages you can set a block's direction with setDirection(). Paragraph alignment is set with setAlignment(). Margins are controlled by setTopMargin(), setBottomMargin(), setLeftMargin(), setRightMargin(). Overall indentation is set with setIndent(), the indentation of the first line with setTextIndent().

Line spacing is set with setLineHeight() and retrieved via lineHeight() and lineHeightType(). The types of line spacing available are in the LineHeightTypes enum.

Line breaking can be enabled and disabled with setNonBreakableLines().

The brush used to paint the paragraph's background is set with setBackground(), and other aspects of the text's appearance can be customized by using the setProperty() function with the OutlinePen, ForegroundBrush, and BackgroundBrush QTextFormat::Property values.

If a text block is part of a list, it can also have a list format that is accessible with the listFormat() function.

See also QTextBlock and QTextCharFormat.

Member Enumeration Documentation

This enum describes the various types of line spacing support paragraphs can have.

This enum was introduced or modified in Qt 4.8.

See also lineHeight(), lineHeightType(), and setLineHeight().

Enumerator:
FixedHeight 

This sets the line height to a fixed line height (in pixels).

LineDistanceHeight 

This adds the specified height between lines (in pixels).

MinimumHeight 

This sets the minimum line height (in pixels).

ProportionalHeight 

This sets the spacing proportional to the line (in percentage). For example, set to 200 for double spacing.

SingleHeight 

This is the default line height: single spacing.

Constructor & Destructor Documentation

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

Constructs a new QTextBlockFormat.

QtGui.QTextBlockFormat.QTextBlockFormat ( QTextFormat  fmt)
protected

Constructs a new QTextBlockFormat.

QtGui.QTextBlockFormat.QTextBlockFormat ( QTextBlockFormat  copy)

Constructs a new QTextBlockFormat.

Member Function Documentation

override void QtGui.QTextBlockFormat.CreateProxy ( )
virtual

Reimplemented from QtGui.QTextFormat.

new void QtGui.QTextBlockFormat.Dispose ( )
new bool QtGui.QTextBlockFormat.IsValid ( )

Returns true if this block format is valid; otherwise returns false.

new double QtGui.QTextBlockFormat.LineHeight ( )

This returns the LineHeight property for the paragraph.

This function was introduced in Qt 4.8.

See also LineHeightTypes, setLineHeight(), and lineHeightType().

new double QtGui.QTextBlockFormat.LineHeight ( double  scriptLineHeight,
double  scaling 
)

Returns the height of the lines in the paragraph based on the height of the script line given by scriptLineHeight and the specified scaling factor.

The value that is returned is also dependent on the given LineHeightType of the paragraph as well as the LineHeight setting that has been set for the paragraph.

The scaling is needed for heights that include a fixed number of pixels, to scale them appropriately for printing.

This function was introduced in Qt 4.8.

See also LineHeightTypes, setLineHeight(), and lineHeightType().

new int QtGui.QTextBlockFormat.LineHeightType ( )

This returns the LineHeightType property of the paragraph.

This function was introduced in Qt 4.8.

See also LineHeightTypes, setLineHeight(), and lineHeight().

new void QtGui.QTextBlockFormat.SetLineHeight ( double  height,
int  heightType 
)

Sets the line height for the paragraph to the value given by height which is dependent on heightType in the way described by the LineHeightTypes enum.

This function was introduced in Qt 4.8.

See also LineHeightTypes, lineHeight(), and lineHeightType().

Property Documentation

new Qt.AlignmentFlag QtGui.QTextBlockFormat.Alignment
getset

Returns the paragraph's alignment.

Sets the paragraph's alignment.

new double QtGui.QTextBlockFormat.BottomMargin
getset

Returns the paragraph's bottom margin.

Sets the paragraph's bottom margin.

new int QtGui.QTextBlockFormat.Indent
getset

Returns the paragraph's indent.

Sets the paragraph's indentation. Margins are set independently of indentation with setLeftMargin() and setTextIndent(). The indentation is an integer that is multiplied with the document-wide standard indent, resulting in the actual indent of the paragraph.

new double QtGui.QTextBlockFormat.LeftMargin
getset

Returns the paragraph's left margin.

Sets the paragraph's left margin. Indentation can be applied separately with setIndent().

new bool QtGui.QTextBlockFormat.NonBreakableLines
getset

Returns true if the lines in the paragraph are non-breakable; otherwise returns false.

If b is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.

new QTextFormat.PageBreakFlag QtGui.QTextBlockFormat.PageBreakPolicy
getset

Returns the currently set page break policy for the paragraph. The default is QTextFormat::PageBreak_Auto.

This function was introduced in Qt 4.2.

Sets the page break policy for the paragraph to policy.

This function was introduced in Qt 4.2.

new double QtGui.QTextBlockFormat.RightMargin
getset

Returns the paragraph's right margin.

Sets the paragraph's right margin.

new System.Collections.Generic.List<QTextOption.Tab> QtGui.QTextBlockFormat.TabPositions
getset

Returns a list of tab positions defined for the text block.

This function was introduced in Qt 4.4.

Sets the tab positions for the text block to those specified by tabs.

This function was introduced in Qt 4.4.

new double QtGui.QTextBlockFormat.TextIndent
getset

Returns the paragraph's text indent.

Sets the indent for the first line in the block. This allows the first line of a paragraph to be indented differently to the other lines, enhancing the readability of the text.

new double QtGui.QTextBlockFormat.TopMargin
getset

Returns the paragraph's top margin.

Sets the paragraph's top margin.