[PyQt] Possible bug with dock widgets in PyQt5

Ben cuddlykittens11 at aol.com
Tue Aug 19 04:26:21 BST 2014


I'm encountering a really weird issue with PyQt5.  I'm trying to use 
Dock Widgets  and I keep on getting these issues with "lingering 
docks."  If I switch over to PyQt4, it works all fine.  I'm using 
xubuntu 14.04 and python 3.x if that matters.

Here is a screenshot of some: http://i.imgur.com/0wadhh8.png

And here is some code:
--------
     # File:           dock_test.py
     # Author:         Ben Summerton  (define-private-public)
     # Description:    Made out of my frustration in trying to 
understand dock widgets.  I decided to take a break from the regular
     #                 development of the app to get these dock widgets 
working.

     import sys
     from PyQt5.QtCore import *
     from PyQt5.QtGui import *
     from PyQt5.QtWidgets import *


     class DockedApp(QMainWindow):

         def __init__(self, parent=None):
             super(DockedApp, self).__init__(parent)

             self.setWindowTitle('Docked App')
             self.setGeometry(200, 200, 640, 480)

             # Central Widget
             self.textEdit = QTextEdit()
             self.setCentralWidget(self.textEdit)

             # Create the dock windows
             dock = QDockWidget('A Label for you', self)
             dock.setAllowedAreas(Qt.TopDockWidgetArea | 
Qt.BottomDockWidgetArea)
             self.lolipop = QLabel('Dr. Lolipop, M.D.', dock)
             dock.setWidget(self.lolipop)
             self.addDockWidget(Qt.TopDockWidgetArea, dock)





     def main():
         app = QApplication(sys.argv)

         da = DockedApp()
         da.show()
         sys.exit(app.exec_())


     main()
--------

I also took the dock widgets example and tried that out, and it breaks 
as well.  So far the only remedy is to reboot my OS. Restarting lightdm 
doesn't even fix it.

I'd really like to use Qt5, but this is a really big problem.

Thanks,
~Ben


More information about the PyQt mailing list