Falkon Develop
Cross-platform Qt-based web browser
webtab.cpp
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#include "webtab.h"
19#include "browserwindow.h"
20#include "tabbedwebview.h"
21#include "webinspector.h"
22#include "webpage.h"
23#include "tabbar.h"
24#include "tabicon.h"
25#include "tabwidget.h"
26#include "locationbar.h"
27#include "qztools.h"
28#include "qzsettings.h"
29#include "mainapplication.h"
30#include "iconprovider.h"
31#include "searchtoolbar.h"
32
33#include <QVBoxLayout>
34#include <QWebEngineHistory>
35#include <QLabel>
36#include <QTimer>
37#include <QSplitter>
38
39static const int savedTabVersion = 6;
40
42 : isPinned(false)
43 , zoomLevel(qzSettings->defaultZoomLevel)
44 , parentTab(-1)
45{
46}
47
49{
50 title = webTab->title();
51 url = webTab->url();
52 icon = webTab->icon(true);
53 history = webTab->historyData();
54 isPinned = webTab->isPinned();
55 zoomLevel = webTab->zoomLevel();
56 parentTab = webTab->parentTab() ? webTab->parentTab()->tabIndex() : -1;
57
58 const auto children = webTab->childTabs();
59 childTabs.reserve(children.count());
60 for (WebTab *child : children) {
61 childTabs.append(child->tabIndex());
62 }
63
64 sessionData = webTab->sessionData();
65}
66
68{
69 return !url.isEmpty() || !history.isEmpty();
70}
71
73{
74 title.clear();
75 url.clear();
76 icon = QIcon();
77 history.clear();
78 isPinned = false;
79 zoomLevel = qzSettings->defaultZoomLevel;
80 parentTab = -1;
81 childTabs.clear();
82 sessionData.clear();
83}
84
85QDataStream &operator <<(QDataStream &stream, const WebTab::SavedTab &tab)
86{
87 stream << savedTabVersion;
88 stream << tab.title;
89 stream << tab.url;
90 stream << tab.icon.pixmap(16);
91 stream << tab.history;
92 stream << tab.isPinned;
93 stream << tab.zoomLevel;
94 stream << tab.parentTab;
95 stream << tab.childTabs;
96 stream << tab.sessionData;
97
98 return stream;
99}
100
101QDataStream &operator >>(QDataStream &stream, WebTab::SavedTab &tab)
102{
103 int version;
104 stream >> version;
105
106 if (version < 1)
107 return stream;
108
109 QPixmap pixmap;
110 stream >> tab.title;
111 stream >> tab.url;
112 stream >> pixmap;
113 stream >> tab.history;
114
115 if (version >= 2)
116 stream >> tab.isPinned;
117
118 if (version >= 3)
119 stream >> tab.zoomLevel;
120
121 if (version >= 4)
122 stream >> tab.parentTab;
123
124 if (version >= 5)
125 stream >> tab.childTabs;
126
127 if (version >= 6)
128 stream >> tab.sessionData;
129
130 tab.icon = QIcon(pixmap);
131
132 return stream;
133}
134
135WebTab::WebTab(QWidget *parent)
136 : QWidget(parent)
137{
138 setObjectName(QSL("webtab"));
139
140 m_webView = new TabbedWebView(this);
141 m_webView->setPage(new WebPage);
142 m_webView->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
143 setFocusProxy(m_webView);
144
145 m_locationBar = new LocationBar(this);
146 m_locationBar->setWebView(m_webView);
147
148 m_tabIcon = new TabIcon(this);
149 m_tabIcon->setWebTab(this);
150
151 m_layout = new QVBoxLayout(this);
152 m_layout->setContentsMargins(0, 0, 0, 0);
153 m_layout->setSpacing(0);
154 m_layout->addWidget(m_webView);
155
156 auto *viewWidget = new QWidget(this);
157 viewWidget->setLayout(m_layout);
158
159 m_splitter = new QSplitter(Qt::Vertical, this);
160 m_splitter->setChildrenCollapsible(false);
161 m_splitter->addWidget(viewWidget);
162
163 auto *layout = new QVBoxLayout(this);
164 layout->setContentsMargins(0, 0, 0, 0);
165 layout->setSpacing(0);
166 layout->addWidget(m_splitter);
167 setLayout(layout);
168
169 m_notificationWidget = new QWidget(this);
170 m_notificationWidget->setAutoFillBackground(true);
171 QPalette pal = m_notificationWidget->palette();
172 pal.setColor(QPalette::Window, pal.window().color().darker(110));
173 m_notificationWidget->setPalette(pal);
174
175 auto *nlayout = new QVBoxLayout(m_notificationWidget);
176 nlayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
177 nlayout->setContentsMargins(0, 0, 0, 0);
178 nlayout->setSpacing(1);
179
180 connect(m_webView, &WebView::showNotification, this, &WebTab::showNotification);
181 connect(m_webView, &QWebEngineView::loadFinished, this, &WebTab::loadFinished);
182 connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleWasChanged);
183 connect(m_webView, &TabbedWebView::titleChanged, this, &WebTab::titleChanged);
184 connect(m_webView, &TabbedWebView::iconChanged, this, &WebTab::iconChanged);
186 connect(m_webView, &TabbedWebView::loadStarted, this, std::bind(&WebTab::loadingChanged, this, true));
187 connect(m_webView, &TabbedWebView::loadFinished, this, std::bind(&WebTab::loadingChanged, this, false));
188
189 auto pageChanged = [this](WebPage *page) {
190 connect(page, &WebPage::audioMutedChanged, this, &WebTab::playingChanged);
191 connect(page, &WebPage::recentlyAudibleChanged, this, &WebTab::mutedChanged);
192 };
193 pageChanged(m_webView->page());
194 connect(m_webView, &TabbedWebView::pageChanged, this, pageChanged);
195
196 // Workaround QTabBar not immediately noticing resizing of tab buttons
197 connect(m_tabIcon, &TabIcon::resized, this, [this]() {
198 if (m_tabBar) {
199 m_tabBar->update();
200 }
201 });
202}
203
205{
206 return m_window;
207}
208
210{
211 return m_webView;
212}
213
215{
216 return m_splitter->count() > 1 && m_splitter->widget(1)->inherits("WebInspector");
217}
218
219void WebTab::showWebInspector(bool inspectElement)
220{
222 return;
223
224 auto *inspector = new WebInspector(this);
225 inspector->setView(m_webView);
226 if (inspectElement)
227 inspector->inspectElement();
228
229 const int height = inspector->sizeHint().height();
230 m_splitter->addWidget(inspector);
231 m_splitter->setSizes({m_splitter->height() - height, height});
232}
233
235{
236 if (!haveInspector())
238 else
239 delete m_splitter->widget(1);
240}
241
242void WebTab::showSearchToolBar(const QString &searchText)
243{
244 const int index = 1;
245
246 SearchToolBar *toolBar = nullptr;
247
248 if (m_layout->count() == 1) {
249 toolBar = new SearchToolBar(m_webView, this);
250 m_layout->insertWidget(index, toolBar);
251 } else if (m_layout->count() == 2) {
252 Q_ASSERT(qobject_cast<SearchToolBar*>(m_layout->itemAt(index)->widget()));
253 toolBar = static_cast<SearchToolBar*>(m_layout->itemAt(index)->widget());
254 }
255
256 Q_ASSERT(toolBar);
257 if (!searchText.isEmpty()) {
258 toolBar->setText(searchText);
259 }
260 toolBar->focusSearchLine();
261}
262
263QUrl WebTab::url() const
264{
265 if (isRestored()) {
266 if (m_webView->url().isEmpty() && m_webView->isLoading()) {
267 return m_webView->page()->requestedUrl();
268 }
269 return m_webView->url();
270 }
271 else {
272 return m_savedTab.url;
273 }
274}
275
276QString WebTab::title(bool allowEmpty) const
277{
278 if (isRestored()) {
279 return m_webView->title(allowEmpty);
280 }
281 else {
282 return m_savedTab.title;
283 }
284}
285
286QIcon WebTab::icon(bool allowNull) const
287{
288 if (isRestored()) {
289 return m_webView->icon(allowNull);
290 }
291
292 if (allowNull || !m_savedTab.icon.isNull()) {
293 return m_savedTab.icon;
294 }
295
297}
298
299QWebEngineHistory* WebTab::history() const
300{
301 return m_webView->history();
302}
303
305{
306 return m_webView->zoomLevel();
307}
308
309void WebTab::setZoomLevel(int level)
310{
311 m_webView->setZoomLevel(level);
312}
313
315{
316 Q_ASSERT(m_window);
317 Q_ASSERT(m_tabBar);
318
319 // Remove from tab tree
320 removeFromTabTree();
321
322 // Remove icon from tab
323 m_tabBar->setTabButton(tabIndex(), m_tabBar->iconButtonPosition(), nullptr);
324 m_tabIcon->setParent(this);
325
326 // Remove the tab from tabbar
327 m_window->tabWidget()->removeTab(tabIndex());
328 setParent(nullptr);
329 // Remove the locationbar from window
330 m_locationBar->setParent(this);
331 // Detach TabbedWebView
332 m_webView->setBrowserWindow(nullptr);
333
334 if (m_isCurrentTab) {
335 m_isCurrentTab = false;
336 Q_EMIT currentTabChanged(m_isCurrentTab);
337 }
338 m_tabBar->disconnect(this);
339
340 // WebTab is now standalone widget
341 m_window = nullptr;
342 m_tabBar = nullptr;
343}
344
346{
347 m_window = window;
348 m_tabBar = m_window->tabWidget()->tabBar();
349
350 m_webView->setBrowserWindow(m_window);
351 m_locationBar->setBrowserWindow(m_window);
352 m_tabBar->setTabText(tabIndex(), title());
353 m_tabBar->setTabButton(tabIndex(), m_tabBar->iconButtonPosition(), m_tabIcon);
354 QTimer::singleShot(0, m_tabIcon, &TabIcon::updateIcon);
355
356 auto currentChanged = [this](int index) {
357 const bool wasCurrent = m_isCurrentTab;
358 m_isCurrentTab = index == tabIndex();
359 if (wasCurrent != m_isCurrentTab) {
360 Q_EMIT currentTabChanged(m_isCurrentTab);
361 }
362 };
363
364 currentChanged(m_tabBar->currentIndex());
365 connect(m_tabBar, &TabBar::currentChanged, this, currentChanged);
366}
367
368QByteArray WebTab::historyData() const
369{
370 if (isRestored()) {
371 QByteArray historyArray;
372 QDataStream historyStream(&historyArray, QIODevice::WriteOnly);
373 historyStream << *m_webView->history();
374 return historyArray;
375 }
376 else {
377 return m_savedTab.history;
378 }
379}
380
382{
383 m_webView->stop();
384}
385
387{
388 m_webView->reload();
389}
390
391void WebTab::load(const LoadRequest &request)
392{
393 if (!isRestored()) {
394 tabActivated();
395 QTimer::singleShot(0, this, std::bind(&WebTab::load, this, request));
396 } else {
397 m_webView->load(request);
398 }
399}
400
402{
403 m_savedTab = SavedTab(this);
404 Q_EMIT restoredChanged(isRestored());
405 m_webView->setPage(new WebPage);
406 m_webView->setFocus();
407}
408
410{
411 return m_webView->isLoading();
412}
413
415{
416 return m_isPinned;
417}
418
420{
421 if (m_isPinned == state) {
422 return;
423 }
424
425 if (state) {
426 removeFromTabTree();
427 }
428
429 m_isPinned = state;
430 Q_EMIT pinnedChanged(m_isPinned);
431}
432
433bool WebTab::isMuted() const
434{
435 return m_webView->page()->isAudioMuted();
436}
437
439{
440 return m_webView->page()->recentlyAudible();
441}
442
443void WebTab::setMuted(bool muted)
444{
445 m_webView->page()->setAudioMuted(muted);
446}
447
449{
450 bool muted = isMuted();
451 setMuted(!muted);
452}
453
455{
456 return m_webView->backgroundActivity();
457}
458
460{
461 return m_locationBar;
462}
463
465{
466 return m_tabIcon;
467}
468
470{
471 return m_parentTab;
472}
473
475{
476 if (m_isPinned || m_parentTab == tab) {
477 return;
478 }
479
480 if (tab && tab->isPinned()) {
481 return;
482 }
483
484 if (m_parentTab) {
485 const int index = m_parentTab->m_childTabs.indexOf(this);
486 if (index >= 0) {
487 m_parentTab->m_childTabs.removeAt(index);
488 Q_EMIT m_parentTab->childTabRemoved(this, index);
489 }
490 }
491
492 m_parentTab = tab;
493
494 if (tab) {
495 m_parentTab = nullptr;
496 tab->addChildTab(this);
497 } else {
498 Q_EMIT parentTabChanged(m_parentTab);
499 }
500}
501
502void WebTab::addChildTab(WebTab *tab, int index)
503{
504 if (m_isPinned || !tab || tab->isPinned()) {
505 return;
506 }
507
508 WebTab *oldParent = tab->m_parentTab;
509 tab->m_parentTab = this;
510 if (oldParent) {
511 const int index = oldParent->m_childTabs.indexOf(tab);
512 if (index >= 0) {
513 oldParent->m_childTabs.removeAt(index);
514 Q_EMIT oldParent->childTabRemoved(tab, index);
515 }
516 }
517
518 if (index < 0 || index > m_childTabs.size()) {
519 index = 0;
520 if (addChildBehavior() == AppendChild) {
521 index = m_childTabs.size();
522 } else if (addChildBehavior() == PrependChild) {
523 index = 0;
524 }
525 }
526
527 m_childTabs.insert(index, tab);
528 Q_EMIT childTabAdded(tab, index);
529
530 Q_EMIT tab->parentTabChanged(this);
531}
532
533QVector<WebTab*> WebTab::childTabs() const
534{
535 return m_childTabs;
536}
537
538QHash<QString, QVariant> WebTab::sessionData() const
539{
540 return m_sessionData;
541}
542
543void WebTab::setSessionData(const QString &key, const QVariant &value)
544{
545 m_sessionData[key] = value;
546}
547
549{
550 return !m_savedTab.isValid();
551}
552
554{
555 Q_ASSERT(m_tabBar);
556
557 setPinned(tab.isPinned);
558 m_sessionData = tab.sessionData;
559
560 if (!isPinned() && qzSettings->loadTabsOnActivation) {
561 m_savedTab = tab;
562 Q_EMIT restoredChanged(isRestored());
563 int index = tabIndex();
564
565 m_tabBar->setTabText(index, tab.title);
566 m_locationBar->showUrl(tab.url);
567 m_tabIcon->updateIcon();
568 }
569 else {
570 // This is called only on restore session and restoring tabs immediately
571 // crashes QtWebEngine, waiting after initialization is complete fixes it
572 QTimer::singleShot(1000, this, [=]() {
573 p_restoreTab(tab);
574 });
575 }
576}
577
578void WebTab::p_restoreTab(const QUrl &url, const QByteArray &history, int zoomLevel)
579{
580 m_webView->load(url);
581
582 // Restoring history of internal pages crashes QtWebEngine 5.8
583 static const QStringList blacklistedSchemes = {
584 QSL("view-source"),
585 QSL("chrome")
586 };
587
588 if (!blacklistedSchemes.contains(url.scheme())) {
589 QDataStream stream(history);
590 stream >> *m_webView->history();
591 }
592
593 m_webView->setZoomLevel(zoomLevel);
594 m_webView->setFocus();
595}
596
598{
599 p_restoreTab(tab.url, tab.history, tab.zoomLevel);
600}
601
602void WebTab::showNotification(QWidget* notif)
603{
604 m_notificationWidget->setParent(this);
605 m_notificationWidget->raise();
606 m_notificationWidget->setFixedWidth(width());
607 m_notificationWidget->layout()->addWidget(notif);
608 m_notificationWidget->show();
609 notif->show();
610}
611
612void WebTab::loadFinished()
613{
614 titleWasChanged(m_webView->title());
615}
616
617void WebTab::titleWasChanged(const QString &title)
618{
619 if (!m_tabBar || !m_window || title.isEmpty()) {
620 return;
621 }
622
623 if (m_isCurrentTab) {
624 m_window->setWindowTitle(tr("%1 - Falkon").arg(title));
625 }
626
627 m_tabBar->setTabText(tabIndex(), title);
628}
629
631{
632 if (isRestored()) {
633 return;
634 }
635
636 QTimer::singleShot(0, this, [this]() {
637 if (isRestored()) {
638 return;
639 }
640 p_restoreTab(m_savedTab);
641 m_savedTab.clear();
642 Q_EMIT restoredChanged(isRestored());
643 });
644}
645
646static WebTab::AddChildBehavior s_addChildBehavior = WebTab::AppendChild;
647
648// static
650{
651 return s_addChildBehavior;
652}
653
654// static
656{
657 s_addChildBehavior = behavior;
658}
659
660void WebTab::resizeEvent(QResizeEvent *event)
661{
662 QWidget::resizeEvent(event);
663
664 m_notificationWidget->setFixedWidth(width());
665}
666
667void WebTab::removeFromTabTree()
668{
669 WebTab *parentTab = m_parentTab;
670 const int parentIndex = parentTab ? parentTab->m_childTabs.indexOf(this) : -1;
671
672 setParentTab(nullptr);
673
674 int i = 0;
675 while (!m_childTabs.isEmpty()) {
676 WebTab *child = m_childTabs.at(0);
677 child->setParentTab(nullptr);
678 if (parentTab) {
679 parentTab->addChildTab(child, parentIndex + i++);
680 }
681 }
682}
683
685{
686 return m_isCurrentTab;
687}
688
690{
691 if (m_tabBar) {
692 m_tabBar->tabWidget()->setCurrentIndex(tabIndex());
693 }
694}
695
697{
698 if (m_tabBar) {
699 m_tabBar->tabWidget()->closeTab(tabIndex());
700 }
701}
702
703void WebTab::moveTab(int to)
704{
705 if (m_tabBar) {
706 m_tabBar->tabWidget()->moveTab(tabIndex(), to);
707 }
708}
709
711{
712 return m_tabBar ? m_tabBar->tabWidget()->indexOf(const_cast<WebTab*>(this)) : -1;
713}
714
716{
717 Q_ASSERT(m_tabBar);
718 Q_ASSERT(m_window);
719
721 m_window->tabWidget()->pinUnPinTab(tabIndex(), title());
722}
TabWidget * tabWidget() const
void setWindowTitle(const QString &t)
QTabBar::ButtonPosition iconButtonPosition() const
int currentIndex
Definition: combotabbar.h:42
void setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget)
void currentChanged(int index)
static QIcon emptyWebIcon()
void setBrowserWindow(BrowserWindow *window)
void setWebView(TabbedWebView *view)
void showUrl(const QUrl &url)
void setText(const QString &text)
void focusSearchLine()
void setTabText(int index, const QString &text)
Definition: tabbar.cpp:437
TabWidget * tabWidget() const
Definition: tabbar.cpp:141
void updateIcon()
Definition: tabicon.cpp:83
void setWebTab(WebTab *tab)
Definition: tabicon.cpp:49
void resized()
void removeTab(int index)
int indexOf(QWidget *widget) const
void setCurrentIndex(int index)
Definition: tabwidget.cpp:536
TabBar * tabBar() const
Definition: tabwidget.cpp:580
void closeTab(int index=-1)
Definition: tabwidget.cpp:437
void moveTab(int from, int to)
Definition: tabwidget.cpp:657
int pinUnPinTab(int index, const QString &title=QString())
Definition: tabwidget.cpp:676
void setPage(WebPage *page)
void setBrowserWindow(BrowserWindow *window)
static bool isEnabled()
Definition: webtab.h:40
void makeCurrentTab()
Definition: webtab.cpp:689
bool isMuted() const
Definition: webtab.cpp:433
TabIcon * tabIcon() const
Definition: webtab.cpp:464
void setPinned(bool state)
Definition: webtab.cpp:419
void showWebInspector(bool inspectElement=false)
Definition: webtab.cpp:219
void setZoomLevel(int level)
Definition: webtab.cpp:309
void mutedChanged(bool muted)
void titleChanged(const QString &title)
bool isCurrentTab() const
Definition: webtab.cpp:684
int tabIndex() const
Definition: webtab.cpp:710
bool isPlaying() const
Definition: webtab.cpp:438
bool isRestored() const
Definition: webtab.cpp:548
LocationBar * locationBar() const
Definition: webtab.cpp:459
void currentTabChanged(bool current)
void restoredChanged(bool restored)
void setParentTab(WebTab *tab)
Definition: webtab.cpp:474
QUrl url() const
Definition: webtab.cpp:263
void toggleWebInspector()
Definition: webtab.cpp:234
void iconChanged(const QIcon &icon)
void p_restoreTab(const SavedTab &tab)
Definition: webtab.cpp:597
void parentTabChanged(WebTab *tab)
void pinnedChanged(bool pinned)
void reload()
Definition: webtab.cpp:386
void toggleMuted()
Definition: webtab.cpp:448
bool haveInspector() const
Definition: webtab.cpp:214
static void setAddChildBehavior(AddChildBehavior behavior)
Definition: webtab.cpp:655
QString title(bool allowEmpty=false) const
Definition: webtab.cpp:276
void load(const LoadRequest &request)
Definition: webtab.cpp:391
QVector< WebTab * > childTabs() const
Definition: webtab.cpp:533
void tabActivated()
Definition: webtab.cpp:630
void unload()
Definition: webtab.cpp:401
bool isPinned() const
Definition: webtab.cpp:414
void setMuted(bool muted)
Definition: webtab.cpp:443
void childTabRemoved(WebTab *tab, int index)
QWebEngineHistory * history() const
Definition: webtab.cpp:299
BrowserWindow * browserWindow() const
Definition: webtab.cpp:204
void addChildTab(WebTab *tab, int index=-1)
Definition: webtab.cpp:502
bool isLoading() const
Definition: webtab.cpp:409
AddChildBehavior
Definition: webtab.h:64
@ PrependChild
Definition: webtab.h:66
@ AppendChild
Definition: webtab.h:65
TabbedWebView * webView() const
Definition: webtab.cpp:209
void togglePinned()
Definition: webtab.cpp:715
int zoomLevel() const
Definition: webtab.cpp:304
void stop()
Definition: webtab.cpp:381
void closeTab()
Definition: webtab.cpp:696
void moveTab(int to)
Definition: webtab.cpp:703
bool backgroundActivity() const
Definition: webtab.cpp:454
void childTabAdded(WebTab *tab, int index)
void attach(BrowserWindow *window)
Definition: webtab.cpp:345
WebTab * parentTab() const
Definition: webtab.cpp:469
void backgroundActivityChanged(bool activity)
WebTab(QWidget *parent=nullptr)
Definition: webtab.cpp:135
void loadingChanged(bool loading)
QHash< QString, QVariant > sessionData() const
Definition: webtab.cpp:538
void playingChanged(bool playing)
QIcon icon(bool allowNull=false) const
Definition: webtab.cpp:286
static AddChildBehavior addChildBehavior()
Definition: webtab.cpp:649
void restoreTab(const SavedTab &tab)
Definition: webtab.cpp:553
void showSearchToolBar(const QString &searchText=QString())
Definition: webtab.cpp:242
void detach()
Definition: webtab.cpp:314
QByteArray historyData() const
Definition: webtab.cpp:368
void setSessionData(const QString &key, const QVariant &value)
Definition: webtab.cpp:543
bool backgroundActivity() const
Definition: webview.cpp:224
void showNotification(QWidget *)
void backgroundActivityChanged(bool)
WebPage * page() const
Definition: webview.cpp:132
QIcon icon(bool allowNull=false) const
Definition: webview.cpp:90
int zoomLevel() const
Definition: webview.cpp:229
void pageChanged(WebPage *page)
bool isLoading() const
Definition: webview.cpp:214
void load(const QUrl &url)
Definition: webview.cpp:177
QString title(bool allowEmpty=false) const
Definition: webview.cpp:107
void setZoomLevel(int level)
Definition: webview.cpp:234
int value(const QColor &c)
Definition: colors.cpp:238
i
Definition: i18n.py:23
State state
#define QSL(x)
Definition: qzcommon.h:40
#define qzSettings
Definition: qzsettings.h:69
QVector< int > childTabs
Definition: webtab.h:51
bool isValid() const
Definition: webtab.cpp:67
QString title
Definition: webtab.h:44
QIcon icon
Definition: webtab.h:46
QHash< QString, QVariant > sessionData
Definition: webtab.h:52
void clear()
Definition: webtab.cpp:72
QByteArray history
Definition: webtab.h:47
bool isPinned
Definition: webtab.h:48
QDataStream & operator<<(QDataStream &stream, const WebTab::SavedTab &tab)
Definition: webtab.cpp:85
QDataStream & operator>>(QDataStream &stream, WebTab::SavedTab &tab)
Definition: webtab.cpp:101