Changeset 87204 in vbox
- Timestamp:
- Jan 8, 2021 4:44:45 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r87175 r87204 30 30 #include <QMenu> 31 31 #include <QHBoxLayout> 32 #include <QScrollBar> 32 33 #include <QWidgetAction> 33 34 #ifdef RT_OS_SOLARIS … … 110 111 111 112 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */; 113 virtual void keyPressEvent(QKeyEvent *pEvent) /* override */; 112 114 113 115 private: … … 251 253 } 252 254 255 void UIFindInPageWidget::keyPressEvent(QKeyEvent *pEvent) 256 { 257 switch (pEvent->key()) 258 { 259 case Qt::Key_Escape: 260 emit sigClose(); 261 return; 262 break; 263 case Qt::Key_Down: 264 emit sigSelectNextMatch(); 265 return; 266 break; 267 case Qt::Key_Up: 268 emit sigSelectPreviousMatch(); 269 return; 270 break; 271 default: 272 QIWithRetranslateUI<QWidget>::keyPressEvent(pEvent); 273 break; 274 } 275 } 276 253 277 void UIFindInPageWidget::prepare() 254 278 { … … 365 389 if (!m_pFindInPageWidget) 366 390 return; 391 /* Closing the find in page widget causes QTextBrowser to jump to the top of the document. This hack puts it back into position: */ 392 int iPosition = verticalScrollBar()->value(); 367 393 /* Try to position the widget somewhere meaningful initially: */ 368 394 if (!m_fFindWidgetDragged) … … 376 402 document()->undo(); 377 403 m_pFindInPageWidget->clearSearchField(); 404 verticalScrollBar()->setValue(iPosition); 378 405 } 379 406 else
Note:
See TracChangeset
for help on using the changeset viewer.