예제 #1
0
    def __init__(self, Text, Connector):
        QToolButton.__init__(self)
 
        self.setText(Text)
        self.setStyleSheet("font: bold;color: blue;height: 55px;width: 55px;")
        self.setIconSize(QSize(32,32))
        self.clicked.connect(Connector)
예제 #2
0
    def __init__(self, parent=None, **kwargs):
        QToolButton.__init__(self, parent, **kwargs)
        self.setToolButtonStyle(Qt.ToolButtonIconOnly)
        self.setCheckable(True)

        self.__flat = True
        self.__showMenuIndicator = False
예제 #3
0
 def __init__(self, text):
     QToolButton.__init__(self)
     self.setText('?')
     self.help_text = text
     self.setFocusPolicy(Qt.NoFocus)
     self.setFixedWidth(round(2.2 * char_width_in_lineedit()))
     self.clicked.connect(self.onclick)
예제 #4
0
 def __init__(self, parent, rgbatuple=None):
     QToolButton.__init__(self, parent)
     if rgbatuple is not None:
         color = QColor(rgbatuple[0], rgbatuple[1], rgbatuple[2],
                        rgbatuple[3])
     else:
         color = QColor(0, 0, 0, 0)
     self.setColor(color)
     self.setToolTip("Change Color")
예제 #5
0
    def __init__(self, parent=None):
        QToolButton.__init__(self, parent)

        default_icon_size = self.style().pixelMetric(QStyle.PM_ButtonIconSize)
        self.setIconSize(QSize(default_icon_size * 2, default_icon_size))

        self._color = QColor()
        self.color = QColor(Qt.white)

        self.clicked.connect(self._pick_color)
예제 #6
0
    def __init__(self, colorOrParent, *args):
        if isinstance(colorOrParent, QColor):
            QToolButton.__init__(self, *args)
            self.setColor(colorOrParent)
        else:
            QToolButton.__init__(self, colorOrParent, *args)
            self.setColor(QColor())

        self.clicked.connect(self._onClicked)
        self.setIconSize(QSize(16, 16))
예제 #7
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setText(self.tr("Tabs"))
        self.setEnabled(False)

        self.setToolTip(self.tr("Indentation mode. Click to change"))

        self.clicked.connect(self._onClicked)
        core.workspace().currentDocumentChanged.connect(self._onCurrentDocumentChanged)
        core.workspace().indentUseTabsChanged.connect(self._onIndentSettingsChanged)
        core.workspace().indentWidthChanged.connect(self._onIndentSettingsChanged)
예제 #8
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self._template_name = ""
        self._template_icon = ""
        self._factory = True
        self._state = False
        self._favicon_not = QIcon(':scalable/breeze/draw-star.svg')
        self._favicon_yes = QIcon(':scalable/breeze/star-yellow.svg')

        self.session = None

        self.setIcon(self._favicon_not)
 def __init__(self, name, parent=None):
     QToolButton.__init__(self, parent)
     self.setIcon(QIcon(IconFile.button_alarmClock))
     self.setCheckable(True)
     self.name = name
     self.prev_timeout = initial_alarm_clock_timeout
     self.resetButton()
     self.timer = QTimer(self)
     self.timer.setSingleShot(True)
     self.timer.timeout.connect(lambda: self.alarm.emit(self.name))
     self.timer.timeout.connect(self.resetButton)
     self.clicked.connect(self.buttonClicked)
예제 #10
0
파일: __init__.py 프로젝트: wxgeo/geophar
    def __init__(self, parent):
        QToolButton.__init__(self)
        self.parent = parent
        self.setAutoRaise(True)
        self.mode_normal()

        self.menu = menu = QMenu(self)
        self.setMenu(menu)
        for mode, titre in self.modes:
            nom = 'mode_' + mode
            action = menu.addAction(QIcon(png(nom)), titre)
            action.setIconVisibleInMenu(True)
            action.triggered.connect(getattr(self, nom))
        self.clicked.connect(self.mode_occupe)
예제 #11
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setText(self.tr("Tabs"))
        self.setEnabled(False)

        self.setToolTip(self.tr("Indentation mode. Click to change"))

        self.clicked.connect(self._onClicked)
        core.workspace().currentDocumentChanged.connect(
            self._onCurrentDocumentChanged)
        core.workspace().indentUseTabsChanged.connect(
            self._onIndentSettingsChanged)
        core.workspace().indentWidthChanged.connect(
            self._onIndentSettingsChanged)
