Closed SeaYJ closed 3 months ago
感谢你的pr,但是expose event那部分没法接受,因为qt源码里就是直接使用的,qwk得保持一致。README 里那些问题我手动改掉了。
// qwidgetwindow.cpp
void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
{
// ...
if (exposed) {
// QTBUG-39220, QTBUG-58575: set all (potentially fully obscured parent widgets) mapped.
m_widget->setAttribute(Qt::WA_Mapped);
for (QWidget *p = m_widget->parentWidget(); p && !p->testAttribute(Qt::WA_Mapped); p = p->parentWidget())
p->setAttribute(Qt::WA_Mapped);
if (!event->m_region.isNull()) // 此处
wPriv->syncBackingStore(event->m_region);
} else {
m_widget->setAttribute(Qt::WA_Mapped, false);
}
}
修复 Qt6 Widget 的编译警告
请参考 https://doc.qt.io/qt-6.5/qexposeevent.html 'const QRegion &QExposeEvent::region() const' This function is deprecated since 6.0. We strongly advise against using it in new code. Use QPaintEvent instead. Returns the window area that has been exposed. The region is given in local coordinates.
这个函数已经在 Qt6.0 中被废弃,所以我增加了版本判断并修复了在 Qt6 中的问题。
README 完善