Changeset 60928 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 10, 2016 3:16:04 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
r60922 r60928 28 28 # include <QHBoxLayout> 29 29 # include <QLineEdit> 30 # include <QTimer>31 30 32 31 /* GUI includes: */ … … 67 66 , m_fEditableMode(false) 68 67 , m_fMouseAwaited(false) 68 , m_fToolTipOverriden(false) 69 69 , m_pCopyAction(new QAction(this)) 70 70 { … … 145 145 } 146 146 147 void UIFilePathSelector::setToolTip(const QString &strToolTip) 148 { 149 /* Call to base-class: */ 150 QComboBox::setToolTip(strToolTip); 151 152 /* Remember if the tool-tip overriden: */ 153 m_fToolTipOverriden = !toolTip().isEmpty(); 154 } 155 147 156 void UIFilePathSelector::setPath(const QString &strPath, bool fRefreshText /* = true */) 148 157 { … … 156 165 { 157 166 if (m_fMouseAwaited && (pEvent->type() == QEvent::MouseButtonPress)) 158 Q Timer::singleShot(0, this, SLOT(refreshText()));167 QMetaObject::invokeMethod(this, "refreshText", Qt::QueuedConnection); 159 168 160 169 return QIWithRetranslateUI<QComboBox>::eventFilter(pObject, pEvent); … … 464 473 465 474 /* Set the tool-tip: */ 466 setToolTip(m_strNoneToolTipFocused); 475 if (!m_fToolTipOverriden) 476 QComboBox::setToolTip(m_strNoneToolTipFocused); 467 477 setItemData(PathId, toolTip(), Qt::ToolTipRole); 468 478 … … 493 503 494 504 /* Set the tool-tip: */ 495 setToolTip(m_strNoneToolTip); 505 if (!m_fToolTipOverriden) 506 QComboBox::setToolTip(m_strNoneToolTip); 496 507 setItemData(PathId, toolTip(), Qt::ToolTipRole); 497 508 } … … 512 523 513 524 /* Set the tool-tip: */ 514 setToolTip(fullPath()); 525 if (!m_fToolTipOverriden) 526 QComboBox::setToolTip(fullPath()); 515 527 setItemData(PathId, toolTip(), Qt::ToolTipRole); 516 528 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h
r60922 r60928 105 105 QString path() const { return m_strPath; } 106 106 107 /** Sets overriden widget's @a strToolTip. 108 * @note If nothing set it's generated automatically. */ 109 void setToolTip(const QString &strToolTip); 110 107 111 public slots: 108 112 … … 192 196 bool m_fMouseAwaited; 193 197 198 /** Holds whether the tool-tip overriden. */ 199 bool m_fToolTipOverriden; 200 194 201 /** Holds the copy action instance. */ 195 202 QAction *m_pCopyAction;
Note:
See TracChangeset
for help on using the changeset viewer.