A simple Python/PyQt6 SlideShow to display jpg images in images folder. It's generated by Copilot, except the lines marked in blue. Tested on Windows 11 with PyQt6 installed in Python virtual environment . pyqt6_slideshow.py import sys import glob from PyQt6.QtWidgets import QApplication, QLabel, QMainWindow, QVBoxLayout, QWidget from PyQt6.QtGui import QPixmap from PyQt6.QtCore import QTimer from PyQt6.QtCore import Qt class SlideShowWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Image Slide Show") self.image_label = QLabel(self) self.image_label.setAlignment(Qt.AlignmentFlag.AlignCenter) layout = QVBoxLayout() layout.addWidget(self.image_label) container = QWidget() container.setLayout(layout) self.setCentralWidget(container) self.image_files = glob.glob(" images/ *.jpg") self.current_index = 0 self.show_image() ...
Comments
Post a Comment