digiKam
Digikam::StayPoppedUpComboBox Class Referenceabstract
+ Inheritance diagram for Digikam::StayPoppedUpComboBox:

Public Member Functions

QModelIndex currentIndex () const
 
void hidePopup () override
 
void setCurrentIndex (const QModelIndex &index)
 
void showPopup () override
 
 StayPoppedUpComboBox (QWidget *const parent=nullptr)
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 
void installView (QAbstractItemView *view)
 
virtual void sendViewportEventToView (QEvent *e)=0
 

Protected Attributes

QPersistentModelIndex m_currentIndex
 
QAbstractItemView * m_view
 

Constructor & Destructor Documentation

◆ StayPoppedUpComboBox()

Digikam::StayPoppedUpComboBox::StayPoppedUpComboBox ( QWidget *const  parent = nullptr)
explicit

This class provides an abstract QComboBox with a custom view (which is created by implementing subclasses) instead of the usual QListView. 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.

References m_view.

Member Function Documentation

◆ currentIndex()

QModelIndex Digikam::ModelIndexBasedComboBox::currentIndex ( ) const
inherited

◆ eventFilter()

bool Digikam::StayPoppedUpComboBox::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotected

◆ hidePopup()

void Digikam::ModelIndexBasedComboBox::hidePopup ( )
overrideinherited

◆ installView()

void Digikam::StayPoppedUpComboBox::installView ( QAbstractItemView *  view)
protected

Replace the standard combo box list view with the given view. The view will be set as the view of the combo box (including re-parenting) and be stored in the m_view variable.

References m_view.

Referenced by Digikam::TreeViewComboBox::installView(), and Digikam::ListViewComboBox::installView().

◆ sendViewportEventToView()

virtual void Digikam::StayPoppedUpComboBox::sendViewportEventToView ( QEvent *  e)
protectedpure virtual

Implement in subclass: Send the given event to the viewportEvent() method of m_view. 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::ListViewComboBox, Digikam::TreeViewComboBox, and Digikam::AbstractAlbumTreeViewSelectComboBox.

Referenced by eventFilter().

◆ setCurrentIndex()

void Digikam::ModelIndexBasedComboBox::setCurrentIndex ( const QModelIndex &  index)
inherited

◆ showPopup()

void Digikam::ModelIndexBasedComboBox::showPopup ( )
overrideinherited

Member Data Documentation

◆ m_currentIndex

◆ m_view


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