Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert enums to Qt6 style #20364

Open
wants to merge 16 commits into
base: 5.x
Choose a base branch
from
18 changes: 9 additions & 9 deletions external-deps/qdarkstyle/qdarkstyle/example/__main__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion external-deps/qtconsole/qtconsole/call_tip_widget.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion external-deps/qtconsole/qtconsole/completion_widget.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions external-deps/qtconsole/qtconsole/console_widget.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion external-deps/qtconsole/qtconsole/frontend_widget.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions external-deps/qtconsole/qtconsole/mainwindow.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions scripts/spyder.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
IF EXIST "%~dpn0\..\..\python.exe" (
"%~dpn0\..\..\python.exe" "%~dpn0" %*
) ELSE (
python.exe "%~dpn0" %*
)
@echo off
IF EXIST "%~dpn0\..\..\python.exe" (
"%~dpn0\..\..\python.exe" "%~dpn0" %*
) ELSE (
python.exe "%~dpn0" %*
)
6 changes: 3 additions & 3 deletions spyder/api/plugins/new_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def show_status_message(self, message, timeout=0):
def before_long_process(self, message):
"""
Show a message in main window's status bar and change the mouse
pointer to Qt.WaitCursor when starting a long process.
pointer to Qt.CursorShape.WaitCursor when starting a long process.

Parameters
----------
Expand All @@ -632,7 +632,7 @@ def before_long_process(self, message):
if message:
self.show_status_message(message)

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
QApplication.setOverrideCursor(QCursor(Qt.CursorShape.WaitCursor))
QApplication.processEvents()

def after_long_process(self, message=""):
Expand Down Expand Up @@ -1020,7 +1020,7 @@ def __init__(self, parent, configuration):
def before_long_process(self, message):
"""
Show a message in main window's status bar, change the mouse pointer
to Qt.WaitCursor and start spinner when starting a long process.
to Qt.CursorShape.WaitCursor and start spinner when starting a long process.

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions spyder/api/plugins/old_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def remove_option(self, option, section=None):
def starting_long_process(self, message):
"""
Show a message in main window's status bar and changes the
mouse to Qt.WaitCursor when starting a long process.
mouse to Qt.CursorShape.WaitCursor when starting a long process.

Parameters
----------
Expand All @@ -140,7 +140,7 @@ def starting_long_process(self, message):
def ending_long_process(self, message=""):
"""
Clear main window's status bar after a long process and restore
mouse to the OS deault.
mouse to the OS default.

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions spyder/api/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def _setup(self):
name='switch to ' + self._name,
text=self.get_title(),
toggled=lambda checked: self.toggle_view(checked),
context=Qt.WidgetWithChildrenShortcut,
context=Qt.ShortcutContext.WidgetWithChildrenShortcut,
shortcut_context='_',
)

Expand Down Expand Up @@ -440,7 +440,7 @@ def _on_top_level_change(self, top_level):

# Change the cursor shape when dragging
if top_level:
QApplication.setOverrideCursor(Qt.ClosedHandCursor)
QApplication.setOverrideCursor(Qt.CursorShape.ClosedHandCursor)
else:
QApplication.restoreOverrideCursor()

Expand Down
2 changes: 1 addition & 1 deletion spyder/api/widgets/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def _update_action_state(self, action_name, value):
# name where it is applied).
def create_action(self, name, text, icon=None, icon_text='', tip=None,
toggled=None, triggered=None, shortcut_context=None,
context=Qt.WidgetWithChildrenShortcut, initial=None,
context=Qt.ShortcutContext.WidgetWithChildrenShortcut, initial=None,
register_shortcut=False, section=None, option=None,
parent=None, register_action=True, overwrite=False,
context_name=None, menurole=None):
Expand Down
4 changes: 2 additions & 2 deletions spyder/api/widgets/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def set_layout(self):
# See spyder-ide/spyder#9044.
self.text_font = QFont(QFont().defaultFamily(),
weight=QFont.Normal)
self.label_value.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
self.label_value.setAlignment(Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter)
self.label_value.setFont(self.text_font)

# Custom widget
Expand Down Expand Up @@ -143,7 +143,7 @@ def set_layout(self):

layout.addSpacing(0)
layout.setContentsMargins(0, 0, 0, 0)
layout.setAlignment(Qt.AlignVCenter)
layout.setAlignment(Qt.AlignmentFlag.AlignVCenter)

# Setup
self.update_tooltip()
Expand Down
Loading