stdware / qwindowkit

Cross-platform frameless window framework for Qt. Support Windows, macOS, Linux.
Apache License 2.0
538 stars 85 forks source link

Windows 7系统启动并关闭模态窗口QDialog后崩溃 #110

Open KarvinZheng opened 3 months ago

KarvinZheng commented 3 months ago
    auto dwmBlurAction = new QAction(tr("Enable DWM blur"), menuBar);
    dwmBlurAction->setCheckable(true);
    connect(dwmBlurAction, &QAction::toggled, this, [this](bool checked) {

        QDialog dlg(this);
        auto agent = new QWK::WidgetWindowAgent(&dlg);
        agent->setup(&dlg);
        dlg.exec();
        return;

        if (!windowAgent->setWindowAttribute(QStringLiteral("dwm-blur"), checked)) {
            return;
        }
        setProperty("custom-style", checked);
        style()->polish(this);
    });

Qt:5.15.9 操作系统:Windows 7 PS:Windows 10 & Windows 11 正常,Frameless-Helper正常

KarvinZheng commented 2 months ago

目前我改以下代码可以临时解决崩溃的问题: void Win32WindowContext::winIdChanged(WId winId, WId oldWinId) { 。。。 if (!isSystemBorderEnabled() && isWin8OrGreater()) { m_delegate->setWindowFlags(m_host, m_delegate->getWindowFlags(m_host) | Qt::FramelessWindowHint); } 。。。 }

SineStriker commented 2 months ago

需要研究一下。