[PyQt] opening Dock widget as a tab

vidyadhar ankurtilve2003 at yahoo.com
Sat Jul 18 11:50:18 BST 2009


I am creating a dock widget dynamically at runtime.
problem i am facing is
1> i have to open a dock widget containing two tree widgets as a tab
dynamically at runtime
2>also the tabs of dock widget should be placed above the dock widget and
not below the widget .

please help me out as i have no one here to answer my question and on my own
to complete the project.

Thanking you in advance.
here is my code..

def createdockProject(self):
        self.dockUser = QtGui.QDockWidget(self.obj)
       
self.dockUser.setFeatures(QtGui.QDockWidget.DockWidgetClosable|QtGui.QDockWidget.DockWidgetMovable)
        #self.dockUser.setObjectName("dockUser_%s"%(self.title))
        self.dockWidgetContents = QtGui.QWidget(self.dockUser)
        self.dockWidgetContents.setObjectName("dockWidgetContents")
        self.gridLayout = QtGui.QGridLayout(self.dockWidgetContents)
        #self.gridLayout.setObjectName("gridLayout")
        self.tree = QtGui.QTreeWidget(self.dockWidgetContents)
        self.tree.setAlternatingRowColors(True)
        self.tree.setHeaderLabel("")
        self.tree.setHeaderHidden(True)
        self.tree.setObjectName("tree1")
        self.gridLayout.addWidget(self.tree,0,1,1,2)
        self.tree1 = QtGui.QTreeWidget(self.dockWidgetContents)
        self.tree1.setAlternatingRowColors(True)
        self.tree1.setHeaderLabel("")
        self.tree1.setHeaderHidden(True)
        self.gridLayout.addWidget(self.tree1,0,0,1,1)
        self.dockUser.setWidget(self.dockWidgetContents)
       
self.obj.addDockWidget(QtCore.Qt.BottomDockWidgetArea,self.dockUser,QtCore.Qt.Horizontal)
        self.firstDockWidget.setWidget(self.dockUser)
-- 
View this message in context: http://www.nabble.com/opening-Dock-widget-as-a-tab-tp24546676p24546676.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list