To add a border to the down button of a QSpinBox when it is pressed in PyQt5, you can use the QStyle framework and specifically style the QSpinBox with a stylesheet.
Here's an example of how to do this:
import sys from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QSpinBox class DemoApp(QWidget): def __init__(self): super().__init__() self.init_ui() def init_ui(self): layout = QVBoxLayout() spinbox = QSpinBox(self) # Set the stylesheet to add a border to the down button when pressed spinbox.setStyleSheet(""" QSpinBox::down-button:pressed { border: 2px solid red; } """) layout.addWidget(spinbox) self.setLayout(layout) app = QApplication(sys.argv) window = DemoApp() window.show() sys.exit(app.exec_()) In the above code:
QWidget with a QSpinBox.setStyleSheet method, we add a stylesheet to the QSpinBox to specifically style the down button when it's pressed with a red border.You can modify the stylesheet further to adjust the look and feel of the QSpinBox or any other widget components as per your requirements.
numericupdown transfer apollo na osx-elcapitan google-polyline python-3.4 bezier spring-batch uikit