Ejemplo n.º 1
0
 def __init__(self, *args):
     QtWidgets.QLabel.__init__(self, *args)
     self.setMouseTracking(True)
     self.setAlignment(QtCore.Qt.AlignCenter)
     self.setAttribute(QtCore.Qt.WA_TransparentForMouseEvents)
     self._alpha = 255
     self._messageDisplayTimer = QtCore.QTimer(self)
     self._messageDisplayTimer.timeout.connect(self.fadeOut)
     self._messageFadeOutTimer = QtCore.QTimer(self)
     self._messageFadeOutTimer.timeout.connect(self._fadeOut)
Ejemplo n.º 2
0
    def __init__(self, *args):
        QtWidgets.QFrame.__init__(self, *args)

        self.setObjectName("statusWidget")
        self.setFrameShape(QtWidgets.QFrame.NoFrame)

        self._blocking = False
        self._timer = QtCore.QTimer(self)

        self._label = QtWidgets.QLabel("", self)
        self._label.setCursor(QtCore.Qt.IBeamCursor)
        self._label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
        self._label.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Preferred)

        self._button = QtWidgets.QPushButton(self)
        self._button.setMaximumSize(QtCore.QSize(17, 17))
        self._button.setIconSize(QtCore.QSize(17, 17))

        layout = QtWidgets.QHBoxLayout(self)
        layout.setContentsMargins(1, 0, 0, 0)

        layout.addWidget(self._button)
        layout.addWidget(self._label)

        self.setLayout(layout)
        self.setFixedHeight(19)
        self.setMinimumWidth(5)

        QtCore.QObject.connect(self._timer, QtCore.SIGNAL("timeout()"),
                               self.reset)
Ejemplo n.º 3
0
    def __init__(self, *args):
        QtWidgets.QFrame.__init__(self, *args)

        self.setObjectName("statusWidget")
        self.setFrameShape(QtWidgets.QFrame.NoFrame)

        self._label = QtWidgets.QLabel("Hello :)", self)

        policy = QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred
        self._label.setSizePolicy(*policy)

        self._timer = QtCore.QTimer(self)

        self._button = QtWidgets.QPushButton(self)
        self._button.setMaximumSize(QtCore.QSize(17, 17))
        self._button.setIconSize(QtCore.QSize(17, 17))

        layout = QtWidgets.QHBoxLayout(self)
        layout.setContentsMargins(1, 0, 0, 0)

        layout.addWidget(self._button)
        layout.addWidget(self._label)

        self.setLayout(layout)
        self.setFixedHeight(19)
        self.setMinimumWidth(5)

        QtCore.QObject.connect(self._timer, QtCore.SIGNAL("timeout()"),
                               self.clear)
Ejemplo n.º 4
0
 def reset(self):
     """
     Stop and reset the current frame to 0.
     
     :rtype: None
     """
     if not self._timer:
         self._timer = QtCore.QTimer(self.parent())
         self._timer.setSingleShot(False)
         self.connect(self._timer, QtCore.SIGNAL('timeout()'),
                      self._frameChanged)
     if not self._paused:
         self._frame = 0
     self._timer.stop()
Ejemplo n.º 5
0
    def __init__(self, *args):
        QtWidgets.QLabel.__init__(self, *args)

        self._timer = QtCore.QTimer(self)
        self._timer.setSingleShot(True)
        self._timer.timeout.connect(self.fadeOut)

        self._duration = self.DEFAULT_DURATION

        self.setMouseTracking(True)
        self.setAlignment(QtCore.Qt.AlignCenter)
        self.setAttribute(QtCore.Qt.WA_TransparentForMouseEvents)

        if self.parent():
            self.parent().installEventFilter(self)