Repository: spyder-ide/spyder

Issue:
TypeError in Tour with Python 3.10
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [X] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ X] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ X] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [not appliable ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ X] Tried basic troubleshooting (if a bug/error)
    * [not appliable ] Restarted Spyder
    * [ X] Reset preferences with ``spyder --reset``
    * [ not appliable] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ not appliable] Tried the other applicable steps from the Troubleshooting Guide
* [ X] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description

Spyder does not start/work with python 3.10.
The error returned is:

```python-traceback
TypeError: arguments did not match any overloaded call:
  scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
  scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
```


### What steps reproduce the problem?

1. Upgrade to (or install) python 3.10
2. follow the steps to install Spyder using pip (python3 -m venv spyder-env -> source spyder-env/bin/activate -> pip3 install spyder)
3. launch Spyder with the commmand spyder

### What is the expected output? What do you see instead?
Expected: to start the Spyder IDE
I see the error

### Paste Traceback/Error Below (if applicable)

```python-traceback
Traceback (most recent call last):
  File "/home/fellype/progs_nao_instalaveis/spyder-env/bin/spyder", line 8, in <module>
    sys.exit(main())
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/start.py", line 236, in main
    mainwindow.main(options, args)
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/mainwindow.py", line 1992, in main
    mainwindow = create_window(MainWindow, app, splash, options, args)
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/utils.py", line 281, in create_window
    main.setup()
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/mainwindow.py", line 875, in setup
    PLUGIN_REGISTRY.register_plugin(self, PluginClass,
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/api/plugin_registration/registry.py", line 274, in register_plugin
    instance = self._instantiate_spyder5_plugin(
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/api/plugin_registration/registry.py", line 152, in _instantiate_spyder5_plugin
    plugin_instance = PluginClass(main_window, configuration=CONF)
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/api/plugins/new_api.py", line 294, in __init__
    self._container = container = self.CONTAINER_CLASS(
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/plugins/tours/container.py", line 48, in __init__
    self._tour_dialog = OpenTourDialog(
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/plugins/tours/widgets.py", line 1074, in __init__
    image = image.scaled(image_width, image_height, Qt.KeepAspectRatio,
TypeError: arguments did not match any overloaded call:
  scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
  scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 5.1.5 (from pip)
* Python version: 3.10.0 (from OS)
* Qt version: 5.15.3 (from OS)
* PyQt version: 5.12.3 (from pip)
* Operating System name/version: Slackware Linux - current (pre 15.0)

Additional info:
Spyder was working fine with python 3.9.7 in the same environment


Discussion:
Hey @Fellypao, thanks for reporting. We'll try to address this problem in a future release.
In the meantime, please use Python 3.9 instead.

Resolving patch:
diff --git a/spyder/plugins/tours/widgets.py b/spyder/plugins/tours/widgets.py
--- a/spyder/plugins/tours/widgets.py
+++ b/spyder/plugins/tours/widgets.py
@@ -1069,8 +1069,8 @@ def __init__(self, parent, tour_function):
         image_path = get_image_path(icon_filename)
         image = QPixmap(image_path)
         image_label = QLabel()
-        image_height = image.height() * DialogStyle.IconScaleFactor
-        image_width = image.width() * DialogStyle.IconScaleFactor
+        image_height = int(image.height() * DialogStyle.IconScaleFactor)
+        image_width = int(image.width() * DialogStyle.IconScaleFactor)
         image = image.scaled(image_width, image_height, Qt.KeepAspectRatio,
                              Qt.SmoothTransformation)
         image_label.setPixmap(image)


Test patch: