Package schrodinger :: Package ui :: Package qt :: Module filedialog :: Class _CustomIconProvider
[hide private]
[frames] | no frames]

Class _CustomIconProvider

                   object --+        
                            |        
            sip.simplewrapper --+    
                                |    
PyQt5.QtWidgets.QFileIconProvider --+
                                    |
                                   _CustomIconProvider

Class to ensure that Schrodinger file (and directory) types get a proper icon in the QFileDialog. Proper labels are also returned.

Currently this class only works with the Project file typ.e

Nested Classes [hide private]

Inherited from PyQt5.QtWidgets.QFileIconProvider: IconType, Option, Options

Instance Methods [hide private]
 
__init__(self)
Create a _CustomIconProvider instance
bool
_isProject(self, info)
Determine if info points to a project
QIcon
icon(self, arg)
Return the proper icon for the file/directory that arg points to.
str
type(self, arg)
Return the proper type for the file/directory that arg points to.

Inherited from PyQt5.QtWidgets.QFileIconProvider: options, setOptions

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from PyQt5.QtWidgets.QFileIconProvider: Computer, Desktop, DontUseCustomDirectoryIcons, Drive, File, Folder, Network, Trashcan

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

Create a _CustomIconProvider instance

Overrides: object.__init__

_isProject(self, info)

 

Determine if info points to a project

Parameters:
  • info (QFileInfo) - Information for the current file/directory
Returns: bool
True if info points to a project, False if not

icon(self, arg)

 

Return the proper icon for the file/directory that arg points to.

If this file/dir is of a custom type, a custom icon is returned; otherwise the default icon is returned.

For projects, the icon will be different depending on whether the project is locked or not.

Parameters:
  • arg (QFileInfo) - Information for the current file/directory. This is used to determine what type of icon should be displayed for the file.
Returns: QIcon
The proper icon for arg's file/directory.
Overrides: PyQt5.QtWidgets.QFileIconProvider.icon

type(self, arg)

 

Return the proper type for the file/directory that arg points to.

This will be the default type except if arg points to a custom file tyope, such as a project (in which case it will be 'Project')

Parameters:
  • arg (QFileInfo) - Information for the current file/directory. This is used to determine what type should be displayed for the file.
Returns: str
The proper type for arg's file/directory.
Overrides: PyQt5.QtWidgets.QFileIconProvider.type