Changeset 104978 in vbox
- Timestamp:
- Jun 20, 2024 1:14:00 PM (9 months ago)
- svn:sync-xref-src-repo-rev:
- 163588
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.cpp
r104638 r104978 5 5 6 6 /* 7 * Copyright (C) 2008-202 3Oracle and/or its affiliates.7 * Copyright (C) 2008-2024 Oracle and/or its affiliates. 8 8 * 9 9 * This file is part of VirtualBox base platform packages, as … … 48 48 , m_fAllowToCopyContentsWhenDisabled(false) 49 49 , m_pCopyAction(0) 50 , m_fMarkable(false) 51 , m_fMarkForError(false) 50 52 , m_pIconLabel(0) 51 , m_fMarkForError(false)52 , m_fMarkable(false)53 53 , m_iIconMargin(0) 54 54 { … … 60 60 , m_fAllowToCopyContentsWhenDisabled(false) 61 61 , m_pCopyAction(0) 62 , m_fMarkable(false) 63 , m_fMarkForError(false) 62 64 , m_pIconLabel(0) 63 , m_ fMarkForError(false)65 , m_iIconMargin(0) 64 66 { 65 67 prepare(); … … 79 81 { 80 82 setFixedWidth(fitTextWidth(strText).width()); 83 } 84 85 void QILineEdit::setMarkable(bool fMarkable) 86 { 87 if (m_fMarkable == fMarkable) 88 return; 89 m_fMarkable = fMarkable; 90 update(); 81 91 } 82 92 … … 96 106 m_pIconLabel->setToolTip(strToolTip); 97 107 m_iIconMargin = (height() - m_pIconLabel->height()) / 2; 98 update();99 }100 101 void QILineEdit::setMarkable(bool fMarkable)102 {103 if (m_fMarkable == fMarkable)104 return;105 m_fMarkable = fMarkable;106 108 update(); 107 109 } … … 144 146 } 145 147 146 void QILineEdit::moveIconLabel()147 {148 AssertPtrReturnVoid(m_pIconLabel);149 m_pIconLabel->move(width() - m_pIconLabel->width() - m_iIconMargin, m_iIconMargin);150 }151 152 148 void QILineEdit::showEvent(QShowEvent *pShowEvent) 153 149 { … … 200 196 return sa; 201 197 } 198 199 void QILineEdit::moveIconLabel() 200 { 201 AssertPtrReturnVoid(m_pIconLabel); 202 m_pIconLabel->move(width() - m_pIconLabel->width() - m_iIconMargin, m_iIconMargin); 203 } -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.h
r104631 r104978 5 5 6 6 /* 7 * Copyright (C) 2008-202 3Oracle and/or its affiliates.7 * Copyright (C) 2008-2024 Oracle and/or its affiliates. 8 8 * 9 9 * This file is part of VirtualBox base platform packages, as … … 62 62 void setFixedWidthByText(const QString &strText); 63 63 64 /** Defines whether line-edit is @a fMarkable. */ 65 void setMarkable(bool fMarkable); 64 66 /** Puts an icon to mark some error on the right hand side of the line edit. @p is used as tooltip of the icon. */ 65 67 void mark(bool fError, const QString &strErrorMessage, const QString &strNoErrorMessage); 66 67 void setMarkable(bool fMarkable);68 68 69 69 protected: … … 99 99 QAction *m_pCopyAction; 100 100 101 QLabel *m_pIconLabel; 102 bool m_fMarkForError; 103 bool m_fMarkable; 104 QString m_strErrorMessage; 105 int m_iIconMargin; 101 /** Holds whether line-edit is markable. */ 102 bool m_fMarkable; 103 /** Holds whether line-edit is marked for error. */ 104 bool m_fMarkForError; 105 /** Holds the icon label instance. */ 106 QLabel *m_pIconLabel; 107 /** Holds last error message. */ 108 QString m_strErrorMessage; 109 /** Holds cached icon margin. */ 110 int m_iIconMargin; 106 111 }; 107 112
Note:
See TracChangeset
for help on using the changeset viewer.