diff options
Diffstat (limited to 'qutebrowser/mainwindow/mainwindow.py')
-rw-r--r-- | qutebrowser/mainwindow/mainwindow.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 067c5b8c0..a3e6722af 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -88,12 +88,12 @@ def get_window(*, via_ipc: bool, def raise_window(window, alert=True): """Raise the given MainWindow object.""" - window.setWindowState(window.windowState() & ~Qt.WindowMinimized) - window.setWindowState(window.windowState() | Qt.WindowActive) + window.setWindowState(window.windowState() & ~Qt.WindowState.WindowMinimized) + window.setWindowState(window.windowState() | Qt.WindowState.WindowActive) window.raise_() # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-69568 QCoreApplication.processEvents( # type: ignore[call-overload] - QEventLoop.ExcludeUserInputEvents | QEventLoop.ExcludeSocketNotifiers) + QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents | QEventLoop.ProcessEventsFlag.ExcludeSocketNotifiers) if not sip.isdeleted(window): # Could be deleted by the events run above @@ -202,10 +202,10 @@ class MainWindow(QWidget): from qutebrowser.mainwindow import tabbedbrowser from qutebrowser.mainwindow.statusbar import bar - self.setAttribute(Qt.WA_DeleteOnClose) + self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose) if config.val.window.transparent: - self.setAttribute(Qt.WA_TranslucentBackground) - self.palette().setColor(QPalette.Window, Qt.transparent) + self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) + self.palette().setColor(QPalette.ColorRole.Window, Qt.GlobalColor.transparent) self._overlays: MutableSequence[_OverlayInfoType] = [] self.win_id = next(win_id_gen) @@ -305,7 +305,7 @@ class MainWindow(QWidget): if not widget.isVisible(): return - if widget.sizePolicy().horizontalPolicy() == QSizePolicy.Expanding: + if widget.sizePolicy().horizontalPolicy() == QSizePolicy.Policy.Expanding: width = self.width() - 2 * padding if widget.hasHeightForWidth(): height = widget.heightForWidth(width) @@ -561,10 +561,10 @@ class MainWindow(QWidget): def _set_decoration(self, hidden): """Set the visibility of the window decoration via Qt.""" - window_flags: int = Qt.Window + window_flags: int = Qt.WindowType.Window refresh_window = self.isVisible() if hidden: - window_flags |= Qt.CustomizeWindowHint | Qt.NoDropShadowWindowHint + window_flags |= Qt.WindowType.CustomizeWindowHint | Qt.WindowType.NoDropShadowWindowHint self.setWindowFlags(cast(Qt.WindowFlags, window_flags)) if refresh_window: self.show() @@ -575,7 +575,7 @@ class MainWindow(QWidget): if on: self.state_before_fullscreen = self.windowState() self.setWindowState( - Qt.WindowFullScreen | # type: ignore[arg-type] + Qt.WindowState.WindowFullScreen | # type: ignore[arg-type] self.state_before_fullscreen) # type: ignore[operator] elif self.isFullScreen(): self.setWindowState(self.state_before_fullscreen) |