![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Public Member Functions | |
StayPoppedUpComboBox (QWidget *const parent=nullptr) | |
This class provides an abstract QComboBox with a custom view (which is created by implementing subclasses) instead of the usual QListView. | |
![]() | |
ModelIndexBasedComboBox (QWidget *const parent=nullptr) | |
QComboBox has a current index based on a single integer. | |
QModelIndex | currentIndex () const |
void | hidePopup () override |
void | setCurrentIndex (const QModelIndex &index) |
void | showPopup () override |
Protected Member Functions | |
bool | eventFilter (QObject *watched, QEvent *event) override |
void | installView (QAbstractItemView *view) |
Replace the standard combo box list view with the given view. | |
virtual void | sendViewportEventToView (QEvent *e)=0 |
Implement in subclass: Send the given event to the viewportEvent() method of m_view. | |
Protected Attributes | |
QAbstractItemView * | m_view = nullptr |
![]() | |
QPersistentModelIndex | m_currentIndex |
|
explicit |
The Pop-up of the combo box will stay open after selecting an item; it will be closed by clicking outside, but not inside the widget. You need three steps: Construct the object, call setModel() with an appropriate QAbstractItemModel, then call installView() to replace the standard combo box view with a view.
|
protected |
The view will be set as the view of the combo box (including re-parenting) and be stored in the m_view variable.
|
protectedpure virtual |
This method is protected for a usual QAbstractItemView. You can override, pass a view, and call parent implementation. The existing view will be used. You must then also reimplement sendViewportEventToView.
Implemented in Digikam::AbstractAlbumTreeViewSelectComboBox, Digikam::TreeViewComboBox, and Digikam::ListViewComboBox.