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

Public Member Functions

QModelIndex currentIndex () const
 
void hidePopup () override
 
virtual void installView (QAbstractItemView *view=nullptr)
 
void setCurrentIndex (const QModelIndex &index)
 
void showPopup () override
 
 TreeViewComboBox (QWidget *parent=nullptr)
 
QTreeView * 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

◆ TreeViewComboBox()

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

This class provides a QComboBox with a QTreeView instead of the usual QListView. 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 QTreeView.

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::TreeViewComboBox::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::TreeViewLineEditComboBox, Digikam::AbstractAlbumTreeViewSelectComboBox, and Digikam::AlbumSelectComboBox.

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

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

◆ sendViewportEventToView()

void Digikam::TreeViewComboBox::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()

Member Data Documentation

◆ m_currentIndex

◆ m_view


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