1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//! [0] button = QPushButton(QObject.tr("Ro&ck && Roll"), self) //! [0] //! [1] button.setIcon(QIcon(":/images/print.png")) button.setShortcut(tr("Alt+F7")) //! [1] //! [2] class MyWidget (QWidget): #... def reactToToggle(checked): if checked: // Examine the button states. ... //! [2]