Create a styled QPushButton with hover and pressed effects.
(parent, text, min_size=None)
| 61 | |
| 62 | |
| 63 | def create_styled_button(parent, text, min_size=None): |
| 64 | """Create a styled QPushButton with hover and pressed effects.""" |
| 65 | button = QtWidgets.QPushButton(parent) |
| 66 | if min_size: |
| 67 | button.setMinimumSize(QtCore.QSize(*min_size)) |
| 68 | button.setStyleSheet(""" |
| 69 | QPushButton { |
| 70 | background-color: #3498db; |
| 71 | color: white; |
| 72 | font-family: 'Segoe UI'; |
| 73 | font-size: 16px; |
| 74 | font-weight: bold; |
| 75 | border-radius: 8px; |
| 76 | padding: 12px; |
| 77 | border: none; |
| 78 | } |
| 79 | QPushButton:hover { |
| 80 | background-color: #2980b9; |
| 81 | } |
| 82 | QPushButton:pressed { |
| 83 | background-color: #1c6ea4; |
| 84 | } |
| 85 | """) |
| 86 | button.setText(text) |
| 87 | return button |
| 88 | |
| 89 | |
| 90 | def create_input_field(parent, label_text, min_label_size=(120, 0)): |
no outgoing calls
no test coverage detected