Exemplo n.º 1
0
  def __init__(self):

    QLabel.__init__(self)

    self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
    self.setAttribute(Qt.WA_NoSystemBackground)
    self.setMouseTracking(True)

    self.dragPosition  = QPoint(0, 0)
    self.mousePosition = QCursor.pos()

    self.actionFaces = QActionGroup(self)
    allFaceActions   = []

    for name in sorted(self.faces):

      action = QAction(name, self.actionFaces)
      action.setCheckable(True)
      allFaceActions.append(action)

    self.actionFaces.triggered.connect(self.actionUpdateFace)

    startAction = random.choice(allFaceActions)
    startAction.setChecked(True)
    self.actionUpdateFace(startAction)

    self.actionQuit = QAction("Quit", self)
    self.actionQuit.triggered.connect(QApplication.instance().quit)

    self.timer = QTimer()
    self.timer.timeout.connect(self.updateFromMousePosition)

    self.timer.start(self.update_interval)

    self.painter = None
Exemplo n.º 2
0
    def __init__(self, text, link, parent=None):
        QLabel.__init__(self, parent)

        self.setText("<a href=\"" + link + "\">" + text + "</a>")
        self.setTextFormat(Qt.RichText)
        self.setTextInteractionFlags(Qt.TextBrowserInteraction)
        self.setOpenExternalLinks(True)
Exemplo n.º 3
0
 def __init__(self, style, parentView, backgroundColor, foregroundColor, width, height):
     QLabel.__init__(self)
     self.setColors(backgroundColor, foregroundColor)
     self.setPixmapSize(width, height)
     self.setIcon(style)
     self._swapped = False
     self._rotation = 0
Exemplo n.º 4
0
    def __init__(self, text):
        QLabel.__init__(self)

        self.text = text

        self.layout = QVBoxLayout(self)

        self.image_label = QLabel()
        image = QImage('file_icon.png')
        self.image_label.setPixmap(QPixmap.fromImage(image))
        self.image_label.setAlignment(Qt.AlignCenter)

        # Truncate the filename if it is too long (but its fullname and path are saved in an instance variable)
        last_path_seperator_index = text.rfind('/')
        text = text[last_path_seperator_index+1:]

        if len(text) > 12:
            text = text[0:12] + '...'
        self.text_label = QLabel(text)
        self.text_label.setWordWrap(True)
        self.text_label.setAlignment(Qt.AlignCenter)

        self.layout.addWidget(self.image_label)
        self.layout.addWidget(self.text_label)

        self.setSizePolicy(QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
Exemplo n.º 5
0
    def __init__(self, *args):
        QLabel.__init__(self, *args)

        self.setMinimumWidth(QFontMetrics(self.font()).width("Xreplace charX"))
        self.setAlignment(Qt.AlignCenter)

        core.workspace().currentDocumentChanged.connect(self._onCurrentDocumentChanged)
Exemplo n.º 6
0
 def __init__(self, parent=None):
     QLabel.__init__(self, parent)
     
     self.updateClock()
     self.timer = QTimer()
     self.timer.setInterval(1000)
     self.timer.timeout.connect(self.updateClock)
     self.timer.start()
Exemplo n.º 7
0
 def __init__(self,parent):
     QLabel.__init__(self,parent)
     self.linelength=parent.width()
     self.lineheight=parent.lineheight
     self.resize(self.linelength, self.lineheight)
     self.move(0,0)
     self.stats=None
     self.setStyleSheet("{background-color:transparent;border:none;}")
Exemplo n.º 8
0
    def __init__(self, text, length, height):
        QLabel.__init__(self)

        self.text = text
        self.length = length
        self.height = height
        self.setFixedHeight(length)
        self.setFixedWidth(height)
Exemplo n.º 9
0
 def __init__(self, msg):
     # easy way to skip super!
     QLabel.__init__(self, msg)
     edit1 = QLineEdit("widget 1")
     edit2 = QLineEdit("widget 2")
     layout = QVBoxLayout()
     layout.addWidget(edit1)
     layout.addWidget(edit2) 
     self.setLayout(layout)
Exemplo n.º 10
0
 def __init__(self,parent,text):
     QLabel.__init__(self,parent)
     self.parent=parent
     self.text=text
     self.setText(text)
     self.setAlignment(Qt.AlignCenter)
     font=QFont()
     font.setPointSize(self.parent.height()/2)
     self.setFont(font)
Exemplo n.º 11
0
    def __init__(self, parent = None, func=None):

        self.func = func
        QLabel.__init__(self, parent)
        self.rubberBand = QRubberBand(QRubberBand.Rectangle, self)
        self.origin = QPoint()
        self.slitpos = 250
        self.focus = (333,666,333,666)  #xs,xe,ys,ye
        self.geometry = (0,0,1000,1000) #x,y,w,h
Exemplo n.º 12
0
	def __init__(self, mainwin):
		QLabel.__init__(self)

		self.setAcceptDrops(True)

		self.marker = QRubberBand(QRubberBand.Rectangle, self)
		self.markOrigin = self.markEnd = None

		self.setContextMenuPolicy(Qt.ActionsContextMenu)
		self.addAction(mainwin.cropAction)
		self.addAction(mainwin.saveAction)
Exemplo n.º 13
0
    def __init__(self,winParent, cross=False):      
        QLabel.__init__(self, winParent)
        #self.setFixedSize(self.IMAGE_COLS_MAX, self.IMAGE_ROWS_MAX)
        #self.scale = 1
        self.setMouseTracking(True)

        self.mouse_x = 0
        self.mouse_y = 0
        self.mouse_pos = None
        self.setCursor(Qt.BlankCursor)
        self.cross=cross
        self.img = None
Exemplo n.º 14
0
 def __init__(self):
     QLabel.__init__(self, wordWrap=True)
     self.setSizePolicy(QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Preferred))
     self.setStyleSheet(css.lcd_screen)
     self._tempoTimer = QTimer(interval=1500, singleShot=True,
         timeout=self.setTempo)
     self._statusTimer = QTimer(interval=2000, singleShot=True,
         timeout=self.statusMessage)
     self._tempo = None
     self._status = None
     self.reset()
     app.translateUI(self)