예제 #12
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setEnabled(False)
        self.setToolTip(self.tr("Line endings. Click for convert"))
        self.setIconSize(QSize(16, 16))
        self.setIcon(QIcon(':/enkiicons/unixEol.png'))
        self.setPopupMode(QToolButton.InstantPopup)

        menu = QMenu(self)  # menu filled on popup. Performance optimisation for quicker start up
        self.setMenu(menu)
        menu.aboutToShow.connect(self._onMenuAboutToShow)
        menu.triggered.connect(self._onEolActionTriggered)

        core.workspace().currentDocumentChanged.connect(self._onCurrentDocumentChanged)
        core.workspace().eolChanged.connect(self._setEolMode)
예제 #13
0
    def __init__(self, text, parent=None):
        QToolButton.__init__(self)

        self.parent = parent

        self.signals = SignalManager(self)
        self.settings = Settings(SETTING_FILEPTH['app'], ST_FORMAT['ini'],
                                 self)
        self.resize(40, 40)

        self.setText(text)

        self.values = dict(w=self.width(),
                           h=self.height(),
                           x=self.x(),
                           y=self.y())
예제 #14
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setToolTip(self.tr("Cursor position"))
        self.setEnabled(False)
        self._setCursorPosition(-1, -1)
        minWidth = QFontMetrics(self.font()).width("Line: xxxxx Column: xxx")
        minWidth += 30  # for the button borders
        self.setMinimumWidth(minWidth)  # Avoid flickering when text width changed
        core.workspace().currentDocumentChanged.connect(self._onCurrentDocumentChanged)

        core.workspace().cursorPositionChanged.connect(self._onCursorPositionChanged)

        self._timer = QTimer()
        self._timer.setInterval(200)
        self._timer.setSingleShot(True)
        self._timer.timeout.connect(self._onUpdatePositionTimer)
        self._passedUpdate = False
예제 #15
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setEnabled(False)
        self.setToolTip(self.tr("Line endings. Click for convert"))
        self.setIconSize(QSize(16, 16))
        self.setIcon(QIcon(':/enkiicons/unixEol.png'))
        self.setPopupMode(QToolButton.InstantPopup)

        menu = QMenu(
            self
        )  # menu filled on popup. Performance optimisation for quicker start up
        self.setMenu(menu)
        menu.aboutToShow.connect(self._onMenuAboutToShow)
        menu.triggered.connect(self._onEolActionTriggered)

        core.workspace().currentDocumentChanged.connect(
            self._onCurrentDocumentChanged)
        core.workspace().eolChanged.connect(self._setEolMode)
예제 #16
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setToolTip(self.tr("Cursor position"))
        self.setEnabled(False)
        self._setCursorPosition(-1, -1)
        minWidth = QFontMetrics(self.font()).width("Line: xxxxx Column: xxx")
        minWidth += 30  # for the button borders
        self.setMinimumWidth(
            minWidth)  # Avoid flickering when text width changed
        core.workspace().currentDocumentChanged.connect(
            self._onCurrentDocumentChanged)

        core.workspace().cursorPositionChanged.connect(
            self._onCursorPositionChanged)

        self._timer = QTimer()
        self._timer.setInterval(200)
        self._timer.setSingleShot(True)
        self._timer.timeout.connect(self._onUpdatePositionTimer)
        self._passedUpdate = False
예제 #17
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)

        basecolor = self.palette().base().color().name()
        textcolor = self.palette().buttonText().color().name()
        textdbcolor = self.palette().brush(QPalette.Disabled,
                                           QPalette.WindowText).color().name()

        style = "QToolButton{border-radius: 2px ;border-left: 1px solid " \
            + "qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 " \
            + textcolor + ", stop:0.35 " + basecolor + ", stop:0.75 " \
            + basecolor + ", stop:1 " + textcolor + ")" \
            + ";border-right: 1px solid " \
            + "qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 " \
            + textcolor + ", stop:0.25 " + basecolor + ", stop:0.75 " \
            + basecolor + ", stop:1 " + textcolor + ")" \
            + ";border-top: 1px solid " + textcolor \
            + ";border-bottom : 1px solid " + textcolor \
            +  "; background-color: " + basecolor + "; font-size: 11px" + "}"\
            + "QToolButton::checked{background-color: " \
            + "qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 " \
            + textcolor + ", stop:0.25 " + basecolor + ", stop:0.85 " \
            + basecolor + ", stop:1 " + textcolor + ")" \
            + "; margin-top: 0px; margin-left: 0px " + "}" \
            + "QToolButton::disabled{;border-left: 1px solid " \
            + "qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 " \
            + textdbcolor + ", stop:0.25 " + basecolor + ", stop:0.75 " \
            + basecolor + ", stop:1 " + textdbcolor + ")" \
            + ";border-right: 1px solid " \
            + "qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 " \
            + textdbcolor + ", stop:0.25 " + basecolor + ", stop:0.75 " \
            + basecolor + ", stop:1 " + textdbcolor + ")" \
            + ";border-top: 1px solid " + textdbcolor \
            + ";border-bottom : 1px solid " + textdbcolor \
            + "; background-color: " + basecolor + "}"

        self.setStyleSheet(style)
예제 #18
0
 def __init__(self):
     QToolButton.__init__(self)
     self.size = 18
     self._list = []
     self.R = QRect(6, 3, self.size, self.size)
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)

        self.setStyleSheet(style.verticalToolButtonSS())
예제 #20
0
 def __init__(self):
     QToolButton.__init__(self)
예제 #21
0
 def __init__(self):
     QToolButton.__init__(self)
     self.setCheckable(True)
	def __init__(self, parent=None):
		QToolButton.__init__(self, parent)
		self.componentType = None
예제 #23
0
    def __init__(self, parent: QWidget):
        QToolButton.__init__(self, parent)

        self.setIconSize(QSize(24, 24))
        self.setIcon(QIcon("icons/media-playback-start.svg"))
예제 #24
0
 def __init__(self, *args, **kwargs):
     QToolButton.__init__(self, *args, **kwargs)
     self.setIcon(icons.get("edit-clear-locationbar-rtl"))
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
     self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
예제 #26
0
 def __init__(self, parent=None):
     QToolButton.__init__(self, parent)
예제 #27
0
    def __init__(self, parent=None, flat=True, **kwargs):
        QToolButton.__init__(self, parent, **kwargs)

        self.__flat = flat
예제 #28
0
 def __init__(self, data_entry, parent=None):
     QToolButton.__init__(self, parent)
     self.data_entry = data_entry
     self.setText(repr(data_entry))
예제 #29
0
 def __init__(self, parent=None):
     QToolButton.__init__(self, parent)
     self.setPopupMode(QToolButton.MenuButtonPopup)
예제 #30
0
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
     self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
예제 #31
0
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
     self._font = self.font()
예제 #32
0
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
     self.popup = VideoPlayerInfoPopup(self.window())
     self.popup.hide()
예제 #33
0
 def __init__(self, *args, **kwargs):
     QToolButton.__init__(self, *args, **kwargs)
     self.setIcon(icons.get("edit-clear-locationbar-rtl"))
예제 #34
0
    def __init__(self, parent):
        QToolButton.__init__(self, parent)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)

        self.setStyleSheet(style.verticalToolButtonSS())
예제 #35
0
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
     self.popup = VideoPlayerInfoPopup(self.window())
     self.popup.hide()
예제 #36
0
    def __init__(self, *args, **kwargs):
        self.__nativeStyling = False
        self.position = QStyleOptionToolBox.OnlyOneTab
        self.selected = QStyleOptionToolBox.NotAdjacent

        QToolButton.__init__(self, *args, **kwargs)
예제 #37
0
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
예제 #38
0
 def __init__(self, main_mdi: TkPyMdiArea, parent=None):
     QToolButton.__init__(self, parent)
     self.setAutoRaise(True)
     self.__mdi = main_mdi
     self.__mdi.subWindowActivated.connect(self.__update)
     self.__mdi.sub_add.connect(self.__update)
예제 #39
0
 def __init__(self, parent):
     QToolButton.__init__(self, parent)
     self.setStyleSheet("QToolButton{border:none}")