PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 558 - print attribute of a QWebFrame cannot be accessed normally (syntax error)
: print attribute of a QWebFrame cannot be accessed normally (syntax error)
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: ApiExtractor
: 1.0.0 beta1
: PC MS Windows XP/Vista/7
: P3 trivial
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2010-12-19 07:11 EET by Robbert
Modified: 2011-01-06 16:19 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robbert 2010-12-19 07:11:42 EET
python 2.6.6 (32bit)

The attribute print (of a QWebFrame) generates a syntax error.
You can circumvent this by using '.__getattribute__('print')' instead of
'.print'
PyQt solved this by implementing both 'print' and 'print_'.
(http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebframe.html#print)

While searching the documentation the following object seem to suffer from the
same problem: QPlainTextEdit

(I now also noticed that I can use QWebView.print_() for printing a webpage )


<code>
import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtWebKit import *

sys.argv = []

app = QApplication(sys.argv)

web = QWebView (  )

web.load(QUrl("http://www.pyside.org/docs/pyside/PySide/QtWebKit/QWebFrame.html#PySide.QtWebKit.QWebFrame.print"))
web.show()

printer= QPrinter()
dialog = QPrintDialog(printer, web)
a = dialog.exec_()
web.page().mainFrame().print(printer)

sys.exit(app.exec_())
</code>
Comment 1 Matti Airas 2010-12-20 11:34:06 EET
Thanks a lot for the bug report! Indeed, a reserved word and an alternate name
should've been provided. I'm prioritizing this P3 - although it appears Hugo is
already on it. :-)
Comment 2 Hugo Parente Lima 2010-12-20 14:14:35 EET
Fixed in commit:

pyside/499ef3bbb4ef8429ac1fb7505318ca7d066c06e5

Other Qt methods called print were also renamed as well, thanks for the bug
report!
Comment 3 renato filho 2011-01-06 16:19:33 EET
released on beta3