Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
qwinwidget.h
Go to the documentation of this file.
1// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
2// SPDX-License-Identifier: BSD-3-Clause
3
4// Declaration of the QWinWidget classes
5
6#ifndef QWINWIDGET_H
7#define QWINWIDGET_H
8
10#include <QWidget>
11
12class CWnd;
13
14class KDWINUTILS_EXPORT QWinWidget : public QWidget
15{
16 Q_OBJECT
17public:
18 QWinWidget(HWND hParentWnd, QObject *parent = 0, Qt::WindowFlags f = {});
19#ifdef KDWINUTILS_WITHMFC
20 QWinWidget(CWnd *parnetWnd, QObject *parent = 0, Qt::WindowFlags f = {});
21#endif
23
24 void show();
25 void center();
26 void showCentered();
27
28 HWND parentWindow() const;
29
30protected:
31 void childEvent(QChildEvent *e);
32 bool eventFilter(QObject *o, QEvent *e);
33
34 bool focusNextPrevChild(bool next);
35 void focusInEvent(QFocusEvent *e);
36#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
37 bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
38#else
39 bool nativeEvent(const QByteArray &eventType, void *message, long *result);
40#endif
41
42private:
43 void init();
44
45 void saveFocus();
46 void resetFocus();
47
48 HWND hParent;
49 HWND prevFocus;
50 bool reenable_parent;
51};
52
53#endif // QWINWIDGET_H
The QWinWidget class is a Qt widget that can be child of a native Win32 widget.
Definition qwinwidget.h:15
#define KDWINUTILS_EXPORT
Definition kdwinutils_export.h:31