![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Public Member Functions | |
TreeViewLineEditComboBox (QWidget *const parent=nullptr) | |
This class provides a TreeViewComboBox with a read-only line edit. | |
void | installView (QAbstractItemView *view=nullptr) override |
Replace the standard combo box list view with a QTreeView. | |
void | setLineEdit (QLineEdit *edit) |
void | setLineEditText (const QString &text) |
Set the text of the line edit (the text that is visible if the popup is not opened). | |
![]() | |
TreeViewComboBox (QWidget *parent=nullptr) | |
This class provides a QComboBox with a QTreeView instead of the usual QListView. | |
virtual QTreeView * | view () const |
Returns the QTreeView of this class. | |
![]() | |
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. | |
![]() | |
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 | |
virtual void | installLineEdit () |
Sets a line edit. | |
![]() | |
void | sendViewportEventToView (QEvent *e) override |
Implement in subclass: Send the given event to the viewportEvent() method of m_view. | |
![]() | |
bool | eventFilter (QObject *watched, QEvent *event) override |
void | installView (QAbstractItemView *view) |
Replace the standard combo box list view with the given view. | |
Protected Attributes | |
QLineEdit * | m_comboLineEdit = nullptr |
![]() | |
QAbstractItemView * | m_view = nullptr |
![]() | |
QPersistentModelIndex | m_currentIndex |
|
explicit |
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.
|
protectedvirtual |
Called by installView(). The default implementation is described above. An empty implementation will keep the default QComboBox line edit.
|
overridevirtual |
Call this after installing an appropriate model.
Reimplemented from Digikam::TreeViewComboBox.
void Digikam::TreeViewLineEditComboBox::setLineEditText | ( | const QString & | text | ) |
Applicable only for default installLineEdit() implementation.