To set a skin (styling) to the lineEdit part of a QComboBox when the mouse hovers over it, you can make use of the QComboBox::setStyleSheet() method combined with the right style sheet selectors and properties.
Here's how you can style the lineEdit part of a QComboBox during a hover event:
combobox.setStyleSheet(""" QComboBox:hover QAbstractItemView { border: none; /* Optional: remove the border of the dropdown list */ } QComboBox:hover QLineEdit { background-color: lightblue; /* Change as per your requirement */ border: 2px solid blue; } """) Let's look at a more comprehensive example:
import sys from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox class App(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): layout = QVBoxLayout() combobox = QComboBox(self) combobox.setEditable(True) combobox.addItems(['Option 1', 'Option 2', 'Option 3']) # Styling the lineEdit part of the combobox when mouse hovers combobox.setStyleSheet(""" QComboBox:hover QAbstractItemView { border: none; } QComboBox:hover QLineEdit { background-color: lightblue; border: 2px solid blue; } """) layout.addWidget(combobox) self.setLayout(layout) self.setWindowTitle('PyQt5 QComboBox Styling') self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = App() sys.exit(app.exec_()) In this example, when you hover over the QComboBox, you'll see that the lineEdit part gets styled with a lightblue background color and a blue border. Adjust the colors and other style properties as per your requirements.
spring-security adjustpan haskell data-analysis executable admin flutter-widget html-parsing decoding time-series