Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
qwinhost.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 QWinHost classes
5
6#ifndef QWINHOST_H
7#define QWINHOST_H
8
10#include <QWidget>
11
12class KDWINUTILS_EXPORT QWinHost : public QWidget
13{
14 Q_OBJECT
15public:
16 QWinHost(QWidget *parent = 0, Qt::WindowFlags f = {});
17 ~QWinHost();
18
19 void setWindow(HWND);
20 HWND window() const;
21
22protected:
23 virtual HWND createWindow(HWND parent, HINSTANCE instance);
24
25 bool event(QEvent *e);
26 void showEvent(QShowEvent *);
27 void focusInEvent(QFocusEvent *);
28 void resizeEvent(QResizeEvent *);
29
30#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
31 bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
32#else
33 bool nativeEvent(const QByteArray &eventType, void *message, long *result);
34#endif
35
36private:
37 void fixParent();
38 friend void *getWindowProc(QWinHost *);
39
40 void *wndproc;
41 bool own_hwnd;
42 HWND hwnd;
43};
44
45#endif // QWINHOST_H
The QWinHost class provides an API to use native Win32 windows in Qt applications.
Definition qwinhost.h:13
#define KDWINUTILS_EXPORT
Definition kdwinutils_export.h:31
void * getWindowProc(QWinHost *host)
Definition qwinhost.cpp:155