3ds Max C++ API Reference
QMaxWinHost Class Reference

Simple widget that can host a native win32 window. More...

#include <QMaxWinHost.h>

+ Inheritance diagram for QMaxWinHost:

Signals

void hostedWindowChanged (HWND newHWND, HWND oldHWND)
 Gets emitted, if the native window that is hosted by this widget has been changed. More...
 

Public Member Functions

 QMaxWinHost (HWND hwnd, QWidget *parent=nullptr)
 
 QMaxWinHost (QWidget *parent=nullptr, Qt::WindowFlags f={})
 
 ~QMaxWinHost () override
 
void setHostedWindow (HWND hwnd)
 Sets the native window that is hosted by this widget. More...
 
HWND hostedWindow () const
 Returns the native window that is hosted by this widget. More...
 

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 
void moveEvent (QMoveEvent *event) override
 
void focusInEvent (QFocusEvent *event) override
 
void showEvent (QShowEvent *event) override
 
void hideEvent (QHideEvent *event) override
 
bool event (QEvent *event) override
 
bool nativeEvent (const QByteArray &eventType, void *msg, long *result) override
 

Detailed Description

Simple widget that can host a native win32 window.

This class is used to embed non-qt windows into the Qt window framework. It will take care of basic things like moving/resizing the hosted window when the winHost container changes its geometry.

Constructor & Destructor Documentation

◆ QMaxWinHost() [1/2]

QMaxWinHost ( HWND  hwnd,
QWidget *  parent = nullptr 
)
explicit

◆ QMaxWinHost() [2/2]

QMaxWinHost ( QWidget *  parent = nullptr,
Qt::WindowFlags  f = {} 
)
explicit

◆ ~QMaxWinHost()

~QMaxWinHost ( )
override

Member Function Documentation

◆ setHostedWindow()

void setHostedWindow ( HWND  hwnd)

Sets the native window that is hosted by this widget.

The native window will be re-parented as child of this widget. If the window has been changed, a hostedWindowChanged signal will be emitted containing the new HWND as well as the old one.

See also
hostedWindow(), hostedWindowChanged()

◆ hostedWindow()

HWND hostedWindow ( ) const

Returns the native window that is hosted by this widget.

See also
setHostedWindow(), hostedWindowChanged()

◆ hostedWindowChanged

void hostedWindowChanged ( HWND  newHWND,
HWND  oldHWND 
)
signal

Gets emitted, if the native window that is hosted by this widget has been changed.

Parameters
newHWNDthe new HWND inside this object
oldHWNDthe previous HWND used by this object before
See also
setHostedWindow(), hostedWindow()

◆ resizeEvent()

void resizeEvent ( QResizeEvent *  event)
overrideprotected

◆ moveEvent()

void moveEvent ( QMoveEvent *  event)
overrideprotected

◆ focusInEvent()

void focusInEvent ( QFocusEvent *  event)
overrideprotected

◆ showEvent()

void showEvent ( QShowEvent *  event)
overrideprotected

◆ hideEvent()

void hideEvent ( QHideEvent *  event)
overrideprotected

◆ event()

bool event ( QEvent *  event)
overrideprotected

◆ nativeEvent()

bool nativeEvent ( const QByteArray &  eventType,
void msg,
long *  result 
)
overrideprotected