Overloads the paint event for this group box if it is currently
        collpased.
        
        :param      event | <QPaintEvent>
491568
def paintEvent( self, event ):
        
        if ( self.isCollapsed() ):
            self.setFlat(True)
        
        elif ( self.isCollapsible() ):
            self.setFlat(False)
            
        super(XGroupBox, self).paintEvent(event)
179208
def paintEvent(self, event):
        
        pen = QPen(Qt.DashLine)
        pen.setColor(QColor('red'))
        with XPainter(self) as painter:
            painter.setPen(pen)
            clr = QColor('black')
            clr.setAlpha(100)
            painter.setBrush(clr)
            
            painter.drawRect(self._region)
802042
def leaveEvent(self, event):
        

        if self.__checkable:
            not self.__checked and self.setPixmap(self.__default_pixmap)
        else:
            self.setPixmap(self.__default_pixmap)
671622
def mouseMoveEvent(self, event):
        
        self.declaration.mouse_move_event(event)
        super(QtGraphicsView, self).mouseMoveEvent(event)
1143255
def focusOutEvent(self, event):
        
        self.clicked_outside = True
        return super(QLineEdit, self).focusOutEvent(event)
941943
def paintEvent( self, event ):
        
        super(XRolloutItem, self).paintEvent(event)
        
        with XPainter(self) as painter:
            w = self.width() - 3
            h = self.height() - 3
            
            color = self.palette().color(QPalette.Midlight)
            color = color.darker(180)
            pen = QPen(color)
            pen.setWidthF(0.5)
            
            painter.setPen(pen)
            painter.setBrush(self.palette().color(QPalette.Midlight))
            painter.setRenderHint(XPainter.Antialiasing)
            painter.drawRoundedRect(1, 1, w, h, 10, 10)
391035
def paintEvent(self, event):
        
        painter = QtGui.QPainter()
        painter.begin(self)
        try:
            palette = self.palette()
            clr = palette.color(palette.WindowText)
            clr.setAlpha(100)
            painter.setPen(clr)
            painter.setBrush(palette.color(palette.Window))

            if self._tabBar.isVisible():
                painter.fillRect(0, 0, self.width() - 1, self.height() - 1, palette.color(palette.Button))
                x = y = 3
                w = self.width() - 7
                h = self.height() - 7
            else:
                x = y = 0
                w = self.width() - 1
                h = self.height() - 1

            painter.drawRect(x, y, w, h)

        finally:
            painter.end()
1156029
def paintEvent(self, event):
        
        pixmap = self.currentPixmap()
        rect   = self.currentPixmapRect()
        
        with XPainter(self) as painter:
            painter.drawPixmap(rect.x(), rect.y(), pixmap)
1297087
def focusOutEvent(self, event):
        """"""
        self.focus_changed.emit()
        QPlainTextEdit.focusOutEvent(self, event)
1300335
def eventFilter(self, object, event):
        
        if object == self.parent() and event.type() == QtCore.QEvent.Resize:
            self.resize(event.size())
        elif event.type() == QtCore.QEvent.Close:
            self.setResult(0)
        return False
76102
def on_event(self, event):
        
        if self.state > 0:
            if event.type == MOUSEBUTTONDOWN:
                key = self.layout.get_key_at(pygame.mouse.get_pos())
                if key is not None:
                    self.on_key_down(key)
            elif event.type == MOUSEBUTTONUP:
                self.on_key_up()
            elif event.type == KEYDOWN:
                value = pygame.key.name(event.key)
                # TODO : Find from layout (consider checking layout key space ?)
            elif event.type == KEYUP:
                value = pygame.key.name(event.key)
1339982
def mouseReleaseEvent(self, event):
        
        self.declaration.mouse_release_event(event)
        super(QtGraphicsView, self).mouseReleaseEvent(event)
406240
def paintEvent(self, event):
        

        def __set_bold(state):
            """
            Sets the current painter font bold state.

            :return: Definiton success.
            :rtype: bool
            """

            font = painter.font()
            font.setBold(state)
            painter.setFont(font)
            return True

        painter = QPainter(self)
        painter.fillRect(event.rect(), self.__background_color)

        pen = QPen(QBrush(), self.__separator_width)
        pen.setColor(self.__separator_color)
        painter.setPen(pen)
        top_right_corner = event.rect().topRight()
        bottom_right_corner = event.rect().bottomRight()
        painter.drawLine(top_right_corner.x(), top_right_corner.y(), bottom_right_corner.x(), bottom_right_corner.y())
        painter.setPen(self.__color)

        viewport_height = self.__editor.viewport().height()
        metrics = QFontMetrics(self.__editor.document().defaultFont())
        current_block = self.__editor.document().findBlock(
            self.__editor.textCursor().position())

        block = self.__editor.firstVisibleBlock()
        block_number = block.blockNumber()
        painter.setFont(self.__editor.document().defaultFont())

        while block.isValid():
            block_number += 1
            position = self.__editor.blockBoundingGeometry(block).topLeft() + self.__editor.contentOffset()
            if position.y() > viewport_height:
                break

            if not block.isVisible():
                continue

            block == current_block and __set_bold(True) or __set_bold(False)
            painter.drawText(
                self.width() - metrics.width(foundations.strings.to_string(block_number)) - self.__margin / 3,
                round(position.y() + metrics.ascent() + metrics.descent() -
                      (self.__editor.blockBoundingRect(block).height() * 8.0 / 100)),
                foundations.strings.to_string(block_number))
            block = block.next()

        painter.end()
        QWidget.paintEvent(self, event)
262191
def leaveEvent(self, event):
        
        super(XDockToolbar, self).leaveEvent(event)
        
        if not self.actionHeld():
            self.setCurrentAction(None)
624445
def paintEvent(self, event):
        
        make_flag = self.make_flag_qrect

        # Fill the whole painting area
        painter = QPainter(self)
        painter.fillRect(event.rect(), self.editor.sideareas_color)

        # Paint warnings and todos
        block = self.editor.document().firstBlock()
        for line_number in range(self.editor.document().blockCount()+1):
            data = block.userData()
            if data:
                if data.code_analysis:
                    # Paint the warnings
                    color = self.editor.warning_color
                    for source, code, severity, message in data.code_analysis:
                        error = severity == DiagnosticSeverity.ERROR
                        if error:
                            color = self.editor.error_color
                            break
                    self.set_painter(painter, color)
                    painter.drawRect(make_flag(line_number))
                if data.todo:
                    # Paint the todos
                    self.set_painter(painter, self.editor.todo_color)
                    painter.drawRect(make_flag(line_number))
                if data.breakpoint:
                    # Paint the breakpoints
                    self.set_painter(painter, self.editor.breakpoint_color)
                    painter.drawRect(make_flag(line_number))
            block = block.next()

        # Paint the occurrences
        if self.editor.occurrences:
            self.set_painter(painter, self.editor.occurrence_color)
            for line_number in self.editor.occurrences:
                painter.drawRect(make_flag(line_number))

        # Paint the found results
        if self.editor.found_results:
            self.set_painter(painter, self.editor.found_results_color)
            for line_number in self.editor.found_results:
                painter.drawRect(make_flag(line_number))

        # Paint the slider range
        if not self._unit_testing:
            alt = QApplication.queryKeyboardModifiers() & Qt.AltModifier
        else:
            alt = self._alt_key_is_down
        cursor_pos = self.mapFromGlobal(QCursor().pos())
        is_over_self = self.rect().contains(cursor_pos)
        is_over_editor = self.editor.rect().contains(
                self.editor.mapFromGlobal(QCursor().pos()))
        # We use QRect.contains instead of QWidget.underMouse method to
        # determined if the cursor is over the editor or the flag scrollbar
        # because the later gives a wrong result when a mouse button
        # is pressed.
        if ((is_over_self or (alt and is_over_editor)) and self.slider):
            pen_color = QColor(Qt.gray)
            pen_color.setAlphaF(.85)
            painter.setPen(pen_color)
            brush_color = QColor(Qt.gray)
            brush_color.setAlphaF(.5)
            painter.setBrush(QBrush(brush_color))
            painter.drawRect(self.make_slider_range(cursor_pos))
            self._range_indicator_is_visible = True
        else:
            self._range_indicator_is_visible = False
586255
def paintEvent(self, event):
        

        super(type(self), self).paintEvent(event)

        show_message = True
        model = self.model()
        if issubclass(type(model), GraphModel):
            if model.has_nodes():
                show_message = False
        elif issubclass(type(model), QAbstractItemModel) or \
                issubclass(type(model), QAbstractListModel) or \
                issubclass(type(model), QAbstractTableModel):
            if model.rowCount():
                show_message = False

        if show_message:
            self.__notifier.show_message(self.__message, 0)
        else:
            self.__notifier.hide_message()
1061400
def paintEvent(self, e):
        
        self._update_visible_blocks(e)
        super(CodeEdit, self).paintEvent(e)
        self.painted.emit(e)