Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QWidgetView Class Reference

The QWidgetView class provides a scrolling view onto another widget. More...

    #include <QWidgetView>

Inherits QViewport.

- List of all members, including inherited members

### Writable Properties

- widgetResizable : bool

- 2 writable properties inherited from QViewport
- 5 writable properties inherited from QFrame
- 33 writable properties inherited from QWidget
- 1 writable property inherited from QObject

### Read-Only Properties

- 1 read-only property inherited from QViewport
- 1 read-only property inherited from QFrame
- 24 read-only properties inherited from QWidget

### Public Functions

- QWidgetView ( QWidget * parent = 0 )
- ~QWidgetView ()
- void setWidget ( QWidget * w )
- QWidget * widget () const

- 4 public functions inherited from QViewport
- 2 public functions inherited from QFrame
- 83 public functions inherited from QWidget
- 24 public functions inherited from QObject
- 2 public functions inherited from QPaintDevice

### Public Slots

- 16 public slots inherited from QWidget
- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QWidget
- 4 static public members inherited from QObject

### Protected Functions

- 17 protected functions inherited from QViewport
- 44 protected functions inherited from QWidget
- 9 protected functions inherited from QObject

## Detailed Description

The QWidgetView class provides a scrolling view onto another widget.

A widget view is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the view can provide scroll bars so that the entire area of the child widget can be viewed.

The child widget must be specified with setWidget(); it can be retrieved with widget(). The view can be made to be resizable with the setWidgetResizable() function.

When using a widget view to display the contents of a custom widget, it is important to ensure that the QWidget::sizeHint size hint of the child widget is set to a suitable value. If a standard QWidget is used for the child widget, it may be necessary to call QWidget::setMinimumSize to ensure that the contents of the widget are shown correctly within the widget view.

## Property Documentation

### widgetResizable : bool

This property holds whether the widget view should resize the view widget.

If this property is set to false (the default), the view honors the size of its widget. Regardless of this property, you can programmatically resize the widget using widget()->resize(), and the widget view will automatically adjust itself to the new size.

If this property is set to true, the view will automatically resize the widget in order to avoid scroll bars where they can be avoided, or to take advantage of extra space.

Access functions:

- bool widgetResizable () const
- void setWidgetResizable ( bool resizable )

## Member Function Documentation

### QWidgetView::QWidgetView ( QWidget * parent = 0 )

Constructs a widget view with the given parent, and with no widget; see setWidget().

### QWidgetView::~QWidgetView ()

Destroys the widget view.

### void QWidgetView::setWidget ( QWidget * w )

Set's the view widget's widget to w.

w becomes a child of the widget view, and will be destroyed when the widget view is deleted or when a new view widget is set.

See also widget().

### QWidget * QWidgetView::widget () const

Returns the view widget's widget, or 0 if there is none.

See also setWidget().