/usr/share/qt5/doc/qtwebkitexamples/qtwebkitexamples-webkitwidgets-browser-tabwidget-h.html is in qtwebkit5-examples-doc-html 5.5.1+dfsg-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>tabwidget.h Example File | Qt WebKit Examples 5.5</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.5</li>
<li><a href="qtwebkitexamples-index.html">Qt WebKit Examples</a></li>
<li><a href="qtwebkitexamples-webkitwidgets-browser-example.html">Tab Browser</a></li>
<li>tabwidget.h Example File</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">tabwidget.h Example File</h1>
<span class="subtitle">webkitwidgets/browser/tabwidget.h</span>
<!-- $$$webkitwidgets/browser/tabwidget.h-description -->
<div class="descr"> <a name="details"></a>
<pre class="cpp"><span class="comment">/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/</span>
<span class="preprocessor">#ifndef TABWIDGET_H</span>
<span class="preprocessor">#define TABWIDGET_H</span>
<span class="preprocessor">#include <QtWidgets/QTabBar></span>
<span class="preprocessor">#include <QtWidgets/QShortcut></span>
<span class="comment">/*
Tab bar with a few more features such as a context menu and shortcuts
*/</span>
<span class="keyword">class</span> TabBar : <span class="keyword">public</span> <span class="type"><a href="../qtwidgets/qtabbar.html">QTabBar</a></span>
{
Q_OBJECT
<span class="keyword">signals</span>:
<span class="type">void</span> newTab();
<span class="type">void</span> cloneTab(<span class="type">int</span> index);
<span class="type">void</span> closeTab(<span class="type">int</span> index);
<span class="type">void</span> closeOtherTabs(<span class="type">int</span> index);
<span class="type">void</span> reloadTab(<span class="type">int</span> index);
<span class="type">void</span> reloadAllTabs();
<span class="type">void</span> tabMoveRequested(<span class="type">int</span> fromIndex<span class="operator">,</span> <span class="type">int</span> toIndex);
<span class="keyword">public</span>:
TabBar(<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
<span class="keyword">protected</span>:
<span class="type">void</span> mousePressEvent(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span><span class="operator">*</span> event);
<span class="type">void</span> mouseMoveEvent(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span><span class="operator">*</span> event);
<span class="keyword">private</span> <span class="keyword">slots</span>:
<span class="type">void</span> selectTabAction();
<span class="type">void</span> cloneTab();
<span class="type">void</span> closeTab();
<span class="type">void</span> closeOtherTabs();
<span class="type">void</span> reloadTab();
<span class="type">void</span> contextMenuRequested(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <span class="operator">&</span>position);
<span class="keyword">private</span>:
<span class="type"><a href="../qtcore/qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="../qtwidgets/qshortcut.html">QShortcut</a></span><span class="operator">*</span><span class="operator">></span> m_tabShortcuts;
<span class="keyword">friend</span> <span class="keyword">class</span> TabWidget;
<span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> m_dragStartPos;
<span class="type">int</span> m_dragCurrentIndex;
};
<span class="preprocessor">#include <QWebPage></span>
<span class="keyword">class</span> <span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span>;
<span class="keyword">class</span> WebView;
<span class="comment">/*!
A proxy object that connects a single browser action
to one child webpage action at a time.
Example usage: used to keep the main window stop action in sync with
the current tabs webview's stop action.
*/</span>
<span class="keyword">class</span> WebActionMapper : <span class="keyword">public</span> <span class="type"><a href="../qtcore/qobject.html">QObject</a></span>
{
Q_OBJECT
<span class="keyword">public</span>:
WebActionMapper(<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>root<span class="operator">,</span> <span class="type"><a href="../qtwebkit/qwebpage.html">QWebPage</a></span><span class="operator">::</span>WebAction webAction<span class="operator">,</span> <span class="type"><a href="../qtcore/qobject.html">QObject</a></span> <span class="operator">*</span>parent);
<span class="type"><a href="../qtwebkit/qwebpage.html">QWebPage</a></span><span class="operator">::</span>WebAction webAction() <span class="keyword">const</span>;
<span class="type">void</span> addChild(<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>action);
<span class="type">void</span> updateCurrent(<span class="type"><a href="../qtwebkit/qwebpage.html">QWebPage</a></span> <span class="operator">*</span>currentParent);
<span class="keyword">private</span> <span class="keyword">slots</span>:
<span class="type">void</span> rootTriggered();
<span class="type">void</span> childChanged();
<span class="type">void</span> rootDestroyed();
<span class="type">void</span> currentDestroyed();
<span class="keyword">private</span>:
<span class="type"><a href="../qtwebkit/qwebpage.html">QWebPage</a></span> <span class="operator">*</span>m_currentParent;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>m_root;
<span class="type"><a href="../qtwebkit/qwebpage.html">QWebPage</a></span><span class="operator">::</span>WebAction m_webAction;
};
<span class="preprocessor">#include <QtCore/QUrl></span>
<span class="preprocessor">#include <QtWidgets/QTabWidget></span>
<span class="keyword">class</span> <span class="type"><a href="../qtwidgets/qcompleter.html">QCompleter</a></span>;
<span class="keyword">class</span> <span class="type"><a href="../qtwidgets/qlineedit.html">QLineEdit</a></span>;
<span class="keyword">class</span> <span class="type"><a href="../qtwidgets/qmenu.html">QMenu</a></span>;
<span class="keyword">class</span> <span class="type"><a href="../qtwidgets/qstackedwidget.html">QStackedWidget</a></span>;
<span class="comment">/*!
TabWidget that contains WebViews and a stack widget of associated line edits.
Connects up the current tab's signals to this class's signal and uses WebActionMapper
to proxy the actions.
*/</span>
<span class="keyword">class</span> TabWidget : <span class="keyword">public</span> <span class="type"><a href="../qtwidgets/qtabwidget.html">QTabWidget</a></span>
{
Q_OBJECT
<span class="keyword">signals</span>:
<span class="comment">// tab widget signals</span>
<span class="type">void</span> loadPage(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&</span>url);
<span class="type">void</span> tabsChanged();
<span class="type">void</span> lastTabClosed();
<span class="comment">// current tab signals</span>
<span class="type">void</span> setCurrentTitle(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&</span>url);
<span class="type">void</span> showStatusBarMessage(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&</span>message);
<span class="type">void</span> linkHovered(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&</span>link);
<span class="type">void</span> loadProgress(<span class="type">int</span> progress);
<span class="type">void</span> geometryChangeRequested(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> <span class="operator">&</span>geometry);
<span class="type">void</span> menuBarVisibilityChangeRequested(bool visible);
<span class="type">void</span> statusBarVisibilityChangeRequested(bool visible);
<span class="type">void</span> toolBarVisibilityChangeRequested(bool visible);
<span class="type">void</span> printRequested(<span class="type"><a href="../qtwebkit/qwebframe.html">QWebFrame</a></span> <span class="operator">*</span>frame);
<span class="keyword">public</span>:
TabWidget(<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>);
<span class="type">void</span> clear();
<span class="type">void</span> addWebAction(<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>action<span class="operator">,</span> <span class="type"><a href="../qtwebkit/qwebpage.html">QWebPage</a></span><span class="operator">::</span>WebAction webAction);
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>newTabAction() <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>closeTabAction() <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>recentlyClosedTabsAction() <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>nextTabAction() <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>previousTabAction() <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span> <span class="operator">*</span>lineEditStack() <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>currentLineEdit() <span class="keyword">const</span>;
WebView <span class="operator">*</span>currentWebView() <span class="keyword">const</span>;
WebView <span class="operator">*</span>webView(<span class="type">int</span> index) <span class="keyword">const</span>;
<span class="type"><a href="../qtwidgets/qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>lineEdit(<span class="type">int</span> index) <span class="keyword">const</span>;
<span class="type">int</span> webViewIndex(WebView <span class="operator">*</span>webView) <span class="keyword">const</span>;
<span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> saveState() <span class="keyword">const</span>;
bool restoreState(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> <span class="operator">&</span>state);
<span class="keyword">protected</span>:
<span class="type">void</span> mouseDoubleClickEvent(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> <span class="operator">*</span>event);
<span class="type">void</span> contextMenuEvent(<span class="type"><a href="../qtgui/qcontextmenuevent.html">QContextMenuEvent</a></span> <span class="operator">*</span>event);
<span class="type">void</span> mouseReleaseEvent(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> <span class="operator">*</span>event);
<span class="keyword">public</span> <span class="keyword">slots</span>:
<span class="type">void</span> loadUrlInCurrentTab(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> <span class="operator">&</span>url);
WebView <span class="operator">*</span>newTab(bool makeCurrent <span class="operator">=</span> <span class="keyword">true</span>);
<span class="type">void</span> cloneTab(<span class="type">int</span> index <span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>);
<span class="type">void</span> closeTab(<span class="type">int</span> index <span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>);
<span class="type">void</span> closeOtherTabs(<span class="type">int</span> index);
<span class="type">void</span> reloadTab(<span class="type">int</span> index <span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>);
<span class="type">void</span> reloadAllTabs();
<span class="type">void</span> nextTab();
<span class="type">void</span> previousTab();
<span class="keyword">private</span> <span class="keyword">slots</span>:
<span class="type">void</span> currentChanged(<span class="type">int</span> index);
<span class="type">void</span> aboutToShowRecentTabsMenu();
<span class="type">void</span> aboutToShowRecentTriggeredAction(<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>action);
<span class="type">void</span> webViewLoadStarted();
<span class="type">void</span> webViewIconChanged();
<span class="type">void</span> webViewTitleChanged(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&</span>title);
<span class="type">void</span> webViewUrlChanged(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> <span class="operator">&</span>url);
<span class="type">void</span> lineEditReturnPressed();
<span class="type">void</span> windowCloseRequested();
<span class="type">void</span> moveTab(<span class="type">int</span> fromIndex<span class="operator">,</span> <span class="type">int</span> toIndex);
<span class="keyword">private</span>:
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>m_recentlyClosedTabsAction;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>m_newTabAction;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>m_closeTabAction;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>m_nextTabAction;
<span class="type"><a href="../qtwidgets/qaction.html">QAction</a></span> <span class="operator">*</span>m_previousTabAction;
<span class="type"><a href="../qtwidgets/qmenu.html">QMenu</a></span> <span class="operator">*</span>m_recentlyClosedTabsMenu;
<span class="keyword">static</span> <span class="keyword">const</span> <span class="type">int</span> m_recentlyClosedTabsSize <span class="operator">=</span> <span class="number">10</span>;
<span class="type"><a href="../qtcore/qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span><span class="operator">></span> m_recentlyClosedTabs;
<span class="type"><a href="../qtcore/qlist.html">QList</a></span><span class="operator"><</span>WebActionMapper<span class="operator">*</span><span class="operator">></span> m_actions;
<span class="type"><a href="../qtwidgets/qcompleter.html">QCompleter</a></span> <span class="operator">*</span>m_lineEditCompleter;
<span class="type"><a href="../qtwidgets/qstackedwidget.html">QStackedWidget</a></span> <span class="operator">*</span>m_lineEdits;
TabBar <span class="operator">*</span>m_tabBar;
};
<span class="preprocessor">#endif // TABWIDGET_H</span></pre>
</div>
<!-- @@@webkitwidgets/browser/tabwidget.h -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|