[PyQt] weirdness with PyQt4 setWhatsThis function

Tony Willis twillis449 at gmail.com
Mon Aug 22 21:32:40 BST 2016


The little script below gives the simplest possible example of using the 
PyQt setWhatsThis help function. My problem: the script runs fine on 
Ubuntu 16.04 when one uses the KDE or Xfce desktop environment - the 
help window pops up and the text is displayed. When I run it in the 
UNITY / gnome desktop environment the help window pops up but NO text is 
displayed.  So somehow gnome is suppressing the text display. Has anyone 
else encountered this problem? If so, is there a simple workaround?

My environment - Ubuntu 16.04 with PyQt4.

Thanks

Tony

#####################
!/usr/bin/env python

# use shift+f1 to get a help display to pop up

import sys
import PyQt4.Qt as Qt

class DemoMainWindow(Qt.QMainWindow):

     def __init__(self, parent=None):
         Qt.QMainWindow.__init__(self, parent)
         self.setWhatsThis("This is a demo showing QWhatsThis does or 
does not work")

     # __init__()

# class DemoMainWindow

if __name__ == '__main__':
     app = Qt.QApplication(sys.argv)
     demo = DemoMainWindow()
     demo.resize(500, 500)
     demo.show()
     sys.exit(app.exec_())



More information about the PyQt mailing list