Changeset 86799 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 3, 2020 2:50:06 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r86797 r86799 599 599 600 600 AssertReturnVoid(m_pContentWidget && m_pIndexWidget && m_pContentModel); 601 m_pContentWidget->installEventFilter(this);602 601 m_pSplitter->addWidget(m_pTabWidget); 603 602 … … 616 615 connect(m_pHelpEngine, &QHelpEngine::setupFinished, 617 616 this, &UIHelpBrowserWidget::sltHandleHelpEngineSetupFinished); 618 connect(m_pContentWidget, &QHelpContentWidget::clicked, 619 this, &UIHelpBrowserWidget::sltHandleContentWidgetItemClicked); 617 if (m_pContentWidget->selectionModel()) 618 connect(m_pContentWidget->selectionModel(), &QItemSelectionModel::selectionChanged, 619 this, &UIHelpBrowserWidget::sltHandleContentWidgetSelectionChanged); 620 620 connect(m_pContentModel, &QHelpContentModel::contentsCreated, 621 621 this, &UIHelpBrowserWidget::sltHandleContentsCreated); … … 771 771 } 772 772 773 bool UIHelpBrowserWidget::eventFilter(QObject *pWatched, QEvent *pEvent)774 {775 if (pWatched == m_pContentWidget)776 {777 if (pEvent->type() == QEvent::MouseButtonPress ||778 pEvent->type() == QEvent::MouseMove ||779 pEvent->type() == QEvent::KeyPress ||780 pEvent->type() == QEvent::MouseButtonDblClick)781 printf("xxxxxxxxxxx %d\n", pEvent->type());782 else783 printf("%d\n", pEvent->type());784 785 }786 return false;787 }788 789 773 void UIHelpBrowserWidget::cleanup() 790 774 { … … 871 855 const QUrl &url = pItem->url(); 872 856 m_pTabManager->setCurrentSource(url); 873 } 874 857 858 m_pContentWidget->scrollTo(index, QAbstractItemView::EnsureVisible); 859 m_pContentWidget->expand(index); 860 861 } 862 863 void UIHelpBrowserWidget::sltHandleContentWidgetSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) 864 { 865 Q_UNUSED(deselected); 866 QModelIndexList selectedItemIndices = selected.indexes(); 867 if (selectedItemIndices.isEmpty()) 868 return; 869 sltHandleContentWidgetItemClicked(selectedItemIndices[0]); 870 } 875 871 876 872 void UIHelpBrowserWidget::sltHandleHelpBrowserViewerSourceChange(const QUrl &source) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r86797 r86799 38 38 /* Forward declarations: */ 39 39 class QHBoxLayout; 40 class QItemSelection; 40 41 class QVBoxLayout; 41 42 class QHelpEngine; … … 85 86 void sltHandleHelpEngineSetupFinished(); 86 87 void sltHandleContentWidgetItemClicked(const QModelIndex &index); 88 void sltHandleContentWidgetSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); 87 89 void sltHandleSideBarVisibility(bool togggled); 88 90 void sltHandleToolBarVisibility(bool togggled); … … 107 109 void cleanup(); 108 110 QUrl findIndexHtml() const; 109 bool eventFilter(QObject *pWatched, QEvent *pEvent);111 //bool eventFilter(QObject *pWatched, QEvent *pEvent); 110 112 111 113 /** @name Event handling stuff.
Note:
See TracChangeset
for help on using the changeset viewer.