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

The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View. More...

Inheritance diagram for QtGui.QGraphicsGridLayout:
Collaboration diagram for QtGui.QGraphicsGridLayout:

Public Member Functions

 QGraphicsGridLayout (IQGraphicsLayoutItem parent=null)
  More...
 
override void CreateProxy ()
 
new void AddItem (IQGraphicsLayoutItem item, int row, int column, Qt.AlignmentFlag alignment=0)
  More...
 
new void AddItem (IQGraphicsLayoutItem item, int row, int column, int rowSpan, int columnSpan, Qt.AlignmentFlag alignment=0)
  More...
 
new Qt.AlignmentFlag Alignment (IQGraphicsLayoutItem item)
  More...
 
new Qt.AlignmentFlag ColumnAlignment (int column)
  More...
 
new double ColumnMaximumWidth (int column)
  More...
 
new double ColumnMinimumWidth (int column)
  More...
 
new double ColumnPreferredWidth (int column)
  More...
 
new double ColumnSpacing (int column)
  More...
 
new int ColumnStretchFactor (int column)
  More...
 
override void Invalidate ()
  More...
 
override IQGraphicsLayoutItem ItemAt (int index)
  More...
 
new IQGraphicsLayoutItem ItemAt (int row, int column)
  More...
 
override void RemoveAt (int index)
  More...
 
new void RemoveItem (IQGraphicsLayoutItem item)
  More...
 
new Qt.AlignmentFlag RowAlignment (int row)
  More...
 
new double RowMaximumHeight (int row)
  More...
 
new double RowMinimumHeight (int row)
  More...
 
new double RowPreferredHeight (int row)
  More...
 
new double RowSpacing (int row)
  More...
 
new int RowStretchFactor (int row)
  More...
 
new void SetAlignment (IQGraphicsLayoutItem item, Qt.AlignmentFlag alignment)
  More...
 
new void SetColumnAlignment (int column, Qt.AlignmentFlag alignment)
  More...
 
new void SetColumnFixedWidth (int column, double width)
  More...
 
new void SetColumnMaximumWidth (int column, double width)
  More...
 
new void SetColumnMinimumWidth (int column, double width)
  More...
 
new void SetColumnPreferredWidth (int column, double width)
  More...
 
new void SetColumnSpacing (int column, double spacing)
  More...
 
new void SetColumnStretchFactor (int column, int stretch)
  More...
 
new void SetRowAlignment (int row, Qt.AlignmentFlag alignment)
  More...
 
new void SetRowFixedHeight (int row, double height)
  More...
 
new void SetRowMaximumHeight (int row, double height)
  More...
 
new void SetRowMinimumHeight (int row, double height)
  More...
 
new void SetRowPreferredHeight (int row, double height)
  More...
 
new void SetRowSpacing (int row, double spacing)
  More...
 
new void SetRowStretchFactor (int row, int stretch)
  More...
 
new void SetSpacing (double spacing)
  More...
 
new QSizeF SizeHint (Qt.SizeHint which)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QGraphicsLayout
 QGraphicsLayout (IQGraphicsLayoutItem parent=null)
  More...
 
override void CreateProxy ()
 
new void Activate ()
  More...
 
override void GetContentsMargins (ref double left, ref double top, ref double right, ref double bottom)
  More...
 
new void SetContentsMargins (double left, double top, double right, double bottom)
  More...
 
override void UpdateGeometry ()
  More...
 
virtual void OnWidgetEvent (QEvent e)
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QGraphicsLayoutItem
 QGraphicsLayoutItem (IQGraphicsLayoutItem parent=null, bool isLayout=false)
  More...
 
new QSizeF EffectiveSizeHint (Qt.SizeHint which)
  More...
 
new QSizeF EffectiveSizeHint (Qt.SizeHint which, QSizeF constraint)
  More...
 
new void SetMaximumSize (double w, double h)
  More...
 
new void SetMinimumSize (double w, double h)
  More...
 
new void SetPreferredSize (double w, double h)
  More...
 
new void SetSizePolicy (QSizePolicy.Policy hPolicy, QSizePolicy.Policy vPolicy, QSizePolicy.ControlType controlType=QSizePolicy.ControlType.DefaultType)
  More...
 
new void Dispose ()
 

Protected Member Functions

 QGraphicsGridLayout (System.Type dummy)
 
override QSizeF SizeHint (Qt.SizeHint which, QSizeF constraint)
  More...
 
- Protected Member Functions inherited from QtGui.QGraphicsLayout
 QGraphicsLayout (System.Type dummy)
 
