[PySide] same Pyside app doesnt dispays result as in Ubuntu like it is working fine in Windows
Vladimir Rutsky
rutsky.vladimir at gmail.com
Sat Jan 12 23:20:44 CET 2013
Hello!
On 12.01.2013 17:38, s(ãñ wrote:
> So I would really appreciate if some one can shower some kindness and
> tell me whats wrong with the code I have implemented to display the
> drives & folders in QTreeView on left and files on right QListView
>
> (see attached screenshots)
>
> here is the part of code I have
>
> self.dirmodel = QtGui.QFileSystemModel()
> # Don't show files, just folders
> sPath=os.path.expanduser("~")
> self.dirmodel.setRootPath(sPath)
> self.dirmodel.setFilter(QtCore.QDir.Drives |
> QtCore.QDir.NoDotAndDotDot | QtCore.QDir.AllDirs)
> self.dirmodel.setIconProvider
>
> self.folder_view = QtGui.QTreeView(parent=self);
> self.folder_view.setRootIsDecorated(False)
> self.folder_view.setModel(self.dirmodel)
> self.folder_view.clicked[QtCore.QModelIndex].connect(self.clicked)
>
> # Don't show columns for size, file type, and last
> modified
> self.folder_view.setHeaderHidden(True)
> self.folder_view.hideColumn(1)
> self.folder_view.hideColumn(2)
> self.folder_view.hideColumn(3)
>
>
> self.selectionModel = self.folder_view.selectionModel()
>
> self.filemodel = QtGui.QFileSystemModel()
> # Don't show folders, just files
> self.filemodel.setFilter(QtCore.QDir.NoDotAndDotDot | QtCore.QDir.Files)
>
> self.file_view = QtGui.QListView(parent=self);
> self.file_view.setModel(self.filemodel)
> self.file_view.setIconSize(QtCore.QSize(225,225)) # How come this
> doesnt work in Linux(Ubuntu)
>
>
> I am using PySide 1.1.2 both on windows and on Ubuntu... and my
> experience is quite wee and I am still learning phase...
Can you provide complete working example that we can run?
I tried minimal test and looks like it works in Ubuntu 12.04 with
python-pyside 1.1.0-1. See attached example and screen shot of it at my
system.
--
Vladimir Rutsky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130113/08ecd68b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icon_size.py
Type: text/x-python
Size: 479 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130113/08ecd68b/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icon_size_screenshot.png
Type: image/png
Size: 58078 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130113/08ecd68b/attachment.png>
More information about the PySide
mailing list