diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-06 14:22:53 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-06 14:22:53 +0200 |
| commit | bcda97a2e17f6e1366cfe5b03bd0b407d4484255 (patch) | |
| tree | 2f485e8ff94e26a4c8e1b2e0310c396dbb23c5a0 /mainwindow.cpp | |
| parent | 7e7ac47308d88aa3a67836937a6888b7b3d90d56 (diff) | |
| download | kristall-bcda97a2e17f6e1366cfe5b03bd0b407d4484255.tar.gz | |
Reworks document rendering: Now generates QTextDocument directly instead of using HTML inbetween.
Diffstat (limited to 'mainwindow.cpp')
| -rw-r--r-- | mainwindow.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 48e7f54..aba06f0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -32,6 +32,8 @@ BrowserTab * MainWindow::addEmptyTab(bool focus_new) { BrowserTab * tab = new BrowserTab(this); + connect(tab, &BrowserTab::titleChanged, this, &MainWindow::on_tab_titleChanged); + int index = this->ui->browser_tabs->addTab(tab, "Page"); if(focus_new) { @@ -102,3 +104,23 @@ void MainWindow::on_history_view_doubleClicked(const QModelIndex &index) tab->navigateBack(index); } } + +void MainWindow::on_tab_titleChanged(const QString &title) +{ + auto * tab = qobject_cast<BrowserTab*>(sender()); + if(tab != nullptr) { + int index = this->ui->browser_tabs->indexOf(tab); + assert(index >= 0); + this->ui->browser_tabs->setTabText(index, title); + } +} + +void MainWindow::on_tab_locationChanged(const QUrl &url) +{ + auto * tab = qobject_cast<BrowserTab*>(sender()); + if(tab != nullptr) { + int index = this->ui->browser_tabs->indexOf(tab); + assert(index >= 0); + this->ui->browser_tabs->setTabToolTip(index, url.toString()); + } +} |
