Code Monkey home page Code Monkey logo

pyqt-slideshow's Introduction

pyqt-slideshow

PyQt widget for slide show

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-slideshow

Detailed Description

image

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.

Method Overview

  • setFilenames(filenames: list) - give the image files. You have to call this one time only so far.
  • setTimerEnabled(f: bool) - set the image change timer
  • setInterval(milliseconds: int) - set the image change interval
  • setNavigationButtonVisible(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 by btnGrp.buttons()
  • getBtnWidget() - get the btn widget to set the spacing between the bottom button or other customization of button widget
  • getPrevBtn() - get the prev button
  • getNextBtn() - get the next button

Example

Code Sample 1 (Including navigation/bottom 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_()

Result

slideshow_example.mp4

Code Sample 2 (Not including navigation/bottom 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.setNavigationButtonVisible(False) # to not show the navigation button
    s.setBottomButtonVisible(False) # to not show the bottom button
    s.show()
    app.exec_()

Result

slideshow_not_including_example.mp4

TODO list

  • 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

pyqt-slideshow's People

Contributors

yjg30737 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nikonru

pyqt-slideshow's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.