73 """ |
73 """ |
74 if evt.button() == Qt.LeftButton: |
74 if evt.button() == Qt.LeftButton: |
75 self.__dragStartPos = evt.pos() |
75 self.__dragStartPos = evt.pos() |
76 super(FavIconLabel, self).mousePressEvent(evt) |
76 super(FavIconLabel, self).mousePressEvent(evt) |
77 |
77 |
|
78 def mouseReleaseEvent(self, evt): |
|
79 """ |
|
80 Protected method to handle mouse release events. |
|
81 |
|
82 @param evt reference to the mouse event (QMouseEvent) |
|
83 """ |
|
84 if evt.button() == Qt.LeftButton: |
|
85 self.__showPopup(evt.globalPos()) |
|
86 super(FavIconLabel, self).mouseReleaseEvent(evt) |
|
87 |
78 def mouseMoveEvent(self, evt): |
88 def mouseMoveEvent(self, evt): |
79 """ |
89 """ |
80 Protected method to handle mouse move events. |
90 Protected method to handle mouse move events. |
81 |
91 |
82 @param evt reference to the mouse event (QMouseEvent) |
92 @param evt reference to the mouse event (QMouseEvent) |
95 p = self.pixmap() |
105 p = self.pixmap() |
96 if p: |
106 if p: |
97 drag.setPixmap(p) |
107 drag.setPixmap(p) |
98 drag.setMimeData(mimeData) |
108 drag.setMimeData(mimeData) |
99 drag.exec_() |
109 drag.exec_() |
|
110 |
|
111 def __showPopup(self, pos): |
|
112 """ |
|
113 Private method to show the site info popup. |
|
114 |
|
115 @param pos position the popup should be shown at |
|
116 @type QPoint |
|
117 """ |
|
118 if self.__browser is None: |
|
119 return |
|
120 |
|
121 url = self.__browser.url() |
|
122 if url.isValid() and url.scheme() not in [ |
|
123 "eric", "about", "data", "chrome"]: |
|
124 from ..SiteInfo.SiteInfoWidget import SiteInfoWidget |
|
125 info = SiteInfoWidget(self.__browser, self) |
|
126 info.showAt(pos) |