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

Public Slots

void hidePopup () override
 
virtual void updateText ()
 

Public Member Functions

 AlbumSelectComboBox (QWidget *const parent=nullptr)
 
QModelIndex currentIndex () const
 
QSortFilterProxyModel * filterModel () const
 
bool isCheckable () const
 
AbstractCheckableAlbumModelmodel () const
 
void setAlbumModels (AbstractCheckableAlbumModel *model, AlbumFilterModel *filterModel=nullptr)
 
void setCheckable (bool checkable)
 
void setCloseOnActivate (bool close)
 
void setCurrentIndex (const QModelIndex &index)
 
void setDefaultAlbumModel ()
 
void setDefaultTagModel ()
 
void setLineEdit (QLineEdit *edit)
 
void setLineEditText (const QString &text)
 
void setNoSelectionText (const QString &text)
 
void setShowCheckStateSummary (bool show)
 
void showPopup () override
 
QTreeView * view () const
 
 ~AlbumSelectComboBox () override
 

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
 
QAbstractItemView * m_view
 

Constructor & Destructor Documentation

◆ AlbumSelectComboBox()

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

References updateText().

◆ ~AlbumSelectComboBox()

Digikam::AlbumSelectComboBox::~AlbumSelectComboBox ( )
override

Member Function Documentation

◆ currentIndex()

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

◆ eventFilter()

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

◆ filterModel()

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

◆ hidePopup

void Digikam::AlbumSelectComboBox::hidePopup ( )
overrideslot

◆ 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::AlbumSelectComboBox::installView ( QAbstractItemView *  view = nullptr)
overrideprotectedvirtual

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

Reimplemented from Digikam::TreeViewComboBox.

Reimplemented in Digikam::AbstractAlbumTreeViewSelectComboBox.

References Digikam::TreeViewLineEditComboBox::installView(), and Digikam::TreeViewComboBox::view().

Referenced by Digikam::AbstractAlbumTreeViewSelectComboBox::installView(), and setAlbumModels().

◆ isCheckable()

bool Digikam::AlbumSelectComboBox::isCheckable ( ) const

◆ model()

◆ sendViewportEventToView()

void Digikam::TreeViewComboBox::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::StayPoppedUpComboBox::m_view.

◆ setAlbumModels()

◆ setCheckable()

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

Enable checkboxes next to the items. Default: true

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

◆ setCloseOnActivate()

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

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 ( )

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, setAlbumModels(), and Digikam::TreeViewComboBox::view().

◆ setDefaultTagModel()

void Digikam::AlbumSelectComboBox::setDefaultTagModel ( )

◆ 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 updateText().

◆ setNoSelectionText()

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

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 updateText().

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

◆ setShowCheckStateSummary()

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

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

References updateText().

◆ showPopup()

void Digikam::ModelIndexBasedComboBox::showPopup ( )
overrideinherited

◆ updateText

void Digikam::AlbumSelectComboBox::updateText ( )
virtualslot

Updates the text describing the selection ("3 Albums selected"). Can be overridden to customize the default text.

References Digikam::TreeViewLineEditComboBox::setLineEditText(), and Digikam::Album::TAG.

Referenced by AlbumSelectComboBox(), hidePopup(), setAlbumModels(), setNoSelectionText(), and setShowCheckStateSummary().

◆ view()

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

Member Data Documentation

◆ m_comboLineEdit

QLineEdit* Digikam::TreeViewLineEditComboBox::m_comboLineEdit
protectedinherited

◆ m_currentIndex

◆ m_view


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