new void AddChildLayoutItem (IQGraphicsLayoutItem layoutItem)
  More...
 
- Protected Member Functions inherited from QtGui.QGraphicsLayoutItem
 QGraphicsLayoutItem (System.Type dummy)
 
new QSizeF SizeHint (Qt.SizeHint which)
  More...
 

Properties

override QRectF Geometry [get, set]
  More...
 
double HorizontalSpacing [get, set]
  More...
 
double VerticalSpacing [get, set]
  More...
 
override int Count [get]
  More...
 
int ColumnCount [get]
  More...
 
int RowCount [get]
  More...
 
- Properties inherited from QtGui.QGraphicsLayout
static bool InstantInvalidatePropagation [get, set]
  More...
 
virtual int Count [get]
  More...
 
bool IsActivated [get]
  More...
 
- Properties inherited from QtGui.QGraphicsLayoutItem
virtual QRectF Geometry [get, set]
  More...
 
IQGraphicsItem GraphicsItem [get, set]
  More...
 
double MaximumHeight [get, set]
  More...
 
QSizeF MaximumSize [get, set]
  More...
 
double MaximumWidth [get, set]
  More...
 
double MinimumHeight [get, set]
  More...
 
QSizeF MinimumSize [get, set]
  More...
 
double MinimumWidth [get, set]
  More...
 
bool OwnedByLayout [get, set]
  More...
 
IQGraphicsLayoutItem ParentLayoutItem [get, set]
  More...
 
double PreferredHeight [get, set]
  More...
 
QSizeF PreferredSize [get, set]
  More...
 
double PreferredWidth [get, set]
  More...
 
QSizePolicy SizePolicy [get, set]
  More...
 
QRectF ContentsRect [get]
  More...
 
