MCPcopy Create free account
hub / github.com/PyQt5/PyQt / PathComboBox

Class PathComboBox

Test/ColumnView.py:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class PathComboBox(QComboBox):
22
23 def __init__(self, *args, is_item=False, **kwargs):
24 super(PathComboBox, self).__init__(*args, **kwargs)
25 self.is_item = is_item
26 if not self.is_item:
27 self.setEditable(True)
28 layout = QHBoxLayout(self)
29 layout.setSpacing(0)
30 layout.setContentsMargins(0, 0, 0, 23)
31 layout.addItem(QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum))
32 else:
33 self.f_model = QFileSystemModel(self)
34 self.f_model.setRootPath('')
35 self.setModel(self.f_model)
36
37 def addWidget(self, widget):
38 self.layout().insertWidget(self.layout().count() - 1, widget)
39
40
41if __name__ == '__main__':

Callers 1

ColumnView.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected