| 1 | from typing import ClassVar |
| 2 | |
| 3 | from qt.core import QFont, QImage, QKeyEvent, QMouseEvent, QObject, QPaintEvent, QResizeEvent, QSize, QTimerEvent, QWidget, pyqtSignal |
| 4 | |
| 5 | class FlowImages(QObject): |
| 6 | "Base class implemented in Python to supply images, captions and subtitles to a PictureFlow widget" |
| 7 | |
| 8 | dataChanged: ClassVar[pyqtSignal] |
| 9 | |
| 10 | def count(self) -> int: |
| 11 | "Return the number of images" |
| 12 | pass |
| 13 | |
| 14 | def image(self, index: int) -> QImage: |
| 15 | "Return the image at index" |
| 16 | pass |
| 17 | |
| 18 | def caption(self, index: int) -> str: |
| 19 | "Return the caption for the image at index" |
| 20 | pass |
| 21 | |
| 22 | def subtitle(self, index: int) -> str: |
| 23 | "Return the subtitle for the image at index" |
| 24 | pass |
| 25 | |
| 26 | class PictureFlow(QWidget): |
| 27 | "A widget that displays a coverflow-like animated list of images" |
| 28 | |
| 29 | itemActivated: ClassVar[pyqtSignal] |
| 30 | currentChanged: ClassVar[pyqtSignal] |
| 31 | stop: ClassVar[pyqtSignal] |
| 32 | |
| 33 | def __init__(self, parent: QWidget | None = None, queueLength: int = 3) -> None: |
| 34 | "Create a new PictureFlow widget, optionally caching queueLength slides on either side of the current slide" |
| 35 | pass |
| 36 | |
| 37 | def setImages(self, images: FlowImages) -> None: |
| 38 | "Set the FlowImages instance used to supply images, captions and subtitles" |
| 39 | pass |
| 40 | |
| 41 | def count(self) -> int: |
| 42 | "Return the number of images" |
| 43 | pass |
| 44 | |
| 45 | def slideSize(self) -> QSize: |
| 46 | "Return the size at which slides are rendered" |
| 47 | pass |
| 48 | |
| 49 | def setSlideSize(self, size: QSize) -> None: |
| 50 | "Set the size at which slides are rendered" |
| 51 | pass |
| 52 | |
| 53 | def activateOnDoubleClick(self) -> bool: |
| 54 | "Return whether double clicking a slide activates it, instead of a single click" |
| 55 | pass |
| 56 | |
| 57 | def setActivateOnDoubleClick(self, on: bool) -> None: |
| 58 | "Set whether double clicking a slide activates it, instead of a single click" |
| 59 | pass |
| 60 | |
| 61 | def preserveAspectRatio(self) -> bool: |
| 62 | "Return whether the aspect ratio of images is preserved when scaling" |
| 63 | pass |
| 64 | |
| 65 | def setPreserveAspectRatio(self, preserve: bool) -> None: |
| 66 | "Set whether the aspect ratio of images is preserved when scaling" |
| 67 | pass |
| 68 | |
| 69 | def subtitleFont(self) -> QFont: |
| 70 | "Return the font used to render subtitles" |
| 71 | pass |
| 72 | |
| 73 | def setSubtitleFont(self, font: QFont) -> None: |
| 74 | "Set the font used to render subtitles" |
| 75 | pass |
| 76 | |
| 77 | def clearCaches(self) -> None: |
| 78 | "Clear all cached, rendered slide images" |
| 79 | pass |
| 80 | |
| 81 | def slide(self, index: int) -> QImage: |
| 82 | "Return the rendered slide image for index" |
| 83 | pass |
| 84 | |
| 85 | def currentSlide(self) -> int: |
| 86 | "Return the index of the currently centered slide" |
| 87 | pass |
| 88 | |
| 89 | def showReflections(self) -> bool: |
| 90 | "Return whether reflections are drawn below slides" |
| 91 | pass |
| 92 | |
| 93 | def setShowReflections(self, show: bool) -> None: |
| 94 | "Set whether reflections are drawn below slides" |
| 95 | pass |
| 96 | |
| 97 | def maxFontSize(self) -> int: |
| 98 | "Return the maximum font size used for captions and subtitles" |
| 99 | pass |
| 100 | |
| 101 | def setMaxFontSize(self, val: int) -> None: |
| 102 | "Set the maximum font size used for captions and subtitles" |
| 103 | pass |
| 104 | |
| 105 | def setCurrentSlide(self, index: int) -> None: |
| 106 | "Make index the currently centered slide, without animation" |
| 107 | pass |
| 108 | |
| 109 | def render(self, *args, **kwargs) -> None: |
| 110 | "Re-render the widget" |
| 111 | pass |
| 112 | |
| 113 | def showPrevious(self) -> None: |
| 114 | "Animate to the previous slide" |
| 115 | pass |
| 116 | |
| 117 | def showNext(self) -> None: |
| 118 | "Animate to the next slide" |
| 119 | pass |
| 120 | |
| 121 | def showSlide(self, index: int) -> None: |
| 122 | "Animate to the slide at index" |
| 123 | pass |
| 124 | |
| 125 | def dataChanged(self) -> None: |
| 126 | "Call this slot when the underlying FlowImages data has changed" |
| 127 | pass |
| 128 | |
| 129 | def paintEvent(self, a0: QPaintEvent | None) -> None: |
| 130 | pass |
| 131 | |
| 132 | def keyPressEvent(self, a0: QKeyEvent | None) -> None: |
| 133 | pass |
| 134 | |
| 135 | def mouseMoveEvent(self, a0: QMouseEvent | None) -> None: |
| 136 | pass |
| 137 | |
| 138 | def mousePressEvent(self, a0: QMouseEvent | None) -> None: |
| 139 | pass |
| 140 | |
| 141 | def mouseReleaseEvent(self, a0: QMouseEvent | None) -> None: |
| 142 | pass |
| 143 | |
| 144 | def resizeEvent(self, a0: QResizeEvent | None) -> None: |
| 145 | pass |
| 146 | |
| 147 | def timerEvent(self, a0: QTimerEvent | None) -> None: |
| 148 | pass |