def __init__(self, parent=None): QPushButton.__init__(self, parent) self.key = None self.parent = parent self.input = None self.joystick = None self.setFocusPolicy(Qt.ClickFocus)
def __init__(self, parent=None, columns=-1, enableColorDialog=True): QPushButton.__init__(self, parent) self.withColorDialog = enableColorDialog self.setFocusPolicy(Qt.StrongFocus) self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) self.setAutoDefault(False) self.setAutoFillBackground(True) self.setCheckable(True) # Set text self.setText(self.tr("White")) self.firstInserted = False # Create and set icon self.col = Qt.white self.dirty = True # Create color grid popup and connect to it self.popup = CColorPickerPopup(columns, self.withColorDialog, self) self.connect(self.popup, SIGNAL('selected(QColor)'), self.setCurrentColor) self.connect(self.popup, SIGNAL('hid()'), self.popupClosed) # Connect this push button's pressed() signal self.connect(self, SIGNAL('toggled(bool)'), self.buttonPressed)
def __init__(self, text=None, flat=True, parent=None, enabled=True): QPushButton.__init__(self, parent) self.setEnabled(enabled) self.setFlat(flat) if text is not None: self.setText(text) self.setIconSize(QSize(NuconfButton._ICON_SIZE, NuconfButton._ICON_SIZE))
def __init__(self, parent, color=None): QPushButton.__init__(self, parent) self.parent = parent self.setColor(color) self.clicked.connect(self.onClick) self.setMinimumSize(QSize(25, 25)) self.setMaximumSize(QSize(25, 25))
def __init__(self, parent, color=None, on_color_change=None, name='Color', verify_colors=False): """ Args: parent: a parent Qt instance color: the color name or hexadecimal code (in form of a string) on_color_change: a function or method taking old color and a new one verify_colors: should the parent be asked if the color is acceptable? to verify a color parent.is_acceptable(color) will be invoked """ QPushButton.__init__(self, color, parent) self.verify_colors = verify_colors self.parent = parent self.color = color self.name = name self.callback = on_color_change if color: self.set_color(color) else: self.setText(_('(Not specified)')) self.clicked.connect(self.pick_color)
def __init__(self, num, cs, parent): QPushButton.__init__(self, "*", parent) self.setFlat(True) self.connected = False self.cs = cs self.type = self.IO self.num = num self.clicked.connect(self.connect)
def __init__(self, parent, targetResult, arg_name, browseVFS = 0, node = 0): QPushButton.__init__(self, parent) self.targetResult = targetResult self.browseVFS = browseVFS self.node = node self.setObjectName("Button" + arg_name) self.setText(QApplication.translate("DFF_BrowserButton", "Browse", None, QApplication.UnicodeUTF8)) self.setFixedSize(QSize(80, 28)) self.connect(self, SIGNAL("clicked()"), self.clickOnMe)
def __init__(self, name, callback_pressed, callback_released, parent=None): QPushButton.__init__(self, parent) self.name = name self.setText(name) self.callback_pressed = callback_pressed self.callback_released = callback_released self.pressed.connect(lambda: self.callback_pressed(self.name)) self.released.connect(lambda: self.callback_released(self.name))
def __init__(self, name, callback_pressed, callback_released, parent=None): QPushButton.__init__(self,parent) self.name = name self.setText(name) self.callback_pressed = callback_pressed self.callback_released = callback_released self.pressed.connect(lambda : self.callback_pressed(self.name)) self.released.connect(lambda : self.callback_released(self.name))
def __init__(self): QPushButton.__init__(self, PixmapCache().getIcon('pluginsettings.png'), "") self.setFixedSize(24, 24) self.setFocusPolicy(Qt.NoFocus) self.index = -1 self.connect(self, SIGNAL("clicked()"), self.onClick) return
def __init__(self, *args): QPushButton.__init__(self, *args) self._app = QApplication.instance().window # Define the internal color self.color = QColor('#ffffff') self.updateButtonColorsAndText()
def __init__( self ): QPushButton.__init__( self, PixmapCache().getIcon( 'pluginsettings.png' ), "" ) self.setFixedSize( 24, 24 ) self.setFocusPolicy( Qt.NoFocus ) self.index = -1 self.connect( self, SIGNAL( "clicked()" ), self.onClick ) return
def __init__(self, parent, key, container, inputchoice=None): if isinstance(container, QListWidget): QPushButton.__init__(self, QIcon(":add.png"), "", parent) else: QPushButton.__init__(self, QIcon(":folder.png"), "...") self.setIconSize(QSize(16, 16)) self.inputcombo = inputchoice self.ckey = key self.container = container self.connect(self, SIGNAL("clicked()"), self.browse)
def __init__(self, parent): QPushButton.__init__(self, parent) self.m_pixmap = QPixmap() self.m_pixmap_rect = QRectF(0, 0, 0, 0) self.setCheckable(True) self.setText("") self.setColor(self.BLUE)
def __init__(self, parent): QPushButton.__init__(self, parent) self.fPixmapNormal = QPixmap() self.fPixmapDown = QPixmap() self.fPixmapHover = QPixmap() self.fPixmapRect = QRectF(0, 0, 0, 0) self.fIsHovered = False self.setText("")
def __init__(self): QPushButton.__init__( self, PixmapCache().getIcon(pluginHomeDir + 'svnmenudiff.png'), "") self.setFixedSize(24, 24) self.setFocusPolicy(Qt.NoFocus) self.path = "" self.status = None self.clicked.connect(self.onClick) return
def __init__( self ): QPushButton.__init__( self, PixmapCache().getIcon( pluginHomeDir + 'svnmenudiff.png' ), "" ) self.setFixedSize( 24, 24 ) self.setFocusPolicy( Qt.NoFocus ) self.rev = None self.prevRev = None self.clicked.connect( self.onClick ) return
def __init__(self, parent, targetResult, arg_name, browseVFS=0, node=0): QPushButton.__init__(self, parent) self.targetResult = targetResult self.browseVFS = browseVFS self.node = node self.setObjectName("Button" + arg_name) self.setText( QApplication.translate("DFF_BrowserButton", "Browse", None, QApplication.UnicodeUTF8)) self.setFixedSize(QSize(80, 28)) self.connect(self, SIGNAL("clicked()"), self.clickOnMe)
def __init__(self, parent=None): QPushButton.__init__(self) vlayout = QVBoxLayout() self.button = QPushButton('Quit?') self.font = QFont() self.font.setFamily("Times") self.font.setPointSize(40) self.font.setBold(False) self.button.setFont(self.font) vlayout.addWidget(self.button) mainLayout = QGridLayout() mainLayout.addLayout(vlayout, 0, 1) self.setLayout(mainLayout)
def __init__(self, toolBar, view, model): QPushButton.__init__(self, QIcon(':enkiicons/button-ok.png'), "Unc&heck all", toolBar) self._action = toolBar.insertWidget(toolBar.actions()[0], self) self.setMinimumWidth(QFontMetrics(self.font()).width("Uncheck all)") + 36) self.setStyleSheet("padding: 0") self.setFlat(True) self._view = view self._model = model self.clicked.connect(self._onTriggered) self._model.dataChanged.connect(self._update) self._model.rowsInserted.connect(self._update) self._model.rowsRemoved.connect(self._update) self._update()
def __init__(self, toolBar, view, model): QPushButton.__init__(self, QIcon(':enkiicons/scope.png'), "Ex&pand all", toolBar) self._action = toolBar.insertWidget(toolBar.actions()[0], self) self.setMinimumWidth(QFontMetrics(self.font()).width("Colla&pse all)") + 36) self.setStyleSheet("padding: 0") self.setFlat(True) self._view = view self._model = model self.clicked.connect(self._onTriggered) self._view.expanded.connect(self._update) self._view.collapsed.connect(self._update) self._model.rowsInserted.connect(self._update) self._model.rowsRemoved.connect(self._update) self._update()
def __init__(self, labelcolor_int): QPushButton.__init__(self) qcolor = QtGui.QColor() #self.color_edit.setFlat(True) qcolor.setRgb(*labelcolor_int) palette = QtGui.QPalette(self.palette()) palette.setColor(QtGui.QPalette.Background, QtGui.QColor('blue')) self.setPalette(palette) self.setStyleSheet("QPushButton {" "background-color: rgb(%s, %s, %s);" % tuple(labelcolor_int) + #"border:1px solid rgb(255, 170, 255); " "}")
def __init__(self, toolBar, view, model): QPushButton.__init__(self, QIcon(':enkiicons/button-ok.png'), "Unc&heck all", toolBar) self._action = toolBar.insertWidget(toolBar.actions()[0], self) self.setMinimumWidth( QFontMetrics(self.font()).width("Uncheck all)") + 36) self.setStyleSheet("padding: 0") self.setFlat(True) self._view = view self._model = model self.clicked.connect(self._onTriggered) self._model.dataChanged.connect(self._update) self._model.rowsInserted.connect(self._update) self._model.rowsRemoved.connect(self._update) self._update()
def __init__(self, toolBar, view, model): QPushButton.__init__(self, QIcon(':enkiicons/scope.png'), "Ex&pand all", toolBar) self._action = toolBar.insertWidget(toolBar.actions()[0], self) self.setMinimumWidth( QFontMetrics(self.font()).width("Colla&pse all)") + 36) self.setStyleSheet("padding: 0") self.setFlat(True) self._view = view self._model = model self.clicked.connect(self._onTriggered) self._view.expanded.connect(self._update) self._view.collapsed.connect(self._update) self._model.rowsInserted.connect(self._update) self._model.rowsRemoved.connect(self._update) self._update()
def __init__(self, atomic_number, parent=None): QPushButton.__init__(self, parent) self._atomic_number = atomic_number self._symbol = get_symbol(atomic_number) self.setText(self._symbol) font = self.font() font.setWeight(QFont.Bold) self.setFont(font) self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.setDefault(False) self.setAutoDefault(False)
def __init__(self, parent, browser_tab): QPushButton.__init__(self, parent) # setea el botón de cerrar self.setGeometry(QRect(0, 0, 22, 22)) icon = QIcon() icon.addPixmap( QPixmap(":/icons/dialog-close.png"), QIcon.Normal, QIcon.Off ) self.setIcon(icon) self.setIconSize(QSize(16, 16)) self.setFlat(True) self.connect(self, SIGNAL('clicked()'), self.close) self.__parent = parent self.__browser_tab = browser_tab
def __init__(self, parent=None, state=True, colors=(QColor(240, 240, 240), QColor(160, 160, 160)), labels=("Yes", "No")): """ Initializes the class. :param parent: Widget parent. :type parent: QObject :param state: Current button state. :type state: bool :param colors: Button colors. :type colors: tuple :param labels: Button texts. :type labels: tuple """ LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__)) QPushButton.__init__(self, parent) # --- Setting class attributes. --- self.__state = None self.state = state self.__colors = None self.colors = colors self.__labels = None self.labels = labels # Initializing the button self.setCheckable(True) if self.__state: self.__setTrueState() else: self.__setFalseState() # Signals / Slots. self.clicked.connect(self.__variable_QPushButton__clicked)
def __init__(self, parent, testParams, variables, liteMode=False): """ Constructor """ QPushButton.__init__(self, parent) if liteMode: self.currentOp = { 'operator': 'undefined', 'value': '', 'type': 'string' } else: self.currentOp = {'operator': '', 'value': '', 'type': 'string'} self.parentWidget = parent self.testParams = testParams self.variables = variables self.liteMode = liteMode self.setText("Undefined") self.createConnections()
def __init__ ( self, icon, slot ): """ Initialize the button. *icon* is either the name of an image file or one of the QStyle.SP_* values. """ QPushButton.__init__( self ) # Get the current style: sty = QApplication.instance().style() # Get the minimum icon size to use: ico_sz = sty.pixelMetric( QStyle.PM_ButtonIconSize ) if isinstance( icon, basestring ): pm = pixmap_cache( icon ) # Increase the icon size to accomodate the image if needed: pm_width = pm.width() pm_height = pm.height() if ico_sz < pm_width: ico_sz = pm_width if ico_sz < pm_height: ico_sz = pm_height ico = QIcon( pm ) else: ico = sty.standardIcon( icon ) # Configure the button: self.setIcon( ico ) self.setMaximumSize( ico_sz, ico_sz ) self.setFlat( True ) self.setFocusPolicy( Qt.NoFocus ) QObject.connect( self, SIGNAL( 'clicked()' ), slot ) #-- EOF ------------------------------------------------------------------------
def __init__(self, *args): QPushButton.__init__(self, *args) self._app = QApplication.instance().window self.textOptions = Property.TextOptions() # Set initial textOptions values based on application preferences if 'preferences' in self._app.__dict__.keys(): preferenceTextOptions = self._app.preferences.getInternal('textOptions') if preferenceTextOptions is not None: self.setTextOptions(preferenceTextOptions) # Create dialog self._dialog = QTextOptionsWidget(self) self._ui = Ui_TextOptionsWidget() self._ui.setupUi(self._dialog) self._dialog.setUiObject(self._ui) self._window = SubWindow(self._app.ui.workspace) self._window.setWidget(self._dialog) self._dialog.setParent(self._window) self.hideTextOptionsWidget() # Create font list from matplotlib fonts fontPropList = fm.createFontList(fm.findSystemFonts()) # Get just the names fontList = map(lambda x:x.name, fontPropList) # Unique and sort the names fontList = list(set(fontList)) fontList.sort() # Enter fonts into the ui widget self._ui.name.addItems(fontList)
def __init__(self, icon=None, text=None, parent=None): if icon: QPushButton.__init__(self, icon, text, parent) elif text: QPushButton.__init__(self, text, parent) else: QPushButton.__init__(self, parent) self.badge_counter = 0 self.badge_size = 25 self.redGradient = QRadialGradient( 0.0, 0.0, 17.0, self.badge_size - 3, self.badge_size - 3) self.redGradient.setColorAt(0.0, QColor(0xe0, 0x84, 0x9b)) self.redGradient.setColorAt(0.5, QColor(0xe9, 0x34, 0x43)) self.redGradient.setColorAt(1.0, QColor(0xdc, 0x0c, 0x00))
def __init__(self): QPushButton.__init__(self) self.setIcon(QIcon(":remove.png")) self.connect(self, SIGNAL("clicked(bool)"), self.removeMapper)
def __init__(self, name, data, scheme, parent=None): QPushButton.__init__(self, "open", parent) NodeWidget.__init__(self, name, data, scheme) self.clicked.connect(self._open)
def __init__(self): QPushButton.__init__(self) self.setIcon(QIcon(":remove.png")) self.connect(self, SIGNAL("clicked(bool)"), self.removeMapper)
def __init__(self, strText=""): QPushButton.__init__(self) self.__InitUi(strText)
def __init(self, text): QPushButton.__init__(self, text) self.setFlat(True)
def __init__(self, parent=None): QPushButton.__init__(self, parent) self.setFixedSize(20, 20) self.setIconSize(QSize(12, 12)) self.connect(self, SIGNAL("clicked()"), self.choose_color) self._color = QColor()
def __init__(self, parent = None): QPushButton.__init__(self, parent) self.setCheckable(True)
def __init__(self): QListWidgetItem.__init__() QPushButton.__init__("text")
def __init__(self, zoom, icon): QPushButton.__init__(self, QIcon(QString(icon)), "") self.zoom = zoom
def __init__(self, angle, icon): QPushButton.__init__(self, QIcon(QString(icon)), "") self.angle = angle
def __init__(self, parent): QPushButton.__init__(self, parent) self.clicked.connect(self._openURL)
def __init__(self, parent): QPushButton.__init__(self, parent)
def __init__(self, parent): QPushButton.__init__(self, parent) self.setupUi(self) self.addAction(self.actionDetachTab)
def __init__(self, parent, container): QPushButton.__init__(self, QIcon(":del_dump.png"),"") self.setIconSize(QSize(16, 16)) self.container = container self.manager = parent self.connect(self, SIGNAL("clicked()"), self.rm)
def __init__(self, message, parent): QPushButton.__init__(self, parent) self.message = message self.client = parent.client self.setText(message.buttonCaption())
def __init__(self): QPushButton.__init__(self) self.clicked.connect(self.crash, Qt.QueuedConnection)
def __init(self, text): QPushButton.__init__(self, text) self.setFlat(True)
def __init__(self, parent): QPushButton.__init__(self, parent) self.setStyleSheet(self.template_css % (self.green, self.white))
def __init__(self, *a, **kw): QPushButton.__init__(self, *a, **kw) self.setCheckable(True)
def __init__(self, icon_path): QPushButton.__init__(self) self.__icon_path = icon_path self.__setup_ui()
def __init__(self, parent=None): QPushButton.__init__(self, parent) self.setCheckable(True)
def __init__(self, parent): QPushButton.__init__(self, parent) self.clicked.connect(self._search)
def __init__(self, parent=None): QPushButton.__init__(self, parent) self.setFixedSize(20, 20) self.setIconSize(QSize(12, 12)) self.connect(self, SIGNAL("clicked()"), self.choose_color) self._color = QColor()
def __init__(self, parent = None, lifePoints = 20): QPushButton.__init__(self, parent) self.player = Player(lifePoints) self.setText(str(self.player.lifePoints))