Exemplo n.º 15
0
    def __init__(self, ddir = "data", parent = None):
        QLabel.__init__(self, parent)
        # super(Lolita, self).__init__(parent)
        # 背景透明
        self.setAttribute(Qt.WA_TranslucentBackground)
        # 无边框,不在任务栏显示
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.Tool | Qt.WindowStaysOnTopHint)
        self.setMouseTracking(True)

        self.canPlay = True
        self.moveCanPlay = True    # 移动的时候可播放,用于控制一次
        self.cindex = 0    # 当前的歌曲序号为0
        self.init(ddir)
Exemplo n.º 16
0
 def __init__(self, parent, backgroundColor, foregroundColor, font, height):
     QLabel.__init__(self, parent)
     p = self.palette()
     p.setColor(self.backgroundRole(), backgroundColor)
     p.setColor(self.foregroundRole(), foregroundColor)
     self.setPalette(p)
     self.setFont(font)
     self.setAutoFillBackground(True)
     self.setFixedHeight(height)
     self.setFrameShape(QFrame.Box)
     self.setFrameShadow(QFrame.Raised)
     # self.setLineWidth( 2 )
     self.setText(" 100 %")
     self.setToolTip("Zoom Level")
Exemplo n.º 17
0
    def __init__(self, text=None, parent=None):
        QLabel.__init__(self, text, parent)

        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum)

        self.setStatusTip(self.tr("If you don't wanna see me, you can hide me in Help menu."))

        self.setStyleSheet("""
            QLabel {
                background-color:lightYellow;
                border:1px solid lightGray;
                border-radius: 10px;
                margin: 3px;
                padding:10px;
                color:gray;
            }""")
Exemplo n.º 18
0
    def __init__(self): # Really not meant to have a parent yet
        QLabel.__init__(self, None)

        self.quitAction = None
        self.trayIconMenu = None
        self.trayIcon = None
        self.createTrayIcon()

        self.setWindowFlags(Qt.FramelessWindowHint |
                            Qt.WindowStaysOnTopHint |
                            Qt.BypassWindowManagerHint)
        self.setAttribute(Qt.WA_TranslucentBackground)

        self.m_hoverbox = Hoverbox()
        self.m_hoverbox.show()

        self.m_animation_timer = QTimer(self)
        self.m_animation_timer.setInterval(100)

        self.m_physics_timer = QTimer(self)
        self.m_physics_timer.setInterval(30)
        self.m_physics_timer.timeout.connect(self.physicsTimerEvent)

        self.screen_width = QDesktopWidget().screenGeometry().width()
        self.screen_height = QDesktopWidget().screenGeometry().height()

        # Initialize properties
        self.m_velocity = QPoint(0, 0)
        self.m_pos = QPoint(self.screen_width / 2, (5.0 / 6.0) * self.screen_height)
        self.m_offset = QPoint(0, 0)
        self.m_size = QSize(0, 0)

        self._velocity = self.m_velocity
        self._pos = self.m_pos
        self._offset = self.m_offset
        self._size = self.m_size

        self.stateMachine = xmlToStateMachine(self, 'coropata.xml')
        self.stateMachine.start()

        self.m_animation_timer.start()
        self.m_physics_timer.start()
