Home |
A ControlHost is a widget that can host Microsoft.Net controls within a Qt application. More...
#include <QtControlHost>
Inherits QWidget.
A ControlHost is a widget that can host Microsoft.Net controls within a Qt application.
The hosted control can be associated with the ControlHost in several ways, one way is to allocate the control and then pass the reference to the constructor of the ControlHost:
calendar = gcnew System::Windows::Forms::MonthCalendar(); calendarHost = new QtControlHost(calendar, this);
Or one can change the control of the ControlHost by modifying the controlAssembly and controlType properties:
calendarHost = new QtControlHost(this); calendarHost->setControlAssembly("system.windows.forms.dll"); calendarHost->setControlType("System.Windows.Forms.MonthCalendar");
The last one allows dynamic creation of hosted controls without being dependent on a managed c++ extension.
Note that the ControlHost does not give an interface to modify the properties of the hosted control. If you need to call methods or modify some properties of the hosted control, you must operate directly on the hosted control. Use QtControlHost::control() to get a reference to the hosted control. If you rather want to embed a Qt widget within a .Net application you should use the WidgetHost.
This property holds the assembly of the hosted control.
Access functions:
This property holds the ownership of the Winforms control. If controlOwnership is External, an external object has the ownership of the control, and the ControlHost will not destroy the Control when ControlHost is destroyed or if the Control is changed with setControl().
Access functions:
This property holds the type of the hosted control.
Access functions:
Constructs a new ControlHost with the parent widget and no winforms control.
Constructs a new ControlHost with the parent widget and the hosted control hostedControl
Destructs the ControlHost. If the property controlOwnership is set to Host, the hosted control will be destroyed.
Returns the hosted control.
See also setControl().
Creates a winforms control using the assembly controlAssembly and type controlType.
See also controlAssembly and controlType.
Reimplemented from QWidget::event(QEvent *e), and notifies the hosted control for some values of e that the hosted control is expected to react to. This function implements a method of QWidget that enables the hosted control to respond as expected when the event e occurs.
Reimplemented from QObject.
This function implements a method of QWidget that enables the hosted control to respond as expected when the event e occurs.
Reimplemented from QWidget.
Returns the minimum size of the hosted control.
Reimplemented from QWidget.
This function implements a method of QWidget that enables the hosted control to respond as expected when the event e occurs.
Reimplemented from QWidget.
Assigns the hosted control to hostedControl.
See also control().
Will show the hosted control. This function implements a method of QWidget that enables the hosted control to respond as expected when the event e occurs.
Reimplemented from QWidget.
Returns the preferred size of the hosted control.
Reimplemented from QWidget.
Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Solutions |