bool IsLayout [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
- Properties inherited from QtGui.IQGraphicsLayoutItem
QRectF Geometry [get, set]
  More...
 
System.Double MaximumHeight [get, set]
  More...
 
QSizeF MaximumSize [get, set]
  More...
 
System.Double MaximumWidth [get, set]
  More...
 
System.Double MinimumHeight [get, set]
  More...
 
QSizeF MinimumSize [get, set]
  More...
 
System.Double MinimumWidth [get, set]
  More...
 
IQGraphicsLayoutItem ParentLayoutItem [get, set]
  More...
 
System.Double PreferredHeight [get, set]
  More...
 
QSizeF PreferredSize [get, set]
  More...
 
System.Double PreferredWidth [get, set]
  More...
 
QSizePolicy SizePolicy [get, set]
  More...
 
QRectF ContentsRect [get]
  More...
 
IQGraphicsItem GraphicsItem [get]
  More...
 
System.Boolean IsLayout [get]
  More...
 
System.Boolean OwnedByLayout [get]
  More...
 

Additional Inherited Members

- Protected Attributes inherited from QtGui.QGraphicsLayoutItem
SmokeInvocation interceptor
 

Detailed Description

The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.

The most common way to use QGraphicsGridLayout is to construct an object on the heap with no parent, add widgets and layouts by calling addItem(), and finally assign the layout to a widget by calling QGraphicsWidget::setLayout(). QGraphicsGridLayout automatically computes the dimensions of the grid as you add items.

QGraphicsScene scene;

QGraphicsWidget *textEdit = scene.addWidget(new QTextEdit);

QGraphicsWidget *pushButton = scene.addWidget(new QPushButton);

QGraphicsGridLayout *layout = new QGraphicsGridLayout;

layout->addItem(textEdit, 0, 0);

layout->addItem(pushButton, 0, 1);

QGraphicsWidget *form = new QGraphicsWidget;

form->setLayout(layout);

scene.addItem(form);

The layout takes ownership of the items. In some cases when the layout item also inherits from QGraphicsItem (such as QGraphicsWidget) there will be a ambiguity in ownership because the layout item belongs to two ownership hierarchies. See the documentation of QGraphicsLayoutItem::setOwnedByLayout() how to handle this. You can access each item in the layout by calling count() and itemAt(). Calling removeAt() will remove an item from the layout, without destroying it.

Size Hints and Size Policies in QGraphicsGridLayout

QGraphicsGridLayout respects each item's size hints and size policies, and when a cell in the grid has more space than the items can fill, each item is arranged according to the layout's alignment for that item. You can set an alignment for each item by calling setAlignment(), and check the alignment for any item by calling alignment(). You can also set the alignment for an entire row or column by calling setRowAlignment() and setColumnAlignment() respectively. By default, items are aligned to the top left.

See also QGraphicsLinearLayout and QGraphicsWidget.

Constructor & Destructor Documentation

QtGui.QGraphicsGridLayout.QGraphicsGridLayout ( System.Type  dummy)
protected
QtGui.QGraphicsGridLayout.QGraphicsGridLayout ( IQGraphicsLayoutItem  parent = null)

Constructs a QGraphicsGridLayout instance. parent is passed to QGraphicsLayout's constructor.

Here is the call graph for this function:

Member Function Documentation

new void QtGui.QGraphicsGridLayout.AddItem ( IQGraphicsLayoutItem  item,
int  row,
int  column,
Qt.AlignmentFlag  alignment = 0 
)

Adds item to the grid on row and column. You can specify an optional alignment for item.

new void QtGui.QGraphicsGridLayout.AddItem ( IQGraphicsLayoutItem  item,
int  row,
int  column,
int  rowSpan,
int  columnSpan,
Qt.AlignmentFlag  alignment = 0 
)

Adds item to the grid on row and column. You can specify a rowSpan and columnSpan and an optional alignment.

new Qt.AlignmentFlag QtGui.QGraphicsGridLayout.Alignment ( IQGraphicsLayoutItem  item)

Returns the alignment for item.

See also setAlignment().

new Qt.AlignmentFlag QtGui.QGraphicsGridLayout.ColumnAlignment ( int  column)

Returns the alignment for column.

See also setColumnAlignment().

new double QtGui.QGraphicsGridLayout.ColumnMaximumWidth ( int  column)

Returns the maximum width for column.

See also setColumnMaximumWidth().

new double QtGui.QGraphicsGridLayout.ColumnMinimumWidth ( int  column)

Returns the minimum width for column.

See also setColumnMinimumWidth().

new double QtGui.QGraphicsGridLayout.ColumnPreferredWidth ( int  column)

Returns the preferred width for column.

See also setColumnPreferredWidth().

new double QtGui.QGraphicsGridLayout.ColumnSpacing ( int  column)

Returns the column spacing for column.

See also setColumnSpacing().

new int QtGui.QGraphicsGridLayout.ColumnStretchFactor ( int  column)

Returns the stretch factor for column.

See also setColumnStretchFactor().

override void QtGui.QGraphicsGridLayout.CreateProxy ( )
virtual

Reimplemented from QtGui.QGraphicsLayoutItem.

Here is the caller graph for this function:

new void QtGui.QGraphicsGridLayout.Dispose ( )
override void QtGui.QGraphicsGridLayout.Invalidate ( )
virtual

Reimplemented from QGraphicsLayout::invalidate().

Reimplemented from QtGui.QGraphicsLayout.

override IQGraphicsLayoutItem QtGui.QGraphicsGridLayout.ItemAt ( int  index)
virtual

Reimplemented from QGraphicsLayout::itemAt().

Returns the layout item at index, or 0 if there is no layout item at this index.

Implements QtGui.QGraphicsLayout.

new IQGraphicsLayoutItem QtGui.QGraphicsGridLayout.ItemAt ( int  row,
int  column 
)

Returns a pointer to the layout item at (row, column).

override void QtGui.QGraphicsGridLayout.RemoveAt ( int  index)
virtual

Reimplemented from QGraphicsLayout::removeAt().

Removes the layout item at index without destroying it. Ownership of the item is transferred to the caller.

See also addItem().

Implements QtGui.QGraphicsLayout.

new void QtGui.QGraphicsGridLayout.RemoveItem ( IQGraphicsLayoutItem  item)

Removes the layout item item without destroying it. Ownership of the item is transferred to the caller.

This function was introduced in Qt 4.8.

See also addItem().

new Qt.AlignmentFlag QtGui.QGraphicsGridLayout.RowAlignment ( int  row)

Returns the alignment of row.

See also setRowAlignment().

new double QtGui.QGraphicsGridLayout.RowMaximumHeight ( int  row)

Returns the maximum height for row, row.

See also setRowMaximumHeight().

new double QtGui.QGraphicsGridLayout.RowMinimumHeight ( int  row)

Returns the minimum height for row, row.

See also setRowMinimumHeight().

new double QtGui.QGraphicsGridLayout.RowPreferredHeight ( int  row)

Returns the preferred height for row, row.

See also setRowPreferredHeight().

new double QtGui.QGraphicsGridLayout.RowSpacing ( int  row)

Returns the row spacing for row.

See also setRowSpacing().

new int QtGui.QGraphicsGridLayout.RowStretchFactor ( int  row)

Returns the stretch factor for row.

See also setRowStretchFactor().

new void QtGui.QGraphicsGridLayout.SetAlignment ( IQGraphicsLayoutItem  item,
Qt.AlignmentFlag  alignment 
)

Sets the alignment for item to alignment.

See also alignment().

new void QtGui.QGraphicsGridLayout.SetColumnAlignment ( int  column,
Qt.AlignmentFlag  alignment 
)

Sets the alignment for column to alignment.

See also columnAlignment().

new void QtGui.QGraphicsGridLayout.SetColumnFixedWidth ( int  column,
double  width 
)

Sets the fixed width of column to width.

new void QtGui.QGraphicsGridLayout.SetColumnMaximumWidth ( int  column,
double  width 
)

Sets the maximum width of column to width.

See also columnMaximumWidth().

new void QtGui.QGraphicsGridLayout.SetColumnMinimumWidth ( int  column,
double  width 
)

Sets the minimum width for column to width.

See also columnMinimumWidth().

new void QtGui.QGraphicsGridLayout.SetColumnPreferredWidth ( int  column,
double  width 
)

Sets the preferred width for column to width.

See also columnPreferredWidth().

new void QtGui.QGraphicsGridLayout.SetColumnSpacing ( int  column,
double  spacing 
)

Sets the spacing for column to spacing.

See also columnSpacing().

new void QtGui.QGraphicsGridLayout.SetColumnStretchFactor ( int  column,
int  stretch 
)

Sets the stretch factor for column to stretch.

See also columnStretchFactor().

new void QtGui.QGraphicsGridLayout.SetRowAlignment ( int  row,
Qt.AlignmentFlag  alignment 
)

Sets the alignment of row to alignment.

See also rowAlignment().

new void QtGui.QGraphicsGridLayout.SetRowFixedHeight ( int  row,
double  height 
)

Sets the fixed height for row, row, to height.

new void QtGui.QGraphicsGridLayout.SetRowMaximumHeight ( int  row,
double  height 
)

Sets the maximum height for row, row, to height.

See also rowMaximumHeight().

new void QtGui.QGraphicsGridLayout.SetRowMinimumHeight ( int  row,
double  height 
)

Sets the minimum height for row, row, to height.

See also rowMinimumHeight().

new void QtGui.QGraphicsGridLayout.SetRowPreferredHeight ( int  row,
double  height 
)

Sets the preferred height for row, row, to height.

See also rowPreferredHeight().

new void QtGui.QGraphicsGridLayout.SetRowSpacing ( int  row,
double  spacing 
)

Sets the spacing for row to spacing.

See also rowSpacing().

new void QtGui.QGraphicsGridLayout.SetRowStretchFactor ( int  row,
int  stretch 
)

Sets the stretch factor for row to stretch.

See also rowStretchFactor().

new void QtGui.QGraphicsGridLayout.SetSpacing ( double  spacing)

Sets the grid layout's default spacing, both vertical and horizontal, to spacing.

See also rowSpacing() and columnSpacing().

new QSizeF QtGui.QGraphicsGridLayout.SizeHint ( Qt.SizeHint  which)

Reimplemented from QGraphicsLayoutItem::sizeHint().

override QSizeF QtGui.QGraphicsGridLayout.SizeHint ( Qt.SizeHint  which,
QSizeF  constraint 
)
protectedvirtual

Reimplemented from QGraphicsLayoutItem::sizeHint().

Implements QtGui.QGraphicsLayoutItem.

Property Documentation

int QtGui.QGraphicsGridLayout.ColumnCount
get

Returns the number of columns in the grid layout. This is always one more than the index of the last column that is occupied by a layout item (empty columns are counted except for those at the end).

override int QtGui.QGraphicsGridLayout.Count
get

Reimplemented from QGraphicsLayout::count().

Returns the number of layout items in this grid layout.

override QRectF QtGui.QGraphicsGridLayout.Geometry
getset

Reimplemented from QGraphicsLayoutItem::setGeometry().

Sets the bounding geometry of the grid layout to rect.

double QtGui.QGraphicsGridLayout.HorizontalSpacing
getset

Returns the default horizontal spacing for the grid layout.

Sets the default horizontal spacing for the grid layout to spacing.

int QtGui.QGraphicsGridLayout.RowCount
get

Returns the number of rows in the grid layout. This is always one more than the index of the last row that is occupied by a layout item (empty rows are counted except for those at the end).

double QtGui.QGraphicsGridLayout.VerticalSpacing
getset

Returns the default vertical spacing for the grid layout.

Sets the default vertical spacing for the grid layout to spacing.