Skip to content

Commit cc65c4d

Browse files
committed
fix compilation error
1 parent 7cd6c96 commit cc65c4d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/widgets/widgetwindowagent_win.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,18 @@ namespace QWK {
105105

106106
// Since a QExposeEvent will be sent immediately after the QResizeEvent, we can
107107
// simply ignore it.
108+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
109+
struct ExposeEvent : public QExposeEvent {
110+
inline const QRegion &getRegion() const { return m_region; }
111+
};
112+
auto ee = static_cast<ExposeEvent *>(event);
113+
bool exposeRegionValid = !ee->getRegion().isNull();
114+
#else
108115
auto ee = static_cast<QExposeEvent *>(event);
116+
bool exposeRegionValid = !ee->region().isNull();
117+
#endif
109118
auto window = widget->windowHandle();
110-
if (window->isExposed() && isNormalWindow() && !ee->region().isNull()) {
119+
if (window->isExposed() && isNormalWindow() && exposeRegionValid) {
111120
forwardEventToWindowAndDraw(window, event);
112121
return true;
113122
}

0 commit comments

Comments
 (0)