Changeset 106002 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Sep 10, 2024 11:35:42 AM (5 months ago)
- svn:sync-xref-src-repo-rev:
- 164748
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r105525 r106002 457 457 if (m_pSelectorPath) 458 458 { 459 m_pLabelPath->setBuddy(m_pSelectorPath ->focusProxy());459 m_pLabelPath->setBuddy(m_pSelectorPath); 460 460 QString strDefaultMachineFolder = gpGlobalSession->virtualBox().GetSystemProperties().GetDefaultMachineFolder(); 461 461 m_pSelectorPath->setPath(strDefaultMachineFolder); … … 480 480 if (m_pSelectorImage) 481 481 { 482 m_pLabelImage->setBuddy(m_pSelectorImage ->focusProxy());482 m_pLabelImage->setBuddy(m_pSelectorImage); 483 483 m_pSelectorImage->setResetEnabled(false); 484 484 m_pSelectorImage->setMode(UIFilePathSelector::Mode_File_Open); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIRecordingSettingsEditor.cpp
r105120 r106002 512 512 { 513 513 if (m_pLabelFilePath) 514 m_pLabelFilePath->setBuddy(m_pEditorFilePath ->focusProxy());514 m_pLabelFilePath->setBuddy(m_pEditorFilePath); 515 515 m_pEditorFilePath->setEditable(false); 516 516 m_pEditorFilePath->setMode(UIFilePathSelector::Mode_File_Save); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
r104899 r106002 69 69 70 70 UIFilePathSelector::UIFilePathSelector(QWidget *pParent /* = 0 */) 71 : Q IComboBox(pParent)71 : QComboBox(pParent) 72 72 , m_enmMode(Mode_Folder) 73 73 , m_strInitialPath(QDir::current().absolutePath()) … … 139 139 if (m_fEditable) 140 140 { 141 QIComboBox::setEditable(true); 141 /* Call to base-class: */ 142 QComboBox::setEditable(true); 142 143 143 144 /* Install combo-box event-filter: */ 144 Assert(comboBox()); 145 comboBox()->installEventFilter(this); 145 this->installEventFilter(this); 146 147 /* Configure a type of line-edit: */ 148 setLineEdit(new QILineEdit); 146 149 147 150 /* Install line-edit connection/event-filter: */ … … 160 163 this, &UIFilePathSelector::onTextEdited); 161 164 } 162 if (comboBox()) 163 { 164 /* Remove combo-box event-filter: */ 165 comboBox()->removeEventFilter(this); 166 } 167 QIComboBox::setEditable(false); 168 } 165 166 /* Remove combo-box event-filter: */ 167 this->removeEventFilter(this); 168 169 /* Call to base-class: */ 170 QComboBox::setEditable(false); 171 } 172 } 173 174 void UIFilePathSelector::setMarkable(bool fMarkable) 175 { 176 QILineEdit *pLineEdit = isEditable() ? qobject_cast<QILineEdit*>(lineEdit()) : 0; 177 if (pLineEdit) 178 pLineEdit->setMarkable(fMarkable); 179 } 180 181 void UIFilePathSelector::mark(bool fError, const QString &strErrorMessage, const QString &strNoErrorMessage) 182 { 183 QILineEdit *pLineEdit = isEditable() ? qobject_cast<QILineEdit*>(lineEdit()) : 0; 184 setMarkable(true); 185 if (pLineEdit) 186 pLineEdit->mark(fError, strErrorMessage, strNoErrorMessage); 169 187 } 170 188 … … 202 220 { 203 221 /* Call to base-class: */ 204 Q IComboBox::setToolTip(strToolTip);222 QComboBox::setToolTip(strToolTip); 205 223 206 224 /* Remember if the tool-tip overriden: */ … … 244 262 { 245 263 /* If the object is private combo-box: */ 246 if (pObject == comboBox())264 if (pObject == this) 247 265 { 248 266 /* Handle focus events related to private child: */ … … 263 281 264 282 /* Call to base-class: */ 265 return Q IComboBox::eventFilter(pObject, pEvent);283 return QComboBox::eventFilter(pObject, pEvent); 266 284 } 267 285 268 286 void UIFilePathSelector::resizeEvent(QResizeEvent *pEvent) 269 287 { 270 Q IComboBox::resizeEvent(pEvent);288 QComboBox::resizeEvent(pEvent); 271 289 refreshText(); 272 290 } … … 283 301 refreshText(); 284 302 } 285 Q IComboBox::focusInEvent(pEvent);303 QComboBox::focusInEvent(pEvent); 286 304 } 287 305 … … 293 311 refreshText(); 294 312 } 295 Q IComboBox::focusOutEvent(pEvent);313 QComboBox::focusOutEvent(pEvent); 296 314 } 297 315 … … 561 579 /* Set the tool-tip: */ 562 580 if (!m_fToolTipOverriden) 563 Q IComboBox::setToolTip(fullPath());581 QComboBox::setToolTip(fullPath()); 564 582 setItemData(PathId, toolTip(), Qt::ToolTipRole); 565 583 … … 591 609 /* Set the tool-tip: */ 592 610 if (!m_fToolTipOverriden) 593 Q IComboBox::setToolTip(m_strNoneToolTip);611 QComboBox::setToolTip(m_strNoneToolTip); 594 612 setItemData(PathId, toolTip(), Qt::ToolTipRole); 595 613 } … … 611 629 /* Set the tool-tip: */ 612 630 if (!m_fToolTipOverriden) 613 Q IComboBox::setToolTip(fullPath());631 QComboBox::setToolTip(fullPath()); 614 632 setItemData(PathId, toolTip(), Qt::ToolTipRole); 615 633 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
r104358 r106002 32 32 #endif 33 33 34 /* Qt includes: */ 35 #include <QComboBox> 36 34 37 /* GUI includes: */ 35 #include "QIComboBox.h"36 38 #include "UILibraryDefs.h" 37 39 #include "UIMediumDefs.h" … … 49 51 class QIToolButton; 50 52 51 /** Q IComboBox subclass providing GUI with the53 /** QComboBox subclass providing GUI with the 52 54 * possibility to choose/reflect file/folder path. */ 53 class SHARED_LIBRARY_STUFF UIFilePathSelector : public Q IComboBox55 class SHARED_LIBRARY_STUFF UIFilePathSelector : public QComboBox 54 56 { 55 57 Q_OBJECT; … … 78 80 }; 79 81 80 /** Constructs file-path selector passing @a pParent to Q IComboBox base-class. */82 /** Constructs file-path selector passing @a pParent to QComboBox base-class. */ 81 83 UIFilePathSelector(QWidget *pParent = 0); 82 84 … … 90 92 /** Returns whether the path is editable. */ 91 93 bool isEditable() const { return m_fEditable; } 94 /** Calls QILineEdit member's setMarkable API. */ 95 void setMarkable(bool fMarkable); 96 /** Marks the line edit of the combobox. Refer to QILineEdit::mark(..). */ 97 void mark(bool fError, const QString &strErrorMessage, const QString &strNoErrorMessage); 92 98 93 99 /** Defines whether the reseting to defauilt path is @a fEnabled. */
Note:
See TracChangeset
for help on using the changeset viewer.