PyQt widget which consist two widgets: file list widget and viewer widget
- PyQt5 >= 5.8
pip3 install git+https://github.com/yjg30737/pyqt-file-list-widget.git --upgrade
setView(view)
- Set the view.setExtensions(extensions: list)
- Set the extensions you want to accept. ex) ['.txt', '.doc']addDirectory(dirname: str, cur_filename: str = '')
- Add the files indirname
directory. Setcur_filename
argument if you want to make list set current filename.setDirectory(dirname: str, cur_filename: str = '')
- Clear the list and add the directory.addFilenames(filenames: list, cur_filename: str = '')
setFilenames(filenames: list, cur_filename: str = '')
getFileWidget()
- ReturnFileWidget
on the left side of whole widget.getListWidget()
- ReturnFileListWidget
, list widget containing files placed in theFileWidget
)getViewerWidget()
- ReturnViewerWidget
on the right side of whole widget.setAddAsDirectory(f: bool)
- If this is setTrue
, adding a file in certain directory is not only add the file itself, but also add the other files.isAddAsDirectory() -> bool
setWindowTitleBasedOnCurrentFileEnabled(f: bool, prefix: str = '')
- If this is setTrue
and prefix is being set, window title's format is set likePrefix - 1.png
->Prefix - 2.png
...setBottomWidgetVisible(f: bool)
- Toggle the visibility of bottom widget (navigation widget) of viewer widget.getCurrentFilename() -> str