I am trying to get the selection that was listed in the qMenu and based on the user selection from the qMenu - camSelBtn
, it will display the selection into a qLineEdit - currentCamTxt
However while I am able to get the menu working, the selection is not working.
def camMenu(self):
allCams = cmds.ls(type='camera', visible = 1)
camLs = cmds.listRelatives(allCams, p=1)
menu = QMenu("menu", self.camSelBtn)
for n in camLs:
menu.addAction(QAction(n, menu))
self.camSelBtn.setMenu(menu)
def createConnections(self):
self.connect(self.setCameraBtn, SIGNAL('clicked()'), self.setCamera)
def setCamera(self):
for sel in self.camMenu.menu():
self.currentCamTxt.setText()