fix: Correct window flag type for close button hint in update dialogs

This commit is contained in:
claudi 2026-01-29 08:48:29 +01:00
parent 41549848ed
commit 50311139bf
2 changed files with 5 additions and 4 deletions

View file

@ -13,6 +13,7 @@ import logging
from pathlib import Path from pathlib import Path
from PySide6.QtCore import Qt, Signal from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QDialog, QDialog,
QHBoxLayout, QHBoxLayout,
@ -43,7 +44,7 @@ class CheckingDialog(QDialog):
self.setWindowTitle("Checking for Updates") self.setWindowTitle("Checking for Updates")
self.setModal(True) self.setModal(True)
self.setMinimumWidth(300) self.setMinimumWidth(300)
self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) self.setWindowFlags(self.windowFlags() & ~Qt.WindowType.WindowCloseButtonHint)
layout = QVBoxLayout() layout = QVBoxLayout()
@ -165,7 +166,7 @@ class DownloadingDialog(QDialog):
self.setWindowTitle("Downloading Update") self.setWindowTitle("Downloading Update")
self.setModal(True) self.setModal(True)
self.setMinimumWidth(350) self.setMinimumWidth(350)
self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) self.setWindowFlags(self.windowFlags() & ~Qt.WindowType.WindowCloseButtonHint)
layout = QVBoxLayout() layout = QVBoxLayout()

View file

@ -44,7 +44,7 @@ class TestCheckingDialog:
"""Test dialog has no close button.""" """Test dialog has no close button."""
dialog = CheckingDialog() dialog = CheckingDialog()
# WindowCloseButtonHint should be removed # WindowCloseButtonHint should be removed
assert not (dialog.windowFlags() & Qt.WindowCloseButtonHint) assert not (dialog.windowFlags() & Qt.WindowType.WindowCloseButtonHint)
class TestUpdateAvailableDialog: class TestUpdateAvailableDialog:
@ -141,7 +141,7 @@ class TestDownloadingDialog:
def test_no_close_button(self, qapp): def test_no_close_button(self, qapp):
"""Test dialog has no close button.""" """Test dialog has no close button."""
dialog = DownloadingDialog() dialog = DownloadingDialog()
assert not (dialog.windowFlags() & Qt.WindowCloseButtonHint) assert not (dialog.windowFlags() & Qt.WindowType.WindowCloseButtonHint)
class TestInstallDialog: class TestInstallDialog: