(self)
Creates a main menu with two entries: a File menu, to allow the image
            to be selected, and a Brightness menu to allow the brightness of the
            separations to be changed.
            Initially, the Brightness menu items are disabled, but the first entry in
            the menu is checked to reflect the default brightness.
Creates a main menu with two entries: a File menu, to allow the image
            to be selected, and a Brightness menu to allow the brightness of the
            separations to be changed.
            Initially, the Brightness menu items are disabled, but the first entry in
            the menu is checked to reflect the default brightness.
Creates a main menu with two entries : a File menu to allow the image to be selected and a Brightness menu to allow the brightness of the separations to be changed . Initially the Brightness menu items are disabled but the first entry in the menu is checked to reflect the default brightness .
def createMenus(self):
        """ Creates a main menu with two entries: a File menu, to allow the image
            to be selected, and a Brightness menu to allow the brightness of the
            separations to be changed.
            Initially, the Brightness menu items are disabled, but the first entry in
            the menu is checked to reflect the default brightness.
        """
        self.fileMenu = QMenu("&File", self)
        self.brightnessMenu = QMenu("&Brightness", self)

        self.openAction = self.fileMenu.addAction("&Open...")
        self.openAction.setShortcut(QKeySequence('Ctrl+O'))
        self.saveAction = self.fileMenu.addAction("&Save...")
        self.saveAction.setShortcut(QKeySequence('Ctrl+S'))
        self.saveAction.setEnabled(False)
        self.quitAction = self.fileMenu.addAction("E&xit")
        self.quitAction.setShortcut(QKeySequence('Ctrl+Q'))

        self.noBrightness = self.brightnessMenu.addAction("&0%")
        self.noBrightness.setCheckable(True)
        self.quarterBrightness = self.brightnessMenu.addAction("&25%")
        self.quarterBrightness.setCheckable(True)
        self.halfBrightness = self.brightnessMenu.addAction("&50%")
        self.halfBrightness.setCheckable(True)
        self.threeQuartersBrightness = self.brightnessMenu.addAction("&75%")
        self.threeQuartersBrightness.setCheckable(True)
        self.fullBrightness = self.brightnessMenu.addAction("&100%")
        self.fullBrightness.setCheckable(True)

        self.menuMap[self.noBrightness] = self.Gloom
        self.menuMap[self.quarterBrightness] = self.Quarter
        self.menuMap[self.halfBrightness] = self.Half
        self.menuMap[self.threeQuartersBrightness] = self.ThreeQuarters
        self.menuMap[self.fullBrightness] = self.Full

        self.currentBrightness = self.fullBrightness
        self.currentBrightness.setChecked(True)
        self.brightnessMenu.setEnabled(False)

        self.menuBar().addMenu(self.fileMenu)
        self.menuBar().addMenu(self.brightnessMenu)

        self.openAction.triggered.connect(self.chooseFile)
        self.saveAction.triggered.connect(self.saveImage)
        self.quitAction.triggered.connect(QApplication.instance().quit)
        self.brightnessMenu.triggered.connect(self.setBrightness)
def createMenus ( self ) : self . fileMenu = QMenu ( "&File" , self ) self . brightnessMenu = QMenu ( "&Brightness" , self ) self . openAction = self . fileMenu . addAction ( "&Open..." ) self . openAction . setShortcut ( QKeySequence ( 'Ctrl+O' ) ) self . saveAction = self . fileMenu . addAction ( "&Save..." ) self . saveAction . setShortcut ( QKeySequence ( 'Ctrl+S' ) ) self . saveAction . setEnabled ( False ) self . quitAction = self . fileMenu . addAction ( "E&xit" ) self . quitAction . setShortcut ( QKeySequence ( 'Ctrl+Q' ) ) self . noBrightness = self . brightnessMenu . addAction ( "&0%" ) self . noBrightness . setCheckable ( True ) self . quarterBrightness = self . brightnessMenu . addAction ( "&25%" ) self . quarterBrightness . setCheckable ( True ) self . halfBrightness = self . brightnessMenu . addAction ( "&50%" ) self . halfBrightness . setCheckable ( True ) self . threeQuartersBrightness = self . brightnessMenu . addAction ( "&75%" ) self . threeQuartersBrightness . setCheckable ( True ) self . fullBrightness = self . brightnessMenu . addAction ( "&100%" ) self . fullBrightness . setCheckable ( True ) self . menuMap [ self . noBrightness ] = self . Gloom self . menuMap [ self . quarterBrightness ] = self . Quarter self . menuMap [ self . halfBrightness ] = self . Half self . menuMap [ self . threeQuartersBrightness ] = self . ThreeQuarters self . menuMap [ self . fullBrightness ] = self . Full self . currentBrightness = self . fullBrightness self . currentBrightness . setChecked ( True ) self . brightnessMenu . setEnabled ( False ) self . menuBar ( ) . addMenu ( self . fileMenu ) self . menuBar ( ) . addMenu ( self . brightnessMenu ) self . openAction . triggered . connect ( self . chooseFile ) self . saveAction . triggered . connect ( self . saveImage ) self . quitAction . triggered . connect ( QApplication . instance ( ) . quit ) self . brightnessMenu . triggered . connect ( self . setBrightness )