PyQt widget for slide show
- PyQt5 >= 5.8
python -m pip install pyqt-slideshow
This widget mainly consists of three child widget.
- View
- Navigation button widget - buttons on the both sides of the view
- Bottom button widget - buttons at the bottom
You can set the image files to show with setFilenames
.
You can watch previous/next image by clicking the navigation button or nth image file by clicking the buttons at the bottom.
Image is automatically changed by internal timer(QTimer). Interval is set to 5000 milliseconds by default.
setFilenames(filenames: list)
- give the image files. You have to call this one time only so far.setTimerEnabled(f: bool)
- set the image change timersetInterval(milliseconds: int)
- set the image change intervalsetNavigationButtonVisible(f: bool)
- set the navigation button's visibility(which also decides that you use it or not)setBottomButtonVisible(f: bool)
- set the bottom button's visibility(which also decides that you use it or not)setGradientEnabled(f: bool)
- Cover the dark gradient over the image
For example
getButtonGroup()
- get the button group(QButtonGroup) which has the every button. You can get them bybtnGrp.buttons()
getBtnWidget()
- get the btn widget to set the spacing between the bottom button or other customization of button widgetgetPrevBtn()
- get the prev buttongetNextBtn()
- get the next button
from PyQt5.QtWidgets import QApplication
from pyqt_slideshow import SlideShow
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
s = SlideShow()
s.setFilenames(['bioshock.jpg', 'dragon_age.jpg', 'ride_to_hell_retribution.jpg'])
s.show()
app.exec_()
slideshow_example.mp4
from PyQt5.QtWidgets import QApplication
from pyqt_slideshow import SlideShow
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
s = SlideShow()
s.setFilenames(['bioshock.jpg', 'dragon_age.jpg', 'ride_to_hell_retribution.jpg'])
s.setNavigationButtonVisible(False) # to not show the navigation button
s.setBottomButtonVisible(False) # to not show the bottom button
s.show()
app.exec_()
slideshow_not_including_example.mp4
- Give the option to go back to first page by user when pressing the next button in the last page
- Transition effect
- Default screen when there is no image (thumbnail?)
- Add more styles with QML