Helpviewer/UrlBar/SslLabel.py

Sat, 01 Oct 2011 17:20:29 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 01 Oct 2011 17:20:29 +0200
branch
5_1_x
changeset 1347
c1f7967d062f
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 1510
e75ecf2bd9dd
permissions
-rw-r--r--

Fixed an issue in the install and uninstall scripts.
(transplanted from 8c9af7608afaa98608e72a74d0485197dd0503c4)

# -*- coding: utf-8 -*-

# Copyright (c) 2010 - 2011 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the label to show some SSL info.
"""

from PyQt4.QtCore import Qt, pyqtSignal
from PyQt4.QtGui import QLabel

class SslLabel(QLabel):
    """
    Class implementing the label to show some SSL info.
    """
    clicked = pyqtSignal()
    
    def __init__(self, parent = None):
        """
        Constructor
        
        @param parent reference to the parent widget (QWidget)
        """
        QLabel.__init__(self, parent)
        
        self.setFocusPolicy(Qt.NoFocus)
        self.setCursor(Qt.ArrowCursor)
    
    def mouseReleaseEvent(self, evt):
        """
        Protected method to handle mouse release events.
        
        @param evt reference to the mouse event (QMouseEvent)
        """
        if evt.button() == Qt.LeftButton:
            self.clicked.emit()
        else:
            QLabel.mouseReleaseEvent(self, evt)
    
    def mouseDoubleClickEvent(self, evt):
        """
        Protected method to handle mouse double click events.
        
        @param evt reference to the mouse event (QMouseEvent)
        """
        if evt.button() == Qt.LeftButton:
            self.clicked.emit()
        else:
            QLabel.mouseDoubleClickEvent(self, evt)

eric ide

mercurial