WebBrowser/WebBrowserView.py

changeset 6147
0ea1f1e72463
parent 6142
304a469455c8
child 6155
ae44225e7e7c
equal deleted inserted replaced
6146:94a4e8d1ac4f 6147:0ea1f1e72463
1636 return QIcon(self.__siteIcon) 1636 return QIcon(self.__siteIcon)
1637 1637
1638 from .Tools import WebIconProvider 1638 from .Tools import WebIconProvider
1639 return WebIconProvider.instance().iconForUrl(self.url()) 1639 return WebIconProvider.instance().iconForUrl(self.url())
1640 1640
1641 def title(self):
1642 """
1643 Public method to get the view title.
1644
1645 @return view title
1646 @rtype str
1647 """
1648 titleStr = super(WebBrowserView, self).title()
1649 if not titleStr:
1650 if self.url().isEmpty():
1651 url = self.__page.requestedUrl()
1652 else:
1653 url = self.url()
1654
1655 titleStr = url.host()
1656 if not titleStr:
1657 titleStr = url.toString(QUrl.RemoveFragment)
1658
1659 if not titleStr or titleStr == "about:blank":
1660 titleStr = self.tr("Empty Page")
1661
1662 return titleStr
1663
1641 def __linkHovered(self, link): 1664 def __linkHovered(self, link):
1642 """ 1665 """
1643 Private slot to handle the linkHovered signal. 1666 Private slot to handle the linkHovered signal.
1644 1667
1645 @param link the URL of the link (string) 1668 @param link the URL of the link (string)

eric ide

mercurial