digiKam
Digikam::ListViewComboBox Class Reference
+ Inheritance diagram for Digikam::ListViewComboBox:

Public Member Functions

QModelIndex currentIndex () const
 
void hidePopup () override
 
virtual void installView (QAbstractItemView *view=nullptr)
 
 ListViewComboBox (QWidget *parent=nullptr)
 
void setCurrentIndex (const QModelIndex &index)
 
void showPopup () override
 
QListView * view () const
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 
void sendViewportEventToView (QEvent *e) override
 

Protected Attributes

QPersistentModelIndex m_currentIndex
 
QAbstractItemView * m_view
 

Constructor & Destructor Documentation

◆ ListViewComboBox()

Digikam::ListViewComboBox::ListViewComboBox ( QWidget *  parent = nullptr)
explicit

This class provides an implementation of a StayPoppedUpComboBox with a QListView. This is the standard view of a QComboBox, but in conjunction with StayPoppedUpComboBox some extra steps are needed. You need three steps: Construct the object, call setModel() with an appropriate QAbstractItemModel, then call installView().

Member Function Documentation

◆ currentIndex()

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

◆ eventFilter()

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

◆ hidePopup()

void Digikam::ModelIndexBasedComboBox::hidePopup ( )
overrideinherited

◆ installView()

void Digikam::ListViewComboBox::installView ( QAbstractItemView *  view = nullptr)
virtual

Replace the standard combo box list view with a QTreeView. Call this after installing an appropriate model.

Reimplemented in Digikam::ChoiceSearchComboBox.

References Digikam::StayPoppedUpComboBox::installView(), and view().

Referenced by Digikam::ChoiceSearchComboBox::installView().

◆ sendViewportEventToView()

void Digikam::ListViewComboBox::sendViewportEventToView ( QEvent *  e)
overrideprotectedvirtual

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.

Implements Digikam::StayPoppedUpComboBox.

References Digikam::StayPoppedUpComboBox::m_view.

◆ setCurrentIndex()

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

◆ showPopup()

void Digikam::ModelIndexBasedComboBox::showPopup ( )
overrideinherited

◆ view()

QListView * Digikam::ListViewComboBox::view ( ) const

Returns the QTreeView of this class. Valid after installView() has been called.

References Digikam::StayPoppedUpComboBox::m_view.

Referenced by installView(), and Digikam::ChoiceSearchComboBox::installView().

Member Data Documentation

◆ m_currentIndex

◆ m_view


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