Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-243

Error running QApplication.setOverrideCursor example

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 1.2.1
    • PySide
    • None
    • Fedora 20 x64 - reproduces.
      Windows Vista x32 - works ok.
    • 1

      The snippet below is derived from documentation http://pyside.github.io/docs/pyside/PySide/QtGui/QApplication.html#PySide.QtGui.PySide.QtGui.QApplication.setOverrideCursor and sets cursor for current window. Note that line that passes CursorShape as parameter is commented.

      #!/usr/bin/env python
      import sys
      from PySide.QtGui import *
      from PySide.QtCore import *
      
      app = QApplication ( sys.argv )
      
      cursor = QCursor(Qt.WaitCursor)
      shape = Qt.WaitCursor
      print(cursor)
      print(shape)
      QApplication.setOverrideCursor( cursor )
      #QApplication.setOverrideCursor( shape )
      
      window = QLabel("WAIT")
      window.show()
      sys.exit ( app.exec_() )
      

      It works flawlessly on Windows, but fails on Linux (X11):

      $ ./pyside-243.py 
      <PySide.QtGui.QCursor object at 0xb4a08c2c>
      PySide.QtCore.Qt.CursorShape.WaitCursor
      X Error: BadCursor (invalid Cursor parameter) 6
        Major opcode: 2 (X_ChangeWindowAttributes)
        Resource id:  0x3
      

      It works correctly on Linux only when setOverrideCursor() is feeded with CursorShape type object (commented line). On Windows both ways work ok.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            techtonik anatoly techtonik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes