MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / PushButtonMinimumWidth

Class PushButtonMinimumWidth

pyxrf/gui_module/useful_widgets.py:190–202  ·  view source on GitHub ↗

Push button with text ".." and minimum width

Source from the content-addressed store, hash-verified

188
189
190class PushButtonMinimumWidth(QPushButton):
191 """
192 Push button with text ".." and minimum width
193 """
194
195 def __init__(self, *args, **kwargs):
196 super().__init__(*args, **kwargs)
197 text = self.text()
198 font = self.font()
199
200 fm = QFontMetrics(font)
201 text_width = fm.width(text) + 6
202 self.setFixedWidth(text_width)
203
204
205class PushButtonNamed(QPushButton):

Callers 4

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
_setup_wd_groupMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected