Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41902

isVisible is always true for tabified docks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.8.6, 5.3.1
    • Widgets: Main Window
    • None
    • PyQt with Qt 5.3.1 and 4.8.6 on Arch Linux

      If a dock widget is tabified in a QMainWindow, its isVisible-method will always return true. However, it should only return true for the widget associated with the current tab (this is the case in a QTabWidget).

      Here is a short example code:

      from PyQt5 import QtCore, QtWidgets as QtGui
      from PyQt5.QtCore import Qt
      #from PyQt4 import QtCore, QtGui
      #from PyQt4.QtCore import Qt
      
      app = QtGui.QApplication([])
      mainWindow = QtGui.QMainWindow()
      
      
      def test():
          print(w1.isVisible(), w1.isVisibleTo(mainWindow))
         
        
      w1 = QtGui.QLabel("Blubb")
      dock1 = QtGui.QDockWidget()
      dock1.setWidget(w1)
      
      w2 = QtGui.QPushButton("Bla")
      w2.clicked.connect(test)
      dock2 = QtGui.QDockWidget()
      dock2.setWidget(w2)
      
      mainWindow.addDockWidget(Qt.LeftDockWidgetArea, dock1)
      mainWindow.tabifyDockWidget(dock1, dock2)
      mainWindow.show()
      
      app.exec_()
      

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

            Unassigned Unassigned
            martinaltmayer Martin Altmayer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes