def METHOD_NAME(
        base: QIcon, size: QSize, scale: float, mode: QIcon.Mode,
        state: QIcon.State
) -> QPixmap:
    """
    Like QIcon.pixmap(size: QSize, scale: float, ...) overload in Qt6.
    On Qt 6 this directly calls the corresponding overload.
    On Qt 5 this is emulated by painting on a suitable constructed pixmap.
    """
    size = base.actualSize(size * scale, mode, state)
    pm = QPixmap(size)
    pm.setDevicePixelRatio(scale)
    pm.fill(Qt.transparent)
    p = QPainter(pm)
    base.paint(p, 0, 0, size.width(), size.height(), Qt.AlignCenter, mode, state)
    p.end()
    return pm