Exemplo n.º 19
0
    def __init__(self, parent=None):
        QLabel.__init__(self, parent)

        self.setFixedSize(200, 100)

        self.setWindowFlags(Qt.FramelessWindowHint |
                            Qt.WindowStaysOnTopHint |
                            Qt.BypassWindowManagerHint)
        self.setAttribute(Qt.WA_TranslucentBackground)

        self.m_cooldown = QTimer(self)
        self.m_cooldown.timeout.connect(self.connect)
        self.m_cooldown.setSingleShot(True)

        self.m_left = QLabel(self)
        self.m_right = QLabel(self)
        self.m_left.setGeometry(0, 0, 90, 100)
        self.m_right.setGeometry(110, 0, 90, 100)

        self.connect()
Exemplo n.º 20
0
 def __init__(self, parent=None):
     QLabel.__init__(self, parent)
Exemplo n.º 21
0
 def __init__ (self, text="", parent=None):
     QLabel.__init__(self, text, parent)
     self.setWordWrap(True)
Exemplo n.º 22
0
 def __init__(self, text, help_text):
     QLabel.__init__(self, text)
     self.help_text = help_text
     self.app = QCoreApplication.instance()
     self.font = QFont()
Exemplo n.º 23
0
 def __init__(self, *args, **kwargs):
     QLabel.__init__(self, *args, **kwargs)
     self.setAlignment(Qt.AlignCenter)
     self.setStyleSheet(
         "QLabel { background-color : white; color : black; qproperty-alignment: AlignCenter; font: 8pt; border-radius: 7px;padding: 3px;}"
     )
Exemplo n.º 24
0
 def __init__ (self, text="", parent=None):
     QLabel.__init__(self, text, parent)
     self.setWordWrap(True)
     self.setTextInteractionFlags(Qt.TextSelectableByMouse)
Exemplo n.º 25
0
 def __init__(self, text="", parent=None):
     QLabel.__init__(self, text, parent)
     self.setWordWrap(True)
Exemplo n.º 26
0
 def __init__(self, parent=None):
     QLabel.__init__(self, parent)
     self.initBrush()
     self.marks = []
     self.is_marks_count_limited = False
     self.marks_count_limit = 0
 def __init__(self, labs, unit):
     QLabel.__init__(self, "    %s (%s)" % (labs.strip().title(), unit.strip()))
     self.setStyleSheet("QLabel{font-size: 8pt;}")
Exemplo n.º 28
0
 def __init__(self, text, help_text):
     QLabel.__init__(self, text)
     self.help_text = help_text
     self.app = QCoreApplication.instance()
     self.font = QFont()
    def __init__(self, groupbox, name):
        QLabel.__init__(self, name)

        self.groupbox = groupbox
        self.setStyleSheet("QLabel{font-weight:bold; font-size: 10pt;}")
Exemplo n.º 30
0
	def __init__(self, parent):
		QLabel.__init__(self, '[ Mon ]', parent)
		self.setAutoFillBackground(True)
Exemplo n.º 31
0
 def __init__(self):
     
     QLabel.__init__(self,"shufti 2.2\n\nBy Dan MacDonald, 2017\n\nIf you find shufti useful, please make a donation via PayPal\n\[email protected]\n\nThanks!")
     self.setAlignment(QtCore.Qt.AlignCenter)
Exemplo n.º 32
0
 def __init__(self, txt):
     QLabel.__init__(self)
     self.setText(txt=txt)
Exemplo n.º 33
0
 def __init(self, parent):
     QLabel.__init__(self, parent)
Exemplo n.º 34
0
    def __init__(self, text=None, parent=None):
        QLabel.__init__(self, text=text, parent=parent)

        self.setMouseTracking(True)
Exemplo n.º 35
0
 def __init__(self, parent=None):
     QLabel.__init__(self, parent)
     self.setText("No Web Engine installed capable of displaying PDF.\n\n"
                  "Consider installing QtWebKit or QtWebEngine.")
Exemplo n.º 36
0
    def __init__(self, parent):
        QLabel.__init__(self, parent)

        self.setCursor(Qt.PointingHandCursor)
Exemplo n.º 37
0
 def __init__(self, *args, **kwargs):
     QLabel.__init__(self, *args, **kwargs)
     self.setAlignment(Qt.AlignCenter)
     self.setStyleSheet(
         """QLabel { border-style: outset;border-width: 2px;border-radius: 7px;border-color: beige;font: bold 8pt; padding: 3px;}"""
     )