Repository: spyder-ide/spyder

Issue:
Mouse cursor issue with PyQt 5.10
## Description

**What steps will reproduce the problem?**

1. Push Ctrl key on keyboard
2. Put mouse cursor over any variable: mouse cursor changes from "text select" to "link select"
3. Release Ctrl key on keyboard

**What is the expected output? What do you see instead?**

The mouse cursor should change back to "text select" after releasing the Ctrl key but doesn't !
Same problem when saving file : "text select" cursor goes to "busy" pointer but doesn't go back to "text select" when the saving action is finished. 

**Please provide any additional information below**

I have to get the mouse cursor out of the editor to get back the normal "text select" cursor.

## Version and main components

* Spyder Version: 3.2.6 
* Python Version: 3.6.4
* Qt Versions: 5.10.0, PyQt5 5.10 on Windows

## Dependencies
```
pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.22.0 (OK)
numpy >=1.7      :  1.14.0 (OK)
sphinx >=0.6.6   :  1.6.6 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.9.0     :  0.11.1 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.27.3 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.2.1 (OK)
pylint >=0.25    :  1.8.2 (OK)

```



Discussion:
Thanks for reporting. We'll take a look at this in a future release.
As a note, I was unable to reproduce this on Windows 8.1 with Spyder 3.2.6 and Python 3.6.4, trying many times in different scenarios. Major difference is I was using the standard Qt/PyQt 5.6.2/5.6, while you're using the newer Qt/PyQt 5.10.
Same issue with master release (at least 2 days ago).
With ctrl+S (save the editor). The cursor turns to disk-like and keeps into that state until it moves outside the editor. 
PyQt 5.10 as well. Win10.
This has to be an issue with PyQt 5.10 for sure, so we're going to pin pyqt5 to 5.9.2 in our wheels. There has been several reports that things are failing strangely with 5.10.

For now, please downgrade to 5.9.2 manually.
Downgrading to 5.9.2 worked for me ! Thanks !

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -291,7 +291,7 @@ def run(self):
     'numpydoc',
     # Packages for pyqt5 are only available in
     # Python 3
-    'pyqt5;python_version>="3"',
+    'pyqt5<5.10;python_version>="3"',
     # This is only needed for our wheels on Linux.
     # See issue #3332
     'pyopengl;platform_system=="Linux"'


Test patch:
diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py
--- a/spyder/app/tests/test_mainwindow.py
+++ b/spyder/app/tests/test_mainwindow.py
@@ -179,7 +179,7 @@ def close_window():
 @pytest.mark.slow
 @pytest.mark.use_introspection
 @flaky(max_runs=3)
-@pytest.mark.skipif(os.name == 'nt' or (not PY2 and PYQT_VERSION < "5.9.0"),
+@pytest.mark.skipif(os.name == 'nt' or not PY2,
                     reason="Times out on AppVeyor and fails on PY3/PyQt 5.6")
 @pytest.mark.timeout(timeout=45, method='thread')
 def test_calltip(main_window, qtbot):
@@ -232,6 +232,7 @@ def test_window_title(main_window, tmpdir):
 
     projects.close_project()
 
+
 @pytest.mark.slow
 @pytest.mark.single_instance
 def test_single_instance_and_edit_magic(main_window, qtbot, tmpdir):