Skip to main content

QCustomImageViewer

Pro widget

QCustomImageViewer ships in Custom Widgets Pro. The free package under GPLv3 does not include it.

See plans

QCustomImageViewer

A modal lightbox for a gallery of images.

A frameless overlay that covers its host window with a dark scrim and shows one image centred (aspect-fit), with painted prev / next arrows, a close button and a "3 / 12" counter. Feed it images with setImages([...]) (QPixmap / path) and open a given one with openAt(index, host); it parents itself to the host and resizes to cover it. Left / Right / Esc navigate and close; clicking the scrim closes. Emits indexChanged(int) and closed(). The scrim is intentionally dark in every theme (a lightbox convention); its colours are qproperties so a form can still retint them.

At a glance

TierPro
Importfrom Custom_Widgets.QCustomImageViewer import QCustomImageViewer
Qt DesignerYes — drag it from the palette

Quick start

from Custom_Widgets.QCustomImageViewer import QCustomImageViewer

widget = QCustomImageViewer()

Dark theme

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomImageViewer in dark theme

Properties

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
scrimColorcolor#e60a0e18
buttonColorcolor#1cffffff
buttonIconColorcolor#ffffff
textColorcolor#eef1f6
imageRadiusint16

Signals

Signal
closed()
indexChanged(int)

Methods

MethodDescription
buttonColor(*args, **kwargs)Button color.
buttonIconColor(*args, **kwargs)Button icon color.
closeEvent(e)Close the event.
closed(...)Closed.
count()Count.
imageRadius(*args, **kwargs)Image radius.
index()Index.
indexChanged(...)Index changed.
openAt(index, host=None)Cover host (or the current parent) and show image index.
scrimColor(*args, **kwargs)Scrim color.
setImageAt(index, pm)Swap one image in place (e.g. the full-res photo arriving async).
setImages(images)Set the images.
setIndex(i)Set the index.
textColor(*args, **kwargs)Text color.

QCustomCoverFlow · QCustomMediaGrid · QCustomMediaTimeline · QCustomPlayerBar · QCustomVideoPlayer · QCustomVoiceMessage · QCustomWallpaper