55 lines
1.1 KiB
C
55 lines
1.1 KiB
C
|
// 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>
|
||
|
#include "qmfcapp.h"
|
||
|
|
||
|
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
|