Changeset 72154 in vbox for trunk/src/VBox
- Timestamp:
- May 8, 2018 7:52:06 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
r72153 r72154 105 105 :QLineEdit(parent) 106 106 , m_pRemoveTermButton(0) 107 , m_pClearAllButton(0) 107 108 , m_iRemoveTermButtonSize(16) 108 109 , m_iTrailingSpaceCount(1) … … 146 147 { 147 148 QLineEdit::paintEvent(event); 149 150 if (!m_pClearAllButton || !m_pRemoveTermButton) 151 createButtons(); 148 152 int clearButtonSize = height(); 149 153 m_pClearAllButton->setGeometry(width() - clearButtonSize, 0, clearButtonSize, clearButtonSize); … … 191 195 void UIVMFilterLineEdit::createButtons() 192 196 { 193 m_pRemoveTermButton = new QToolButton(this); 194 if (m_pRemoveTermButton) 195 { 196 m_pRemoveTermButton->setIcon(m_pRemoveTermButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton)); 197 m_pRemoveTermButton->hide(); 198 connect(m_pRemoveTermButton, &QToolButton::clicked, this, &UIVMFilterLineEdit::sltRemoveFilterTerm); 199 } 200 201 m_pClearAllButton = new QToolButton(this); 202 if (m_pClearAllButton) 203 { 204 m_pClearAllButton->setIcon(m_pRemoveTermButton->style()->standardIcon(QStyle::SP_LineEditClearButton)); 205 connect(m_pClearAllButton, &QToolButton::clicked, this, &UIVMFilterLineEdit::sltClearAll); 197 if (!m_pRemoveTermButton) 198 { 199 m_pRemoveTermButton = new QToolButton(this); 200 if (m_pRemoveTermButton) 201 { 202 m_pRemoveTermButton->setIcon(m_pRemoveTermButton->style()->standardIcon(QStyle::SP_TitleBarCloseButton)); 203 m_pRemoveTermButton->hide(); 204 connect(m_pRemoveTermButton, &QToolButton::clicked, this, &UIVMFilterLineEdit::sltRemoveFilterTerm); 205 } 206 } 207 208 if (!m_pClearAllButton) 209 { 210 m_pClearAllButton = new QToolButton(this); 211 if (m_pClearAllButton) 212 { 213 m_pClearAllButton->setIcon(m_pClearAllButton->style()->standardIcon(QStyle::SP_LineEditClearButton)); 214 connect(m_pClearAllButton, &QToolButton::clicked, this, &UIVMFilterLineEdit::sltClearAll); 215 } 206 216 } 207 217 }
Note:
See TracChangeset
for help on using the changeset viewer.