Changeset 94032 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 1, 2022 11:29:17 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r93990 r94032 21 21 #include <QtGlobal> 22 22 #ifdef VBOX_WITH_QHELP_VIEWER 23 #include <QtHelp/QHelpEngine> 24 #include <QtHelp/QHelpContentWidget> 25 #include <QtHelp/QHelpIndexWidget> 26 #include <QtHelp/QHelpSearchEngine> 27 #include <QtHelp/QHelpSearchQueryWidget> 28 #include <QtHelp/QHelpSearchResultWidget> 23 # include <QtHelp/QHelpEngine> 24 # include <QtHelp/QHelpContentWidget> 25 # include <QtHelp/QHelpIndexWidget> 26 # include <QtHelp/QHelpSearchEngine> 27 # include <QtHelp/QHelpSearchQueryWidget> 28 # include <QtHelp/QHelpSearchResultWidget> 29 # if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) 30 # include <QtHelp/QHelpLink> 31 # endif 29 32 #endif 30 33 #include <QLabel> … … 71 74 static const int iBookmarkUrlDataType = 6; 72 75 76 73 77 /********************************************************************************************************************************* 74 * UIZoomMenuAction definition. *78 * UIZoomMenuAction definition. * 75 79 *********************************************************************************************************************************/ 76 80 class UIZoomMenuAction : public QIWithRetranslateUI<QWidgetAction> … … 187 191 void sigOpenLinkInNewTab(const QUrl &url, bool fBackground); 188 192 void sigAddBookmark(const QUrl &url, const QString &strTitle); 193 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 194 void sigLinkHighlighted(const QUrl &url); 195 #else 189 196 void sigLinkHighlighted(const QString &strLink); 197 #endif 190 198 void sigZoomPercentageChanged(int iPercentage); 191 199 void sigFindInPageWidgetVisibilityChanged(bool fVisible); … … 267 275 /** list.first is tab title and list.second is tab's index. */ 268 276 void sigTabsListChanged(const QStringList &titleList); 277 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 278 void sigLinkHighlighted(const QUrl &url); 279 #else 269 280 void sigLinkHighlighted(const QString &strLink); 281 #endif 270 282 void sigZoomPercentageChanged(int iPercentage); 271 283 void sigCopyAvailableChanged(bool fAvailable); … … 704 716 connect(m_pContentViewer, &UIHelpViewer::sigAddBookmark, 705 717 this, &UIHelpBrowserTab::sltAddBookmarkAction); 718 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 719 connect(m_pContentViewer, static_cast<void(UIHelpViewer::*)(const QUrl&)>(&UIHelpViewer::highlighted), 720 this, &UIHelpBrowserTab::sigLinkHighlighted); 721 #else 706 722 connect(m_pContentViewer, static_cast<void(UIHelpViewer::*)(const QString&)>(&UIHelpViewer::highlighted), 707 723 this, &UIHelpBrowserTab::sigLinkHighlighted); 724 #endif 708 725 connect(m_pContentViewer, &UIHelpViewer::sigZoomPercentageChanged, 709 726 this, &UIHelpBrowserTab::sigZoomPercentageChanged); … … 1865 1882 void UIHelpBrowserWidget::findAndShowUrlForKeyword(const QString &strKeyword) 1866 1883 { 1884 #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) 1885 QList<QHelpLink> links = m_pHelpEngine->documentsForIdentifier(strKeyword); 1886 if (!links.isEmpty()) 1887 { 1888 /* We have to a have a single url per keyword in this case: */ 1889 m_pTabManager->setSource(links.first().url, true /* new tab */); 1890 } 1891 #else 1867 1892 QMap<QString, QUrl> map = m_pHelpEngine->linksForIdentifier(strKeyword); 1868 1893 if (!map.isEmpty()) … … 1872 1897 m_pTabManager->setSource(keywordUrl, true /* new tab */); 1873 1898 } 1899 #endif 1874 1900 } 1875 1901 … … 1922 1948 } 1923 1949 1950 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 1951 void UIHelpBrowserWidget::sltLinkHighlighted(const QUrl &url) 1952 { 1953 emit sigStatusBarMessage(url.url(), 0); /** @todo qt6: ??? */ 1954 } 1955 #else 1924 1956 void UIHelpBrowserWidget::sltLinkHighlighted(const QString &strLink) 1925 1957 { 1926 1958 emit sigStatusBarMessage(strLink, 0); 1927 1959 } 1960 #endif 1928 1961 1929 1962 void UIHelpBrowserWidget::sltMouseOverImage(const QString &strImageName) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r93990 r94032 110 110 void sltFindPreviousInPage(); 111 111 void sltHistoryChanged(bool fBackwardAvailable, bool fForwardAvailable); 112 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 113 void sltLinkHighlighted(const QUrl &url); 114 #else 112 115 void sltLinkHighlighted(const QString &strLink); 116 #endif 113 117 void sltMouseOverImage(const QString &strImageName); 114 118 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r94008 r94032 412 412 } 413 413 414 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 415 void UIHelpViewer::doSetSource(const QUrl &url, QTextDocument::ResourceType type) 416 #else 414 417 void UIHelpViewer::setSource(const QUrl &url) 418 #endif 415 419 { 416 420 clearOverlay(); 421 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 422 QTextBrowser::doSetSource(url, type); 423 #else 417 424 QTextBrowser::setSource(url); 425 #endif 418 426 QTextDocument *pDocument = document(); 419 427 if (!pDocument || pDocument->isEmpty()) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r93990 r94032 71 71 virtual QVariant loadResource(int type, const QUrl &name) RT_OVERRIDE; 72 72 void emitHistoryChangedSignal(); 73 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) /* must override doSetSource in 6.0 */ 73 74 virtual void setSource(const QUrl &url) RT_OVERRIDE; 75 #endif 74 76 void setFont(const QFont &); 75 77 bool isFindInPageWidgetVisible() const; … … 100 102 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE; 101 103 virtual void keyPressEvent(QKeyEvent *pEvent) RT_OVERRIDE; 104 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 105 virtual void doSetSource(const QUrl &url, QTextDocument::ResourceType type = QTextDocument::UnknownResource) RT_OVERRIDE; 106 #endif 102 107 103 108 private slots:
Note:
See TracChangeset
for help on using the changeset viewer.