code_app/modules/twainui/qwinwidget.hpp

55 lines
1.1 KiB
C++
Raw Normal View History

2023-04-20 09:49:48 +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>
#include "qmfcapp.hpp"
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