Python PyQt5.QtCore.Qt.Key_Plus() Examples

The following are 5 code examples of PyQt5.QtCore.Qt.Key_Plus(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtCore.Qt , or try the search function .
Example #1
Source File: Area.py    From Python-Application with GNU General Public License v3.0 6 votes vote down vote up
def left(self):
        self.widget.switch_page(right=False)
        
        
        
    #def keyPressEvent(self, event):
        #这里event.key()显示的是按键的编码
        #print("按下:" + str(event.key()))
        # 举例,这里Qt.Key_A注意虽然字母大写,但按键事件对大小写不敏感
        #if (event.key() == Qt.Key_Left):
        #    self.widget.switch_page(right=False)
        #elif (event.key() == Qt.Key_Right):
        #    self.widget.switch_page(right=True)
        #elif (event.modifiers() == Qt.CTRL and event.key() == Qt.Key_Plus):
        #    self.widget.zoom_book(plus=True)
        #elif (event.modifiers() == Qt.CTRL and event.key() == Qt.Key_Minus):
        #    self.widget.zoom_book(plus=False) 
Example #2
Source File: QtKeyDevice.py    From Uranium with GNU Lesser General Public License v3.0 5 votes vote down vote up
def _qtKeyToUMKey(self, key):
        if key == Qt.Key_Shift:
            return KeyEvent.ShiftKey
        elif key == Qt.Key_Control:
            return KeyEvent.ControlKey
        elif key == Qt.Key_Alt:
            return KeyEvent.AltKey
        elif key == Qt.Key_Space:
            return KeyEvent.SpaceKey
        elif key == Qt.Key_Meta:
            return KeyEvent.MetaKey
        elif key == Qt.Key_Enter or key == Qt.Key_Return:
            return KeyEvent.EnterKey
        elif key == Qt.Key_Up:
            return KeyEvent.UpKey
        elif key == Qt.Key_Down:
            return KeyEvent.DownKey
        elif key == Qt.Key_Left:
            return KeyEvent.LeftKey
        elif key == Qt.Key_Right:
            return KeyEvent.RightKey
        elif key == Qt.Key_Minus:
            return KeyEvent.MinusKey
        elif key == Qt.Key_Underscore:
            return KeyEvent.UnderscoreKey
        elif key == Qt.Key_Plus:
            return KeyEvent.PlusKey
        elif key == Qt.Key_Equal:
            return KeyEvent.EqualKey

        return key 
Example #3
Source File: GetMaskParams.py    From tierpsy-tracker with MIT License 5 votes vote down vote up
def keyPressEvent(self, event):
        if self.vid is not None:
            # break no file open, nothing to do here
            return
        key = event.key()
        if key == Qt.Key_Minus:
            self.twoViews.zoom(-1)
        elif key == Qt.Key_Plus:
            self.twoViews.zoom(1)

        else:
            QMainWindow.keyPressEvent(self, event) 
Example #4
Source File: HDF5VideoPlayer.py    From tierpsy-tracker with MIT License 5 votes vote down vote up
def keyPressEvent(self, event):
        #HOT KEYS

        if self.video_reader is None:
            # break no file open, nothing to do here
            return

        key = event.key()
        if key == Qt.Key_Minus:
            self.mainImage.zoom(-1)
        elif key == Qt.Key_Plus:
            self.mainImage.zoom(1)

        super().keyPressEvent(event)

    # frame spin box 
Example #5
Source File: spectra.py    From pySPM with Apache License 2.0 5 votes vote down vote up
def __init__(self, filename=None, parent=None):
        super(SpectraViewer, self).__init__(parent)
        self.ui = Ui_SpectraViewer()
        self.ui.setupUi(self)
        self.sf = 7200
        self.k0 = 0
        self.dsf = 0
        self.dk0 = 0
        self.ita = None
        self.fig = self.ui.mpl.canvas.fig
        self.canvas = self.ui.mpl.canvas
        self.ax = self.fig.add_subplot(111)
        self.nextMass = QShortcut(Qt.Key_Plus, self)
        self.prevMass = QShortcut(Qt.Key_Minus, self)
        self.nextMass.activated.connect(self.next_mass)
        self.prevMass.activated.connect(self.prev_mass)
        self.ui.pushButton_2.clicked.connect(self.toggleMassCal)
        self.ui.pushButton.clicked.connect(self.removeMassCalItem)
        self.ui.show_mass.clicked.connect(self.yAxisScaleChanged)
        self.canvas.mpl_connect('motion_notify_event', self.on_motion)
        self.canvas.mpl_connect('button_press_event', self.onMousePress)
        self.canvas.mpl_connect('button_release_event', self.onMouseRelease)
        self.canvas.mpl_connect("scroll_event", self.scrolling)
        self.labels = []
        self.action = None
        self.lab_lines = []
        self.MassCal = []
        self.open(filename)