Create a horizontal layout with a label and a QLineEdit.
(parent, label_text, min_label_size=(120, 0))
| 88 | |
| 89 | |
| 90 | def 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 | |
| 114 | def create_input_field_V(parent, label_text, min_label_size=(120, 0)): |
no test coverage detected