We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4812b1e commit 2ba760eCopy full SHA for 2ba760e
1 file changed
COMTool/Combobox.py
@@ -1,4 +1,4 @@
1
-from PyQt5.QtWidgets import QComboBox,QListView
+from PyQt5.QtWidgets import QComboBox,QListView,QApplication
2
from PyQt5.QtCore import pyqtSignal
3
4
@@ -21,6 +21,14 @@ def showPopup(self):
21
pass
22
23
def _showPopup(self):
24
+ max_w = 0
25
+ for i in range(self.count()):
26
+ w = self.view().sizeHintForColumn(i)
27
+ if w > max_w:
28
+ max_w = w
29
+
30
+ screen_width = QApplication.desktop().availableGeometry().width()
31
+ self.view().setMinimumWidth(min(max_w + 50, screen_width))
32
super(ComboBox, self).showPopup()
33
34
def showItems(self):
0 commit comments