Changeset 87734 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 12, 2021 1:47:41 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142786
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp
r87731 r87734 24 24 25 25 /* GUI includes: */ 26 #include "QILineEdit.h" 26 27 #include "QIRichTextLabel.h" 27 28 #include "QIToolButton.h" … … 243 244 { 244 245 bool fComplete = (m_pUserNameLineEdit && !m_pUserNameLineEdit->text().isEmpty()); 245 markLineEdit(m_pUserNameLineEdit, !fComplete); 246 if (m_pUserNameLineEdit) 247 m_pUserNameLineEdit->mark(!fComplete); 246 248 return fComplete; 247 249 } … … 365 367 } 366 368 367 void UIUserNamePasswordEditor::markLineEdit(QLineEdit *pLineEdit, bool fError)368 {369 if (!pLineEdit)370 return;371 QPalette palette = pLineEdit->palette();372 if (!fError || m_fForceUnmark)373 palette.setColor(QPalette::Base, m_orginalLineEditBaseColor);374 else375 palette.setColor(QPalette::Base, QColor(255, 180, 180));376 pLineEdit->setPalette(palette);377 }378 379 369 void UIUserNamePasswordEditor::prepare() 380 370 { … … 385 375 setLayout(pMainLayout); 386 376 int iRow = 0; 387 addLineEdit<Q LineEdit>(iRow, m_pUserNameLabel, m_pUserNameLineEdit, pMainLayout);377 addLineEdit<QILineEdit>(iRow, m_pUserNameLabel, m_pUserNameLineEdit, pMainLayout); 388 378 addLineEdit<UIPasswordLineEdit>(iRow, m_pPasswordLabel, m_pPasswordLineEdit, pMainLayout); 389 379 addLineEdit<UIPasswordLineEdit>(iRow, m_pPasswordRepeatLabel, m_pPasswordRepeatLineEdit, pMainLayout); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h
r87731 r87734 32 32 class QGridLayout; 33 33 class QLabel; 34 class Q LineEdit;34 class QILineEdit; 35 35 class UIPasswordLineEdit; 36 36 … … 78 78 template <class T> 79 79 void addLineEdit(int &iRow, QLabel *&pLabel, T *&pLineEdit, QGridLayout *pLayout); 80 /** Changes @p pLineEdit's base color to indicate an error or reverts it to the original color. */81 void markLineEdit(QLineEdit *pLineEdit, bool fError);82 80 83 81 bool isUserNameComplete(); 84 82 bool isPasswordComplete(); 85 83 86 Q LineEdit*m_pUserNameLineEdit;84 QILineEdit *m_pUserNameLineEdit; 87 85 UIPasswordLineEdit *m_pPasswordLineEdit; 88 86 UIPasswordLineEdit *m_pPasswordRepeatLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.