NDEVR
API Documentation
ImageChooserGallery

A gallery widget that displays available images from an ImageFactory and allows the user to select one. More...

Inheritance diagram for ImageChooserGallery:
[legend]
Collaboration diagram for ImageChooserGallery:
[legend]

Public Member Functions

 ImageChooserGallery (QWidget *parent=nullptr)
 Constructs an ImageChooserGallery.
void fillWithImages (ImageFactory &factory=ImageFactory::DefaultFactory())
 Populates the gallery with images from the given ImageFactory.
void imageChosenSignal (StringView image_id)
 Emitted when the user selects an image, with its ID.
Public Member Functions inherited from ButtonGallery
 ButtonGallery (QWidget *parent=nullptr)
 Constructs a ButtonGallery with an optional parent widget.
virtual void addButton (Button *button)
 Adds a button to the gallery.
const Buffer< QPointer< Button > > & buttons () const
 Returns the list of buttons currently in the gallery.
virtual void clear ()
 Removes all buttons from the gallery.
virtual void removeButton (Button *button)
 Removes a button from the gallery.
void setIconSizeMultiplier (fltp04 multiplier)
 Sets the icon size multiplier applied to all buttons in the gallery.
QSize sizeHint () const override
 Returns the recommended size for the gallery widget.
virtual void sortButtons ()
 Sorts buttons alphabetically.
virtual void sortButtons (const std::function< bool(Button *, Button *)> &sorter)
 Sorts buttons using a custom comparison function.
void updateGalleryLayout ()
 Updates the layout of buttons within the gallery after additions or removals.
Public Member Functions inherited from QCustomScrollArea
 QCustomScrollArea (QWidget *parent=nullptr)
 Constructs a custom scroll area widget.
bool eventFilter (QObject *, QEvent *event) override
 Filters events for the child widget to handle resize and layout updates.
void setUseFullScroll (bool use_full_scroll)
 Sets whether the scroll area uses full scroll mode, where the scroll area expands to accommodate the full content size in the size hint.
void setWidget (QWidget *w)
 Sets the scrollable child widget.
QSize sizeHint () const override
 Returns the recommended size for the scroll area.
QWidget * takeWidget ()
 Removes and returns the scrollable child widget without deleting it.
bool useFullScroll () const
 Returns whether full scroll mode is enabled.

Protected Attributes

std::function< bool(StringView view, ImageFactory &factory)> m_filter
 Optional filter to restrict which images are shown.
Protected Attributes inherited from ButtonGallery
RibbonSubGroupm_gallery
 The internal ribbon sub-group managing the button layout.
Protected Attributes inherited from QCustomScrollArea
bool m_use_full_scroll = false
 Whether the scroll area uses full scroll mode.

Detailed Description

A gallery widget that displays available images from an ImageFactory and allows the user to select one.


Definition at line 14 of file ImageChooserGallery.h.

Constructor & Destructor Documentation

◆ ImageChooserGallery()

ImageChooserGallery::ImageChooserGallery ( QWidget * parent = nullptr)

Constructs an ImageChooserGallery.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ fillWithImages()

void ImageChooserGallery::fillWithImages ( ImageFactory & factory = ImageFactory::DefaultFactory())

Populates the gallery with images from the given ImageFactory.

Parameters
[in]factoryThe ImageFactory to source images from.

References ImageFactory::DefaultFactory().


The documentation for this class was generated from the following file: