Пример #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())
Пример #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())
Пример #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()
Пример #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()
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #9
0
 def showEvent(self, event):
     QSplashScreen.showEvent(self, event)
     # Raise to top on show.
     self.raise_()
Пример #10
0
 def showEvent(self, event):
     QSplashScreen.showEvent(self, event)
     # Raise to top on show.
     self.raise_()