digiKam
|
Public Member Functions | |
QModelIndex | currentIndex () const |
void | hidePopup () override |
void | installView (QAbstractItemView *view=nullptr) override |
void | setCurrentIndex (const QModelIndex &index) |
void | setLineEdit (QLineEdit *edit) |
void | setLineEditText (const QString &text) |
void | showPopup () override |
TreeViewLineEditComboBox (QWidget *const parent=nullptr) | |
QTreeView * | view () const |
Protected Member Functions | |
bool | eventFilter (QObject *watched, QEvent *event) override |
virtual void | installLineEdit () |
void | sendViewportEventToView (QEvent *e) override |
Protected Attributes | |
QLineEdit * | m_comboLineEdit |
QPersistentModelIndex | m_currentIndex |
QAbstractItemView * | m_view |
|
explicit |
This class provides a TreeViewComboBox with a read-only line edit. The text in the line edit can be adjusted. The combo box will open on a click on the line edit. 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.
|
inherited |
References Digikam::ModelIndexBasedComboBox::m_currentIndex.
Referenced by Digikam::AddTagsComboBox::setCurrentTag().
|
overrideprotectedinherited |
References Digikam::StayPoppedUpComboBox::m_view, and Digikam::StayPoppedUpComboBox::sendViewportEventToView().
Referenced by Digikam::AddTagsComboBox::eventFilter().
|
overrideinherited |
References Digikam::ModelIndexBasedComboBox::m_currentIndex.
Referenced by Digikam::AlbumSelectComboBox::hidePopup().
|
protectedvirtual |
Sets a line edit. Called by installView(). The default implementation is described above. An empty implementation will keep the default QComboBox line edit.
References m_comboLineEdit, and setLineEdit().
Referenced by installView().
|
overridevirtual |
Replace the standard combo box list view with a QTreeView. Call this after installing an appropriate model.
Reimplemented from Digikam::TreeViewComboBox.
References installLineEdit(), Digikam::TreeViewComboBox::installView(), and Digikam::TreeViewComboBox::view().
Referenced by Digikam::AlbumSelectComboBox::installView().
|
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.
|
inherited |
References Digikam::ModelIndexBasedComboBox::m_currentIndex.
Referenced by Digikam::RatingComboBox::ratingWidgetChanged(), and Digikam::RatingComboBox::setRatingValue().
void Digikam::TreeViewLineEditComboBox::setLineEdit | ( | QLineEdit * | edit | ) |
References m_comboLineEdit.
Referenced by Digikam::AddTagsComboBox::AddTagsComboBox(), and installLineEdit().
void Digikam::TreeViewLineEditComboBox::setLineEditText | ( | const QString & | text | ) |
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 m_comboLineEdit.
Referenced by Digikam::AlbumSelectComboBox::updateText().
|
overrideinherited |
References Digikam::ModelIndexBasedComboBox::m_currentIndex.
Referenced by Digikam::ChoiceSearchComboBox::labelClicked().
|
inherited |
Returns the QTreeView of this class. Valid after installView() has been called
References Digikam::StayPoppedUpComboBox::m_view.
Referenced by Digikam::TreeViewComboBox::installView(), Digikam::AlbumSelectComboBox::installView(), Digikam::AbstractAlbumTreeViewSelectComboBox::installView(), installView(), and Digikam::AlbumSelectComboBox::setDefaultAlbumModel().
|
protected |
Referenced by installLineEdit(), setLineEdit(), and setLineEditText().
|
protectedinherited |
|
protectedinherited |
Referenced by Digikam::StayPoppedUpComboBox::eventFilter(), Digikam::StayPoppedUpComboBox::installView(), Digikam::TreeViewComboBox::sendViewportEventToView(), Digikam::ListViewComboBox::sendViewportEventToView(), Digikam::StayPoppedUpComboBox::StayPoppedUpComboBox(), Digikam::TreeViewComboBox::view(), and Digikam::ListViewComboBox::view().