2023-03-29 14:46:41 +00:00
|
|
|
// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
|
|
|
|
// Declaration of the QWinWidget classes
|
|
|
|
|
|
|
|
#ifndef QWINWIDGET_H
|
|
|
|
#define QWINWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2023-03-30 10:20:26 +00:00
|
|
|
#include "qmfcapp.hpp"
|
2023-03-29 14:46:41 +00:00
|
|
|
|
|
|
|
class CWnd;
|
|
|
|
|
|
|
|
class QWinWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QWinWidget( HWND hParentWnd, QObject *parent = 0, Qt::WindowFlags f = 0 );
|
|
|
|
#ifdef QTWINMIGRATE_WITHMFC
|
|
|
|
QWinWidget( CWnd *parnetWnd, QObject *parent = 0, Qt::WindowFlags f = 0 );
|
|
|
|
#endif
|
|
|
|
~QWinWidget();
|
|
|
|
|
|
|
|
void show();
|
|
|
|
void center();
|
|
|
|
void showCentered();
|
|
|
|
|
|
|
|
HWND parentWindow() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void childEvent( QChildEvent *e );
|
|
|
|
bool eventFilter( QObject *o, QEvent *e );
|
|
|
|
|
|
|
|
bool focusNextPrevChild(bool next);
|
|
|
|
void focusInEvent(QFocusEvent *e);
|
|
|
|
#if QT_VERSION >= 0x050000
|
|
|
|
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
|
|
|
|
#else
|
|
|
|
bool winEvent(MSG *msg, long *result);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
void init();
|
|
|
|
|
|
|
|
void saveFocus();
|
|
|
|
void resetFocus();
|
|
|
|
|
|
|
|
HWND hParent;
|
|
|
|
HWND prevFocus;
|
|
|
|
bool reenable_parent;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QWINWIDGET_H
|