Trees | Indices | Help |
|
---|
|
1 # -*- coding: utf-8 -*- 2 3 ############################################################################ 4 # mcpushbutton.py 5 # 6 # MOCOP push button widget 7 # 8 # (C) 2008 Likya Software Ltd. 9 ############################################################################ 10 11 from PyQt4.Qt import * 12 13 from mcwidget import MCWidget 14 from mc import MC 1517 ''' 18 push button, which is used in MC views 19 '''5521 ''' 22 Disables the default action of the button, saves the background 23 color, determines the focus color. 24 ''' 25 QPushButton.__init__(self, *args) 26 MCWidget.__init__(self) 27 self._normalPalette = QPalette(self.palette()) 28 self._focusPalette = QPalette(self.palette()) 29 self._focusPalette.setColor(QPalette.Button, MC.FOCUS_BACKGROUND_COLOR)30 34 3840 ''' 41 Overrides the Key events of the PushButton 42 43 The clicked() signal is emitted when return is pressed. Therefore, 44 the slot connected to the mouse clicked signal will be executed. 45 There is no need to connect it manually several times. 46 ''' 47 if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return: 48 self.animateClick() 49 elif event.key() == Qt.Key_Up or event.key() == Qt.Key_Left: 50 self.focusNextPrevChild(False) 51 elif event.key() == Qt.Key_Down or event.key() == Qt.Key_Right: 52 self.focusNextPrevChild(True) 53 else: 54 QPushButton.keyPressEvent(self, event)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Oct 29 19:46:54 2009 | http://epydoc.sourceforge.net |