def __init__(self): QLabel.__init__(self) self.installEventFilter(self) self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) self.setAttribute(Qt.WA_QuitOnClose) self.setStyleSheet("QLabel {background-color: white; color: black;}") self.setTextFormat(Qt.RichText) self.setWordWrap(True) self._qtimer = QTimer() self._qtimer.timeout.connect(self.hideText)
def __init__(self, parent): QLabel.__init__(self, parent) self.setFocusPolicy(Qt.NoFocus) if QApplication.instance().is_dark_theme: c = builtin_colors_dark['green'] else: c = builtin_colors_light['green'] self.color = self.palette().color(QPalette.WindowText).name() bg = QColor(c).getRgb() self.setStyleSheet(f'''QLabel {{ background-color: rgba({bg[0]}, {bg[1]}, {bg[2]}, 0.85); border-radius: 4px; color: {self.color}; padding: 0.5em; }}''') self.linkActivated.connect(self.link_activated) self.close_timer = t = QTimer() t.setSingleShot(True) t.timeout.connect(self.hide) self.setMouseTracking(True)
def __init__(self, *args, **kwargs): QLabel.__init__(self, *args, **kwargs) self.setCursor(Qt.PointingHandCursor)
def __init__(self, parent, icon_name, size=16): QLabel.__init__(self, parent) pixmap = get_pixmap(icon_name) self.setPixmap(pixmap) self.setMaximumSize(size, size) self.setScaledContents(True)
def __init__(self, parent=None): QLabel.__init__(self, parent) self.setMinimumWidth(400) self.base_msg = '<h3>'+_('Choose a font family')+'</h3>' self.setText(self.base_msg) self.setWordWrap(True)
def __init__(self, parent): QLabel.__init__(self, parent) self.mouse_over = False self.setCursor(Qt.PointingHandCursor) self.setToolTip(_('See what\'s new in this calibre release'))
def __init__(self, parent=None): QLabel.__init__(self, parent) self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
def __init__(self, parent=None): QLabel.__init__(self, parent) self.setMinimumWidth(400) self.base_msg = '<h3>' + _('Choose a font family') + '</h3>' self.setText(self.base_msg) self.setWordWrap(True)
def __init__(self, *args): QLabel.__init__(self, *args)
def __init__(self): QLabel.__init__(self, '') self.setFocusPolicy(Qt.NoFocus)
def __init__(self, parent): QLabel.__init__(self, parent)
def __init__(self, path, width): QLabel.__init__(self) self.setPixmap(QPixmap(path).scaledToWidth(width))
def __init__(self, parent=None): QLabel.__init__(self, parent) self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum)