Overloads the paint event to support rendering of hints if there are
        no items in the tree.
        
        :param      event | <QPaintEvent>
330300
def paintEvent(self, event):
        
        super(XListWidget, self).paintEvent(event)
        
        if not self.visibleCount() and self.hint():
            text    = self.hint()
            rect    = self.rect()
            
            # modify the padding on the rect
            w = min(250, rect.width() - 30)
            x = (rect.width() - w) / 2
            
            rect.setX(x)
            rect.setY(rect.y() + 15)
            rect.setWidth(w)
            rect.setHeight(rect.height() - 30)
            
            align = int(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
            
            # setup the coloring options
            clr     = self.hintColor()
            
            # paint the hint
            with XPainter(self.viewport()) as painter:
                painter.setPen(clr)
                painter.drawText(rect, align | QtCore.Qt.TextWordWrap, text)
849620
def keyPressEvent( self, event ):
        
        if ( event.key() in (Qt.Key_Enter, Qt.Key_Return) ):
            self.emitSaveRequested()
        
        super(XQueryBuilderWidget, self).keyPressEvent(event)
731422
def keyPressEvent( self, event ):
        
        if ( event.key() == Qt.Key_Escape ):
            self.reject()
            event.accept()
            return
        
        elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
            if self._autoDefault:
                self.accept()
                event.accept()
            return
        
        super(XPopupWidget, self).keyPressEvent(event)
41774
def leaveEvent(self, event):
        
        super(FoldingPanel, self).leaveEvent(event)
        QtWidgets.QApplication.restoreOverrideCursor()
        self._highlight_runner.cancel_requests()
        if not self.highlight_caret_scope:
            self._clear_scope_decos()
            self._mouse_over_line = None
            self._current_scope = None
        else:
            self._block_nbr = -1
            self._highlight_caret_scope()
        self.editor.repaint()
1337539
def keyPressEvent(self, event):
        
        if event.key() == Qt.Key_Return or event.key() == Qt.Key_Enter:
            if self.add_current_text_if_valid():
                self.selected()
                self.hide_completer()
        elif event.key() == Qt.Key_Escape:
            self.set_current_text(self.selected_text)
            self.hide_completer()
        else:
            QComboBox.keyPressEvent(self, event)
1198791
def keyPressEvent(self, event):
        

        processEvent = True
        for accelerator in self.__pre_input_accelerators:
            processEvent *= accelerator(self, event)

        if not processEvent:
            return

        Basic_QPlainTextEdit.keyPressEvent(self, event)

        for accelerator in self.__post_input_accelerators:
            accelerator(self, event)
615938
public void offerEvent(final Event event) throws IOException
    {
        if (!acceptEvents.get()) {
            // TODO shouldn't we increment eventsLost here?
            return;
        }

        eventsReceived.incrementAndGet();

        try {
            log.debug("Writing event: {}", event);
            eventWriter.write(event);
        }
        catch (IOException e) {
            log.error(String.format("Failed to write event: %s", event), e);
            eventsLost.incrementAndGet();

            throw e;
        }
    }
1019840
def paintEvent(self, event):
        
        if self.isHoverable() and self.icon().isNull():
            return

        # initialize the painter
        painter = QtGui.QStylePainter()
        painter.begin(self)
        try:
            option = QtGui.QStyleOptionToolButton()
            self.initStyleOption(option)

            # generate the scaling and rotating factors
            x_scale = 1
            y_scale = 1

            if self.flipHorizontal():
                x_scale = -1
            if self.flipVertical():
                y_scale = -1

            center = self.rect().center()
            painter.translate(center.x(), center.y())
            painter.rotate(self.angle())
            painter.scale(x_scale, y_scale)
            painter.translate(-center.x(), -center.y())

            painter.drawComplexControl(QtGui.QStyle.CC_ToolButton, option)
        finally:
            painter.end()
904547
def keyPressEvent(self, event):
        
        if event.key() == QtCore.Qt.Key_Escape:
            self.cancel()
        elif event.key() == QtCore.Qt.Key_Left:
            self.goBack()
        elif event.key() == QtCore.Qt.Key_Right:
            self.goForward()
        elif event.key() == QtCore.Qt.Key_Home:
            self.restart()
        
        super(XWalkthroughWidget, self).keyPressEvent(event)
1187553
def paintEvent(self, event):
        
        painter = QtGui.QPainter()
        painter.begin(self)
        try:
            x = 0
            y = 2
            w = self.width() - 1
            h = self.height() - 3
            palette = self.palette()
            clr = palette.color(palette.WindowText)
            clr.setAlpha(100)
            painter.setPen(QtGui.QPen(clr))

            if not self.isActive() and not self._hovered:
                painter.setBrush(palette.color(palette.Button))
            else:
                painter.setBrush(palette.color(palette.Window))

            painter.fillRect(x, y, w, h, painter.brush())
            painter.drawLine(x, y, w, y)
            painter.drawLine(w, y, w, h + 2)

            if self.parent().indexOf(self) == 0:
                painter.drawLine(x, y, x, h + 2)


            # draw the drag buttons
            if not self._locked:
                center = self._dragLabel.geometry().center()
                x = 6
                y = center.y()
                width = 3

                painter.setBrush(palette.color(palette.Window).lighter(120))

                painter.drawRect(x - width / 2, (y - width - 2) - width / 2, width, width)
                painter.drawRect(x - width / 2, y - width / 2, width, width)
                painter.drawRect(x - width / 2, (y + width + 2) - width / 2, width, width)

        finally:
            painter.end()
1269553
def paintEvent(self, event):
        
        painter = QPainter(self)
        painter.fillRect(event.rect(), self.palette().color(QPalette.Window))

        block = self._qpart.firstVisibleBlock()
        blockBoundingGeometry = self._qpart.blockBoundingGeometry(block).translated(self._qpart.contentOffset())
        top = blockBoundingGeometry.top()
        bottom = top + blockBoundingGeometry.height()

        for block in qutepart.iterateBlocksFrom(block):
            height = self._qpart.blockBoundingGeometry(block).height()
            if top > event.rect().bottom():
                break
            if block.isVisible() and \
               bottom >= event.rect().top():
                if block.blockNumber() in self._qpart.lintMarks:
                    msgType, msgText = self._qpart.lintMarks[block.blockNumber()]
                    pixMap = self._lintPixmaps[msgType]
                    yPos = top + ((height - pixMap.height()) / 2)  # centered
                    painter.drawPixmap(0, yPos, pixMap)

                if self.isBlockMarked(block):
                    yPos = top + ((height - self._bookmarkPixmap.height()) / 2)  # centered
                    painter.drawPixmap(0, yPos, self._bookmarkPixmap)

            top += height
417799
def enterEvent(self, event):
        
        super(CallTipWidget, self).enterEvent(event)
        if self.as_tooltip:
            self.hide()

        if (self._hide_timer.isActive() and
          self.app.topLevelAt(QCursor.pos()) == self):
            self._hide_timer.stop()
528040
def paintEvent(self, event):
        
        super(IconLineEdit, self).paintEvent(event)
        painter = QPainter(self)

        rect = self.geometry()
        space = int((rect.height())/6)
        h = rect.height() - space
        w = rect.width() - h

        if self._icon_visible:
            if self._status and self._status_set:
                pixmap = self._set_icon.pixmap(h, h)
            elif self._status:
                pixmap = self._valid_icon.pixmap(h, h)
            else:
                pixmap = self._invalid_icon.pixmap(h, h)

            painter.drawPixmap(w, space, pixmap)

        application_style = QApplication.style().objectName()
        if self._application_style != application_style:
            self._application_style = application_style
            self._refresh()

        # Small hack to gurantee correct padding on Spyder start
        if self._paint_count < 5:
            self._paint_count += 1
            self._refresh()
813287
def hoverEnterEvent(self, event):
        
        self._hovered = True
        if self.toolTip():
            QToolTip.showText(QCursor.pos(), self.toolTip())
            return True
        
        return self.style() == XNodeHotspot.Style.Icon
885260
def showEvent(self, event):
        
        super(CodeEdit, self).showEvent(event)
        self.panels.refresh()
308432
def event(self, event):
        
        if event.type() == QEvent.KeyPress and event.key() == Qt.Key_Tab:
            return False
        return QWidget.event(self, event)
570844
@SubscribeEvent
	public void onRenderLast(RenderWorldLastEvent event)
	{
		for (IRenderWorldLast renderer : renderWorldLastRenderers)
		{
			if (renderer.shouldRender(event, Utils.getClientWorld()))
				renderer.renderWorldLastEvent(event, Utils.getClientWorld());
		}
	}