[PyQt] Mouse pointer changing shape (blinking) on signals and QLineEdit text cursor blink

David Morris othalan at othalan.net
Tue May 14 20:39:24 BST 2019


Updates (but no fix):

I updated my mac to MacOS 10.14.5 and the problem persists.
I tried some examples from PyQt5 and all exhibit the same behavior.

However, Designer does NOT exhibit this behavior, and I understand it is
written in Qt.  Is this a PyQt5 bug on MacOS?

FYI, I installed PyQt5 using:  pip install pyqt5

Can anyone on MacOS Mojave replicate this with my example code?

David

On Tue, May 14, 2019 at 4:22 PM David Morris <othalan at othalan.net> wrote:

> I am developing a small media player application using PyQt5 on MacOS
> Mojave. Any time the mouse is hovering over a widget where the mouse
> pointer changes shape, the mouse pointer begins to blink (flash?), changing
> shape between the normal mouse pointer and the alternate mouse pointer.
>
> For example, if I create a QLineEdit widget the mouse pointer changes to
> an I-Beam as the alternate pointer when hovering over the widget.
> Ordinarily this the mouse pointer simply changes shape so long as I am
> hovering over the widget. However, in the below test application the mouse
> pointer continually changes shape between the I-Beam pointer and the normal
> arrow mouse pointer, changing back and forth at the same rate as the input
> position cursor in the widget.
>
> Example code showing this behavior on my system:
>
> import sysfrom PyQt5               import QtWidgetsfrom PyQt5               import QtCore
>
> class MainWindow(QtWidgets.QMainWindow):
>     sig = QtCore.pyqtSignal()
>     def __init__(self):
>         super().__init__()
>         self.resize(400,400)
>         self.cw = QtWidgets.QWidget(self)
>         self.setCentralWidget(self.cw)
>         self.l = QtWidgets.QVBoxLayout(self.cw)
>         self.le = QtWidgets.QLineEdit(self.cw)
>         self.l.addWidget(self.le)
>         self.label = QtWidgets.QLabel()
>         self.l.addWidget(self.label)
>         self.show()
>
> app=QtWidgets.QApplication([sys.argv])
> w=MainWindow()
> app.setActiveWindow(w)
> exit_code = app.exec_()
>
> sys.exit(exit_code)
>
> In the above code I can fix the problem by disabling the line edit cursor
> flash using app.setCursorFlashTime(0). However, this does NOT fix the
> problem in my application. In my application, signals in other widgets will
> also cause the same mouse pointer shape changing (blinking) behavior.
>
> Version details:
> *MacOS* Mojave 10.14.1
> *PyQt5* 5.12.2
> *Python* 3.7.3
>
> I have developed QtApplications in the past and never observed this
> behavior and am at a loss as to why this is happening.
>
> It occurred to me this could be a MacOS bug, but I am unable to update my
> system at the moment (I am on a very poor internet connection and the
> update is huge).
>
> Does anyone have a solution for this highly irritating behavior?
>
> EDIT: Change "mouse cursor" to "mouse pointer" for clarity.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190514/90a2f40d/attachment-0001.html>


More information about the PyQt mailing list