Guest User

Untitled

a guest
Nov 22nd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. self.iface.actionPanToSelected().trigger()
  2.  
  3. from PyQt4.QtGui import QToolBar
  4. for x in iface.mainWindow().findChildren(QToolBar):
  5. # x.objectName() returns the names of the toolbars
  6. if x.objectName() == 'Example':
  7. print x.children()
  8.  
  9. [<PyQt4.QtGui.QLayout object at 0x0000000023589840>, <PyQt4.QtGui.QToolButton object at 0x0000000024DCE488>, <PyQt4.QtGui.QAction object at 0x0000000024DCE510>,
  10. <PyQt4.QtGui.QToolButton object at 0x0000000024DCE598>, <PyQt4.QtGui.QToolButton object at 0x0000000024DCE620>]
  11.  
  12. self.actionCopy = QAction( icon, u"Copy selected layers and groups to clipboard (Ctrl+Ins)", self.iface.mainWindow() )
  13. self.actionCopy.setObjectName('mActionCopyLayersToClipboard')
  14.  
  15. from PyQt4.QtGui import QAction
  16. iface.mainWindow().findChild( QAction, 'mActionCopyLayersToClipboard' ).trigger()
Add Comment
Please, Sign In to add comment