summaryrefslogtreecommitdiffstats
path: root/Tools/QtTestBrowser/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/QtTestBrowser/mainwindow.cpp')
-rw-r--r--Tools/QtTestBrowser/mainwindow.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/Tools/QtTestBrowser/mainwindow.cpp b/Tools/QtTestBrowser/mainwindow.cpp
index e2ea41d..dcd350d 100644
--- a/Tools/QtTestBrowser/mainwindow.cpp
+++ b/Tools/QtTestBrowser/mainwindow.cpp
@@ -84,8 +84,9 @@ void MainWindow::buildUI()
connect(page(), SIGNAL(loadProgress(int)), urlEdit, SLOT(setProgress(int)));
#endif
- connect(page()->mainFrame(), SIGNAL(titleChanged(const QString&)),
- this, SLOT(setWindowTitle(const QString&)));
+ connect(page()->mainFrame(), SIGNAL(loadStarted()), this, SLOT(onLoadStarted()));
+ connect(page()->mainFrame(), SIGNAL(iconChanged()), this, SLOT(onIconChanged()));
+ connect(page()->mainFrame(), SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString)));
connect(page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));
#ifndef QT_NO_SHORTCUT
@@ -219,3 +220,25 @@ void MainWindow::openLocation()
urlEdit->setFocus();
#endif
}
+
+void MainWindow::onIconChanged()
+{
+#ifndef QT_NO_INPUTDIALOG
+ urlEdit->setPageIcon(page()->mainFrame()->icon());
+#endif
+}
+
+void MainWindow::onLoadStarted()
+{
+#ifndef QT_NO_INPUTDIALOG
+ urlEdit->setPageIcon(QIcon());
+#endif
+}
+
+void MainWindow::onTitleChanged(const QString& title)
+{
+ if (title.isEmpty())
+ setWindowTitle(QCoreApplication::applicationName());
+ else
+ setWindowTitle(QString::fromLatin1("%1 - %2").arg(title).arg(QCoreApplication::applicationName()));
+}