Exemple #1
0
    def setPixmap(self, pixmap):
        self.setAttribute(Qt.WA_TranslucentBackground,
                          pixmap.hasAlpha() and \
                          is_transparency_supported())

        self.__pixmap = pixmap

        QSplashScreen.setPixmap(self, pixmap)
        if pixmap.hasAlpha() and not is_transparency_supported():
            self.setMask(pixmap.createHeuristicMask())
Exemple #2
0
    def setPixmap(self, pixmap):
        self.setAttribute(Qt.WA_TranslucentBackground,
                          pixmap.hasAlpha() and \
                          is_transparency_supported())

        self.__pixmap = pixmap

        QSplashScreen.setPixmap(self, pixmap)
        if pixmap.hasAlpha() and not is_transparency_supported():
            self.setMask(pixmap.createHeuristicMask())
Exemple #3
0
 def showMessage(self, message, alignment=Qt.AlignLeft, color=Qt.black):
     """
     Show the `message` with `color` and `alignment`.
     """
     # Need to store all this arguments for drawContents (no access
     # methods)
     self.__alignment = alignment
     self.__color = color
     self.__message = message
     QSplashScreen.showMessage(self, message, alignment, color)
     QApplication.instance().processEvents()
Exemple #4
0
 def showMessage(self, message, alignment=Qt.AlignLeft, color=Qt.black):
     """
     Show the `message` with `color` and `alignment`.
     """
     # Need to store all this arguments for drawContents (no access
     # methods)
     self.__alignment = alignment
     self.__color = color
     self.__message = message
     QSplashScreen.showMessage(self, message, alignment, color)
     QApplication.instance().processEvents()
Exemple #5
0
    def __init__(self, parent=None, pixmap=None, textRect=None,
                 textFormat=Qt.PlainText, **kwargs):
        QSplashScreen.__init__(self, parent, **kwargs)
        self.__textRect = textRect
        self.__message = ""
        self.__color = Qt.black
        self.__alignment = Qt.AlignLeft
        self.__textFormat = textFormat

        if pixmap is None:
            pixmap = QPixmap()

        self.setPixmap(pixmap)

        self.setAutoFillBackground(False)
        # Also set FramelesWindowHint (if not already set)
        self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
Exemple #6
0
 def event(self, event):
     if event.type() == event.Paint:
         pixmap = self.__pixmap
         painter = QPainter(self)
         if not pixmap.isNull():
             painter.drawPixmap(0, 0, pixmap)
         self.drawContents(painter)
         return True
     return QSplashScreen.event(self, event)
Exemple #7
0
 def event(self, event):
     if event.type() == event.Paint:
         pixmap = self.__pixmap
         painter = QPainter(self)
         if not pixmap.isNull():
             painter.drawPixmap(0, 0, pixmap)
         self.drawContents(painter)
         return True
     return QSplashScreen.event(self, event)
Exemple #8
0
    def __init__(self,
                 parent=None,
                 pixmap=None,
                 textRect=None,
                 textFormat=Qt.PlainText,
                 **kwargs):
        QSplashScreen.__init__(self, parent, **kwargs)
        self.__textRect = textRect
        self.__message = ""
        self.__color = Qt.black
        self.__alignment = Qt.AlignLeft
        self.__textFormat = textFormat

        if pixmap is None:
            pixmap = QPixmap()

        self.setPixmap(pixmap)

        self.setAutoFillBackground(False)
        # Also set FramelesWindowHint (if not already set)
        self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
Exemple #9
0
 def showEvent(self, event):
     QSplashScreen.showEvent(self, event)
     # Raise to top on show.
     self.raise_()
Exemple #10
0
 def showEvent(self, event):
     QSplashScreen.showEvent(self, event)
     # Raise to top on show.
     self.raise_()