Changeset 101031 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 6, 2023 3:06:02 PM (16 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r101028 r101031 79 79 } 80 80 81 void UISettingsPage::filterOut(const QString &strFilter) 82 { 83 /* Propagate filter towards all the children: */ 84 foreach (UIEditor *pEditor, m_editors) 85 pEditor->filterOut(strFilter); 86 87 /* Check if at least one of children visible: */ 88 bool fVisible = false; 89 foreach (UIEditor *pEditor, m_editors) 90 if (pEditor->isVisibleTo(this)) 91 { 92 fVisible = true; 93 break; 94 } 95 96 /* Update page visibility: */ 97 setVisible(fVisible); 98 } 99 81 100 void UISettingsPage::revalidate() 82 101 { … … 166 185 167 186 UISettingsPageFrame::UISettingsPageFrame(UISettingsPage *pPage, QWidget *pParent /* = 0 */) 168 : QWidget(pParent)187 : UIEditor(pParent) 169 188 , m_pPage(pPage) 170 189 , m_pLabelName(0) … … 183 202 if (m_pLabelName) 184 203 m_pLabelName->setText(m_strName); 204 } 205 206 void UISettingsPageFrame::filterOut(const QString &strFilter) 207 { 208 /* Propagate filter to the child: */ 209 AssertReturnVoid(m_editors.size() == 1); 210 m_editors.first()->filterOut(strFilter); 211 212 /* Check if child visible: */ 213 const bool fVisible = m_editors.first()->isVisibleTo(this); 214 215 /* Update frame visibility: */ 216 setVisible(fVisible); 217 } 218 219 void UISettingsPageFrame::retranslateUi() 220 { 221 // No NLS tags for now; We are receiving our name through the getter. 185 222 } 186 223 … … 293 330 m_pLayout = new QVBoxLayout(m_pWidget); 294 331 if (m_pLayout) 332 { 295 333 m_pLayout->addWidget(m_pPage); 334 /// @todo what about removal handling? 335 m_editors << m_pPage; 336 } 296 337 pLayoutMain->addWidget(m_pWidget); 297 338 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r101028 r101031 91 91 92 92 93 /** QWidget subclass used as settings page interface. */94 class UISettingsPage : public QIWithRetranslateUI<QWidget>93 /** UIEditor sub-class used as settings page interface. */ 94 class UISettingsPage : public UIEditor 95 95 { 96 96 Q_OBJECT; … … 184 184 virtual void polishPage() {} 185 185 186 /** Filters out contents with description unrelated to passed @a strFilter. */ 187 virtual void filterOut(const QString &strFilter) RT_OVERRIDE; 188 186 189 public slots: 187 190 … … 281 284 282 285 283 /** QWidgetsub-class, used as settings page frame. */284 class UISettingsPageFrame : public QWidget286 /** UIEditor sub-class, used as settings page frame. */ 287 class UISettingsPageFrame : public UIEditor 285 288 { 286 289 Q_OBJECT; … … 295 298 void setName(const QString &strName); 296 299 300 /** Filters out contents with description unrelated to passed @a strFilter. */ 301 virtual void filterOut(const QString &strFilter) RT_OVERRIDE; 302 297 303 protected: 304 305 /** Handles translation event. */ 306 virtual void retranslateUi() RT_OVERRIDE; 298 307 299 308 /** Handles paint @a pEvent. */
Note:
See TracChangeset
for help on using the changeset viewer.