Helpviewer/UrlBar/FavIconLabel.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 978
11f8adbcac97
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
10 from PyQt4.QtCore import Qt, QPoint, QUrl, QMimeData 10 from PyQt4.QtCore import Qt, QPoint, QUrl, QMimeData
11 from PyQt4.QtGui import QLabel, QApplication, QDrag 11 from PyQt4.QtGui import QLabel, QApplication, QDrag
12 12
13 import Helpviewer.HelpWindow 13 import Helpviewer.HelpWindow
14 14
15
15 class FavIconLabel(QLabel): 16 class FavIconLabel(QLabel):
16 """ 17 """
17 Class implementing the label to show the web site icon. 18 Class implementing the label to show the web site icon.
18 """ 19 """
19 def __init__(self, parent = None): 20 def __init__(self, parent=None):
20 """ 21 """
21 Constructor 22 Constructor
22 23
23 @param parent reference to the parent widget (QWidget) 24 @param parent reference to the parent widget (QWidget)
24 """ 25 """
75 self.__browser is not None: 76 self.__browser is not None:
76 drag = QDrag(self) 77 drag = QDrag(self)
77 mimeData = QMimeData() 78 mimeData = QMimeData()
78 title = self.__browser.title() 79 title = self.__browser.title()
79 if title == "": 80 if title == "":
80 title = str(self.__browser.url().toEncoded(), encoding = "utf-8") 81 title = str(self.__browser.url().toEncoded(), encoding="utf-8")
81 mimeData.setText(title) 82 mimeData.setText(title)
82 mimeData.setUrls([self.__browser.url()]) 83 mimeData.setUrls([self.__browser.url()])
83 p = self.pixmap() 84 p = self.pixmap()
84 if p: 85 if p:
85 drag.setPixmap(p) 86 drag.setPixmap(p)

eric ide

mercurial