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 1065 - Invalid example in QFileDialog documentation
: Invalid example in QFileDialog documentation
Status: RESOLVED FIXED
Product: PySide
Classification: Unclassified
Component: Documentation
: HEAD
: PC All
: P4 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-11-18 14:00 EET by Vladimir Rutsky
Modified: 2012-01-06 00:30 EET (History)
9 users (show)

See Also:


Attachments
test that shows return value of getOpenFileName() (252 bytes, text/x-python)
2011-11-18 14:00 EET, Vladimir Rutsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Rutsky 2011-11-18 14:00:29 EET
Created attachment 453 [details]
test that shows return value of getOpenFileName()

Documentation [1] provides following example:

fileName = QFileDialog.getOpenFileName(self,
    tr("Open Image"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)"))

Example doesn't work because:
a) getOpenFileName() returns tuple (fileName, selectedFilter);
b) unknown function tr(), according to documentation [2] tr() should be called
as method of QObject, e.g. self.tr().

Also most of pages use unbounded tr() function, should I open bug report about
fixing it globally in whole documentation?

[1] http://www.pyside.org/docs/pyside/PySide/QtGui/QFileDialog.html
[2] http://developer.qt.nokia.com/wiki/PySide_Internationalization
Comment 1 Hugo Parente Lima 2012-01-06 00:30:25 EET
Fixed in commit:

pyside/a8d255e9784b47d1e1f6f797decdbc0f5306d815

I removed all mentions to tr() function on QFileDialog examples to simplify the
them.

Better to file a bug per page to make easier for us to track what was fixed and
what wasn't.