UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.4k stars 254 forks source link

Combobox with PopupCompletion mode not materiallized #56

Closed jgrichard closed 2 years ago

jgrichard commented 2 years ago

When typing something in the combobox with PopupCompletion mode, the popup falls back to the default theme and not the material theme.

Code to reproduce:

import sys

from PySide6 import QtWidgets, QtCore, QtGui

from qt_material import apply_stylesheet

class Combobox(QtWidgets.QComboBox):

    def __init__(self):
        super(Combobox, self).__init__()
        apply_stylesheet(self, 'dark_cyan.xml')
        self.setEditable(True)
        self.completer().setCompletionMode(QtWidgets.QCompleter.CompletionMode.PopupCompletion)
        self.addItems(['TEST 1','TEST 2','TEST 3'])

if __name__ == '__main__':
    app = QtWidgets.QApplication()
    combobox = Combobox()
    combobox.show()
    app.exec()
    sys.exit()
jgrichard commented 2 years ago

Issue was setting apply_stylesheet on the QComboBox's self and not on the app variable.