from PySide import QtCore,QtGui
import sys
class ToolBarUI(QtGui.QMainWindow):
def __init__(self,*args,**kwargs):
super(ToolBarUI,self).__init__(*args,**kwargs)
self.floatingToolBar()
pass
def buttons(self):
self.btnVLay=QtGui.QVBoxLayout()
self.incSavbtn=QtGui.QPushButton("Save")
self.emailbtn=QtGui.QPushButton("Email")
self.upldbtn=QtGui.QPushButton("Upload")
self.setPrjbtn=QtGui.QPushButton("Set Project")
self.setThumb=QtGui.QPushButton("Set thumb")
self.shwMatbtn=QtGui.QPushButton("Show Material")
self.fixtexbtn=QtGui.QPushButton("Fix Texture Paths")
btns = [self.incSavbtn,self.emailbtn,self.upldbtn,self.setPrjbtn,self.setPrjbtn,self.setThumb,self.shwMatbtn,self.fixtexbtn]
[self.btnVLay.addWidget(each) for each in btns]
def floatingToolBar(self):
self.buttons()
self.setLayout(self.btnVLay)
self.show()
pass
if __name__ =='__main__':
app = QtGui.QApplication(sys.argv)
app.setStyle("cleanlooks")
win = ToolBarUI()
win.floatingToolBar()
sys.exit(app.exec_())
why the above code is showing an empty window , I am trying to stack buttons in VBoxLayout()..
any idea what am i forgetting ?