Read-only version of QLineEdit with background set to the same color as the background of the disabled QLineEdit, but font color the same as active QLineEdit.
| 156 | |
| 157 | |
| 158 | class LineEditReadOnly(LineEditExtended): |
| 159 | """ |
| 160 | Read-only version of QLineEdit with background set to the same color |
| 161 | as the background of the disabled QLineEdit, but font color the same |
| 162 | as active QLineEdit. |
| 163 | """ |
| 164 | |
| 165 | def __init__(self, *args, **kwargs): |
| 166 | super().__init__(*args, **kwargs) |
| 167 | self.setReadOnly(True) |
| 168 | # Set background color the same as for disabled window. |
| 169 | p = self.palette() |
| 170 | p.setColor(QPalette.Base, p.color(QPalette.Disabled, QPalette.Base)) |
| 171 | self.setPalette(p) |
| 172 | |
| 173 | |
| 174 | class TextEditReadOnly(QTextEdit): |
no outgoing calls
no test coverage detected