Home

QtWidgetHost Class Reference

A QtWidgetHost is a .Net control that enables a .Net application to host a Qt widget. More...

 #include <QtWidgetHost>

Public Functions

Protected Functions


Detailed Description

A QtWidgetHost is a .Net control that enables a .Net application to host a Qt widget.

Note that the class is managed, so it should be instantiated with the gcnew keyword. The QtWidgetHost is initialized by passing the QWidget to be hosted in the constructor of the QtWidgetHost:

 QPushButton *w = new QPushButton(QString::fromAscii("Hello from Qt"));
 QtWidgetHost ^clockHost = gcnew QtWidgetHost(w);

If you rather want to embed a .Net control within a Qt application you should use the QtControlHost.


Member Function Documentation

QtWidgetHost::QtWidgetHost ( QWidget * w )

Construct a WidgetHost hosting the QWidget w.

QtWidgetHost::~QtWidgetHost ()   [protected]

Destruct the widget host

System::Drawing::Size QtWidgetHost::GetPreferredSize ( System::Drawing::Size proposedSize )   [virtual]

Returns the preferred size of the WidgetHost, which is given by the sizeHint of the widget that is hosted. The argument proposedSize is ignored.

void QtWidgetHost::Select ( bool directed, bool forward )   [virtual protected]

Inherited and reimplemented from the base class, and enables the tab switching of hosted controls. Set directed to true to specify the direction of the tab switching, where forward set to true will move the focus to the next widget (as specified by the widgets tab order). If forward is set to false it will move the focus to the previous widget.


Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Solutions