digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::TreeViewComboBox Class Reference
+ Inheritance diagram for Digikam::TreeViewComboBox:

Public Member Functions

 TreeViewComboBox (QWidget *parent=nullptr)
 This class provides a QComboBox with a QTreeView instead of the usual QListView.
 
virtual void installView (QAbstractItemView *view=nullptr)
 Replace the standard combo box list view with a QTreeView.
 
virtual QTreeView * view () const
 Returns the QTreeView of this class.
 
- Public Member Functions inherited from Digikam::StayPoppedUpComboBox
 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.
 
- Public Member Functions inherited from Digikam::ModelIndexBasedComboBox
 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

void sendViewportEventToView (QEvent *e) override
 Implement in subclass: Send the given event to the viewportEvent() method of m_view.
 
- Protected Member Functions inherited from Digikam::StayPoppedUpComboBox
bool eventFilter (QObject *watched, QEvent *event) override
 
void installView (QAbstractItemView *view)
 Replace the standard combo box list view with the given view.
 

Additional Inherited Members

- Protected Attributes inherited from Digikam::StayPoppedUpComboBox
QAbstractItemView * m_view = nullptr
 
- Protected Attributes inherited from Digikam::ModelIndexBasedComboBox
QPersistentModelIndex m_currentIndex
 

Constructor & Destructor Documentation

◆ TreeViewComboBox()

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

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

◆ installView()

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

Call this after installing an appropriate model.

Reimplemented in Digikam::AlbumSelectComboBox, Digikam::AbstractAlbumTreeViewSelectComboBox, and Digikam::TreeViewLineEditComboBox.

◆ sendViewportEventToView()

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

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.

◆ view()

QTreeView * Digikam::TreeViewComboBox::view ( ) const
virtual

Valid after installView() has been called