<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi everyone,</DIV>
<DIV> </DIV>
<DIV>I’m trying to develop a dockable version of a QTabWidget, since I saw that
pyqt does not support it natively. Up to now I tried to realize it using the
QDockWidget class, here is some code which shows what I did:</DIV>
<DIV> </DIV>
<DIV>from PyQt4.QtCore import *</DIV>
<DIV>from PyQt4.QtGui import *</DIV>
<DIV> </DIV>
<DIV>class DockTabWidget(QMainWindow):</DIV>
<DIV> def __init__(self):</DIV>
<DIV> QMainWindow.__init__(self)</DIV>
<DIV> self.resize(1000, 700)</DIV>
<DIV>
self.setTabPosition(Qt.AllDockWidgetAreas, QTabWidget.North)</DIV>
<DIV> self.dock_list = []</DIV>
<DIV> </DIV>
<DIV> def AddComponent(self, component, label) :</DIV>
<DIV> d = QDockWidget(self.tr(label),
self)</DIV>
<DIV>
d.setAllowedAreas(Qt.AllDockWidgetAreas)</DIV>
<DIV> d.setWidget(component)</DIV>
<DIV> self.dock_list.append(d)</DIV>
<DIV>
self.addDockWidget(Qt.LeftDockWidgetArea, d, Qt.Horizontal)</DIV>
<DIV> if len(self.dock_list) > 1
:</DIV>
<DIV> index =
len(self.dock_list)-1</DIV>
<DIV>
self.tabifyDockWidget(self.dock_list[-2], self.dock_list[-1])</DIV>
<DIV> if not
hasattr(self, "tab_bar") :</DIV>
<DIV>
self.tab_bar = self.findChildren(QTabBar)[0]</DIV>
<DIV>
self.tab_bar.setTabsClosable(True)</DIV>
<DIV>
self.tab_bar.setMovable(True)</DIV>
<DIV> </DIV>
<DIV> def Test(self, index) :</DIV>
<DIV> print index</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>if __name__ == "__main__" :</DIV>
<DIV> import sys</DIV>
<DIV> a = QApplication(sys.argv)</DIV>
<DIV> dia = DockTabWidget()</DIV>
<DIV> dia.AddComponent(QWidget(), "t1")</DIV>
<DIV> dia.AddComponent(QWidget(), "t2")</DIV>
<DIV> dia.AddComponent(QWidget(), "t3")</DIV>
<DIV> dia.show()</DIV>
<DIV> a.exec_()</DIV>
<DIV> </DIV>
<DIV>My problem is that the tabs of QtabBar cannot be used to drag away the
pages and I’m forced to use the title bar, which I would like to be removed. Can
anyone point me out if there is any way to achieve these goals (drag ffrom tabs
and remove title bar)? Alternatively, is there any other way to realize a
dockable QTabWidget? </DIV>
<DIV>Thanks in advance for your help!</DIV></DIV></DIV></BODY></HTML>