mirror of https://github.com/vitalif/phantomjs
Renamed pageScroll to scrollPosition
parent
983518d913
commit
7641e4e1a4
|
@ -136,10 +136,10 @@ class WebPage(QObject):
|
||||||
if not self.m_clipRect.isEmpty():
|
if not self.m_clipRect.isEmpty():
|
||||||
frameRect = self.m_clipRect
|
frameRect = self.m_clipRect
|
||||||
|
|
||||||
if self.m_webPage.pageScroll:
|
if self.m_webPage.scrollPosition:
|
||||||
self.m_webPage.mainFrame().\
|
self.m_webPage.mainFrame().\
|
||||||
setScrollPosition(QPoint(self.m_webPage.pageScroll.x(),
|
setScrollPosition(QPoint(self.m_webPage.scrollPosition.x(),
|
||||||
self.m_webPage.pageScroll.y() ))
|
self.m_webPage.scrollPosition.y() ))
|
||||||
|
|
||||||
image = QImage(frameRect.size(), QImage.Format_ARGB32)
|
image = QImage(frameRect.size(), QImage.Format_ARGB32)
|
||||||
image.fill(qRgba(255, 255, 255, 0))
|
image.fill(qRgba(255, 255, 255, 0))
|
||||||
|
@ -427,16 +427,16 @@ class WebPage(QObject):
|
||||||
self.m_webPage.setViewportSize(QSize(sizes['width'], sizes['height']))
|
self.m_webPage.setViewportSize(QSize(sizes['width'], sizes['height']))
|
||||||
|
|
||||||
@pyqtProperty('QVariantMap')
|
@pyqtProperty('QVariantMap')
|
||||||
def pageScroll(self):
|
def scrollPosition(self):
|
||||||
scroll = self.m_webPage.pageScroll
|
scroll = self.m_webPage.scrollPosition
|
||||||
result = {
|
result = {
|
||||||
'left': scroll.x(),
|
'left': scroll.x(),
|
||||||
'top': scroll.y()
|
'top': scroll.y()
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@pageScroll.setter
|
@scrollPosition.setter
|
||||||
def pageScroll(self, size):
|
def scrollPosition(self, size):
|
||||||
names = ('left', 'top')
|
names = ('left', 'top')
|
||||||
for item in names:
|
for item in names:
|
||||||
try:
|
try:
|
||||||
|
@ -444,9 +444,7 @@ class WebPage(QObject):
|
||||||
if globals()[item] < 0:
|
if globals()[item] < 0:
|
||||||
globals()[item] = 0
|
globals()[item] = 0
|
||||||
except KeyError:
|
except KeyError:
|
||||||
globals()[item] = getattr(self.m_webPage.pageScroll(), item)()
|
globals()[item] = getattr(self.m_webPage.scrollPosition, item)()
|
||||||
self.m_webPage.pageScroll = QPoint(left, top)
|
self.m_webPage.scrollPosition = QPoint(left, top)
|
||||||
|
|
||||||
do_action('WebPage')
|
do_action('WebPage')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue