KDWinUtils
Helper library for MFC to Qt migration
|
The QWinWidget class is a Qt widget that can be child of a native Win32 widget. More...
#include <qwinwidget.h>
Public Member Functions | |
void | center () |
HWND | parentWindow () const |
QWinWidget (CWnd *parnetWnd, QObject *parent=0, Qt::WindowFlags f={}) | |
QWinWidget (HWND hParentWnd, QObject *parent=0, Qt::WindowFlags f={}) | |
void | show () |
void | showCentered () |
~QWinWidget () | |
Protected Member Functions | |
void | childEvent (QChildEvent *e) |
bool | eventFilter (QObject *o, QEvent *e) |
void | focusInEvent (QFocusEvent *e) |
bool | focusNextPrevChild (bool next) |
bool | nativeEvent (const QByteArray &eventType, void *message, qintptr *result) |
The QWinWidget class is a Qt widget that can be child of a native Win32 widget.
The QWinWidget class is the bridge between an existing application user interface developed using native Win32 APIs or toolkits like MFC, and Qt based GUI elements.
Using QWinWidget as the parent of QDialogs will ensure that modality, placement and stacking works properly throughout the entire application. If the child widget is a top level window that uses the WDestructiveClose
flag, QWinWidget will destroy itself when the child window closes down.
Applications moving to Qt can use QWinWidget to add new functionality, and gradually replace the existing interface.
QWinWidget::QWinWidget | ( | HWND | hParentWnd, |
QObject * | parent = 0, | ||
Qt::WindowFlags | f = {} ) |
Creates an instance of QWinWidget. hParentWnd is the handle to the native Win32 parent. If a parent is provided the object is owned by that QObject. f is passed on to the QWidget constructor.
QWinWidget::QWinWidget | ( | CWnd * | parentWnd, |
QObject * | parent = 0, | ||
Qt::WindowFlags | f = {} ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Creates an instance of QWinWidget. parentWnd is a pointer to an MFC window object. If a parent is provided the object is owned by that QObject. f is passed on to the QWidget constructor.
QWinWidget::~QWinWidget | ( | ) |
Destroys this object, freeing all allocated resources.
void QWinWidget::center | ( | ) |
Centers this widget over the native parent window. Use this function to have Qt toplevel windows (i.e. dialogs) positioned correctly over their native parent windows.
This will center the message box over the client area of hParent.
|
protected |
\reimp
|
protected |
\reimp
|
protected |
\reimp
|
protected |
\reimp
|
protected |
\reimp
HWND QWinWidget::parentWindow | ( | ) | const |
Returns the handle of the native Win32 parent window.
void QWinWidget::show | ( | ) |
Shows this widget. Overrides QWidget::show().
void QWinWidget::showCentered | ( | ) |
\obsolete
Call center() instead.