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

Public Slots

void hidePopup () override
 
virtual void updateText ()
 

Public Member Functions

void addCheckUncheckContextMenuActions ()
 
 AlbumTreeViewSelectComboBox (QWidget *const parent=nullptr)
 
QModelIndex currentIndex () const
 
QSortFilterProxyModel * filterModel () const
 
bool isCheckable () const
 
AbstractCheckableAlbumModelmodel () const
 
void setAlbumModels (AbstractCheckableAlbumModel *model, AlbumFilterModel *filterModel=nullptr)
 
void setAlbumModels (AlbumModel *model, CheckableAlbumFilterModel *filterModel=nullptr)
 
void setCheckable (bool checkable)
 
void setCloseOnActivate (bool close)
 
void setCurrentIndex (const QModelIndex &index)
 
void setDefaultAlbumModel ()
 
void setDefaultModel ()
 
void setDefaultTagModel ()
 
void setLineEdit (QLineEdit *edit)
 
void setLineEditText (const QString &text)
 
void setNoSelectionText (const QString &text)
 
void setShowCheckStateSummary (bool show)
 
void setTreeView (AbstractAlbumTreeView *const treeView)
 
void showPopup () override
 
AlbumTreeViewview () const
 

Protected Member Functions

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

Protected Attributes

QLineEdit * m_comboLineEdit
 
QPersistentModelIndex m_currentIndex
 
AbstractAlbumTreeViewm_treeView
 
QAbstractItemView * m_view
 

Constructor & Destructor Documentation

◆ AlbumTreeViewSelectComboBox()

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

Member Function Documentation

◆ addCheckUncheckContextMenuActions()

void Digikam::AbstractAlbumTreeViewSelectComboBox::addCheckUncheckContextMenuActions ( )
inherited

Enables a context menu which contains options to check or uncheck groups of albums, given you have a checkable model. Call this method after setModel().

References Digikam::AbstractAlbumTreeView::addContextMenuElement(), Digikam::AbstractAlbumTreeViewSelectComboBox::m_treeView, and Digikam::AbstractAlbumTreeView::setEnableContextMenu().

Referenced by Digikam::SearchFieldAlbum::setupValueWidgets().

◆ currentIndex()

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

◆ eventFilter()

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

◆ filterModel()

QSortFilterProxyModel * Digikam::AlbumSelectComboBox::filterModel ( ) const
inherited

◆ hidePopup

void Digikam::AlbumSelectComboBox::hidePopup ( )
overrideslotinherited

◆ installLineEdit()

void Digikam::TreeViewLineEditComboBox::installLineEdit ( )
protectedvirtualinherited

Sets a line edit. Called by installView(). The default implementation is described above. An empty implementation will keep the default QComboBox line edit.

References Digikam::TreeViewLineEditComboBox::m_comboLineEdit, and Digikam::TreeViewLineEditComboBox::setLineEdit().

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

◆ installView()

void Digikam::AbstractAlbumTreeViewSelectComboBox::installView ( QAbstractItemView *  view = nullptr)
overrideprotectedvirtualinherited

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

Reimplemented from Digikam::AlbumSelectComboBox.

References Digikam::AlbumSelectComboBox::installView(), Digikam::AbstractAlbumTreeViewSelectComboBox::m_treeView, and Digikam::TreeViewComboBox::view().

◆ isCheckable()

bool Digikam::AlbumSelectComboBox::isCheckable ( ) const
inherited

◆ model()

AbstractCheckableAlbumModel * Digikam::AlbumSelectComboBox::model ( ) const
inherited

◆ sendViewportEventToView()

void Digikam::AbstractAlbumTreeViewSelectComboBox::sendViewportEventToView ( QEvent *  e)
overrideprotectedvirtualinherited

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::AbstractAlbumTreeViewSelectComboBox::m_treeView, and Digikam::AbstractAlbumTreeView::viewportEvent().

◆ setAlbumModels() [1/2]

◆ setAlbumModels() [2/2]

◆ setCheckable()

void Digikam::AlbumSelectComboBox::setCheckable ( bool  checkable)
inherited

Enable checkboxes next to the items. Default: true

Referenced by Digikam::AddTagsComboBox::AddTagsComboBox().

◆ setCloseOnActivate()

void Digikam::AlbumSelectComboBox::setCloseOnActivate ( bool  close)
inherited

Enable closing when an item was activated (clicked). Default: false.

Referenced by Digikam::AddTagsComboBox::AddTagsComboBox().

◆ setCurrentIndex()

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

◆ setDefaultAlbumModel()

void Digikam::AlbumSelectComboBox::setDefaultAlbumModel ( )
inherited

Once after creation, call one of these three methods. Use the first one if you want a standard combo box for PAlbums and the second one for tags, while the third allows you to provide custom source and filter models. The first two also set a default noSelectionText. Customize afterwards if required.

References Digikam::AbstractAlbumModel::IgnoreRootAlbum, Digikam::AlbumSelectComboBox::setAlbumModels(), and Digikam::TreeViewComboBox::view().

◆ setDefaultModel()

void Digikam::AlbumTreeViewSelectComboBox::setDefaultModel ( )

◆ setDefaultTagModel()

void Digikam::AlbumSelectComboBox::setDefaultTagModel ( )
inherited

◆ setLineEdit()

void Digikam::TreeViewLineEditComboBox::setLineEdit ( QLineEdit *  edit)
inherited

◆ setLineEditText()

void Digikam::TreeViewLineEditComboBox::setLineEditText ( const QString &  text)
inherited

Set the text of the line edit (the text that is visible if the popup is not opened). Applicable only for default installLineEdit() implementation.

References Digikam::TreeViewLineEditComboBox::m_comboLineEdit.

Referenced by Digikam::AlbumSelectComboBox::updateText().

◆ setNoSelectionText()

void Digikam::AlbumSelectComboBox::setNoSelectionText ( const QString &  text)
inherited

Sets the text that is used to describe the state when no album is selected. This may be something like "Any album" or "No tag selected". Depends on the default line edit implementation of TreeViewLineEditComboBox.

References Digikam::AlbumSelectComboBox::updateText().

Referenced by Digikam::SearchFieldAlbum::setupValueWidgets().

◆ setShowCheckStateSummary()

void Digikam::AlbumSelectComboBox::setShowCheckStateSummary ( bool  show)
inherited

If the box is checkable, enable showing a resume a la "3 Albums checked" in the combo box text. Default: True

References Digikam::AlbumSelectComboBox::updateText().

◆ setTreeView()

void Digikam::AbstractAlbumTreeViewSelectComboBox::setTreeView ( AbstractAlbumTreeView *const  treeView)
inherited

Set a tree view created by you instead of creating a default view (in the subclasses). Only takes effect before calling setModel.

References Digikam::AbstractAlbumTreeViewSelectComboBox::m_treeView.

◆ showPopup()

void Digikam::ModelIndexBasedComboBox::showPopup ( )
overrideinherited

◆ updateText

void Digikam::AlbumSelectComboBox::updateText ( )
virtualslotinherited

◆ view()

AlbumTreeView * Digikam::AlbumTreeViewSelectComboBox::view ( ) const

Member Data Documentation

◆ m_comboLineEdit

QLineEdit* Digikam::TreeViewLineEditComboBox::m_comboLineEdit
protectedinherited

◆ m_currentIndex

◆ m_treeView

◆ m_view


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