Qyoto  4.0.6
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 double LineHeight ()
 
 
new double LineHeight (double scriptLineHeight, double scaling)
 
 
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 QTextLength LengthProperty (int propertyId)
 
 
new
System.Collections.Generic.List
< QTextLength
LengthVectorProperty (int propertyId)
 
 
new void Merge (QTextFormat other)
 
 
new QPen PenProperty (int propertyId)
 
 
new object property (int propertyId)
 
 
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 void Dispose ()
 

Protected Member Functions

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

Properties

Qt.AlignmentFlag Alignment [get, set]
 
 
double BottomMargin [get, set]
 
 
int Indent [get, set]
 
 
double LeftMargin [get, set]
 
 
bool NonBreakableLines [get, set]
 
 
QTextFormat.PageBreakFlag PageBreakPolicy [get, set]
 
 
double RightMargin [get, set]
 
 
System.Collections.Generic.List
< QTextOption.Tab
TabPositions [get, set]
 
 
double TextIndent [get, set]
 
 
double TopMargin [get, set]
 
 
bool IsValid [get]
 
 
int LineHeightType [get]
 
 
- Properties inherited from QtGui.QTextFormat
QBrush Background [get, set]
 
 
QBrush Foreground [get, set]
 
 
Qt.LayoutDirection LayoutDirection [get, set]
 
 
int ObjectIndex [get, set]
 
 
int ObjectType [get, set]
 
 
bool IsBlockFormat [get]
 
 
bool IsCharFormat [get]
 
 
bool IsFrameFormat [get]
 
 
bool IsImageFormat [get]
 
 
bool IsListFormat [get]
 
 
bool IsTableCellFormat [get]
 
 
bool IsTableFormat [get]
 
 
bool IsValid [get]
 
 
System.Collections.Generic.Dictionary
< System.Int32, System.Object > 
Properties [get]
 
 
int PropertyCount [get]
 
 
int Type [get]
 
 
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 one, QTextFormat rhs)
 
 
static bool operator== (QTextFormat one, QTextFormat rhs)
 
 
- 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
QtGui.QTextBlockFormat.QTextBlockFormat ( QTextBlockFormat  copy)

Member Function Documentation

override void QtGui.QTextBlockFormat.CreateProxy ( )
virtual

Reimplemented from QtGui.QTextFormat.

new void QtGui.QTextBlockFormat.Dispose ( )
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 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

Qt.AlignmentFlag QtGui.QTextBlockFormat.Alignment
getset

Returns the paragraph's alignment.

Sets the paragraph's alignment.

double QtGui.QTextBlockFormat.BottomMargin
getset

Returns the paragraph's bottom margin.

Sets the paragraph's bottom margin.

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.

bool QtGui.QTextBlockFormat.IsValid
get

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

double QtGui.QTextBlockFormat.LeftMargin
getset

Returns the paragraph's left margin.

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

int QtGui.QTextBlockFormat.LineHeightType
get

This returns the LineHeightType property of the paragraph.

This function was introduced in Qt 4.8.

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

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.

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.

double QtGui.QTextBlockFormat.RightMargin
getset

Returns the paragraph's right margin.

Sets the paragraph's right margin.

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.

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.

double QtGui.QTextBlockFormat.TopMargin
getset

Returns the paragraph's top margin.

Sets the paragraph's top margin.