MCPcopy Index your code
hub / github.com/geekcomputers/Python / create_input_field

Function create_input_field

bank_managment_system/QTFrontend.py:90–111  ·  view source on GitHub ↗

Create a horizontal layout with a label and a QLineEdit.

(parent, label_text, min_label_size=(120, 0))

Source from the content-addressed store, hash-verified

88
89
90def create_input_field(parent, label_text, min_label_size=(120, 0)):
91 """Create a horizontal layout with a label and a QLineEdit."""
92 frame = create_styled_frame(parent, style="padding: 7px;")
93 layout = QtWidgets.QHBoxLayout(frame)
94 layout.setContentsMargins(0, 0, 0, 0)
95 layout.setSpacing(0)
96
97 label = create_styled_label(
98 frame, label_text, font_size=12, bold=True, style="color: #2c3e50;"
99 )
100 if min_label_size:
101 label.setMinimumSize(QtCore.QSize(*min_label_size))
102
103 line_edit = QtWidgets.QLineEdit(frame)
104 line_edit.setFont(FONT_SIZE)
105 line_edit.setStyleSheet(
106 "background-color: #f0f0f0; border: 1px solid #ccc; border-radius: 4px; padding: 8px;"
107 )
108
109 layout.addWidget(label)
110 layout.addWidget(line_edit)
111 return frame, line_edit
112
113
114def create_input_field_V(parent, label_text, min_label_size=(120, 0)):

Callers 8

search_resultFunction · 0.85
get_employee_nameFunction · 0.85
create_login_pageFunction · 0.85
create_add_employee_pageFunction · 0.85
create_account_pageFunction · 0.85
update_userFunction · 0.85

Calls 2

create_styled_frameFunction · 0.85
create_styled_labelFunction · 0.85

Tested by

no test coverage detected