通过QPlatformIntegration *platformIntegration来创建。
创建windows窗口过程:

qtbase\src\plugins\platforms\windows\qwindowsglcontext.cpp
HWND QWindowsContext::createDummyWindow(const QString &classNameIn,
const wchar_t *windowName,
WNDPROC wndProc, DWORD style)
{
if (!wndProc)
wndProc = DefWindowProc;
QString className = registerWindowClass(classNameIn, wndProc);
return CreateWindowEx(0, reinterpret_cast<LPCWSTR>(className.utf16()),
windowName, style,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
HWND_MESSAGE, NULL, static_cast<HINSTANCE>(GetModuleHandle(0)), NULL);
}
创建窗口opengl上下

本文探讨了C++ Qt框架如何根据操作系统决定使用哪种窗口。通过QPlatformIntegration实例化,特别是对于Windows系统,Qt支持Direct2D、Minimal、Offscreen、WebGL和Windows等类型的窗口,这些窗口在MSVC2017的plugins/platforms/qwindowsd.dll中创建。
468

被折叠的 条评论
为什么被折叠?



