digiKam
|
Public Member Functions | |
void | addSqueezedItem (const QString &newItem, const QVariant &userData=QVariant()) |
bool | contains (const QString &text) const |
int | findOriginalText (const QString &text, Qt::CaseSensitivity cs=Qt::CaseSensitive) const |
void | insertSqueezedItem (const QString &newItem, int index, const QVariant &userData=QVariant()) |
void | insertSqueezedList (const QStringList &newItems, int index) |
QString | item (int index) const |
QString | itemHighlighted () const |
void | setCurrent (const QString &itemText) |
QSize | sizeHint () const override |
SqueezedComboBox (QWidget *const parent=nullptr, const char *name=nullptr) | |
~SqueezedComboBox () override | |
This widget is a QComboBox, but then a little bit different. It only shows the right part of the items depending on de size of the widget. When it is not possible to show the complete item, it will be shortened and "..." will be prepended.
|
explicit |
Constructor
parent | the parent widget |
name | the name to give to the widget |
|
override |
destructor
void Digikam::SqueezedComboBox::addSqueezedItem | ( | const QString & | newItem, |
const QVariant & | userData = QVariant() |
||
) |
Append an item.
newItem | the original (long version) of the item which needs to be added to the combobox |
userData | custom meta-data assigned to new item. |
References insertSqueezedItem().
Referenced by Digikam::IccProfilesComboBox::addProfileSqueezed(), Digikam::IccProfilesComboBox::addProfilesSqueezed(), Digikam::IccProfilesComboBox::setNoProfileIfEmpty(), and Digikam::SearchFieldAlbum::setupValueWidgets().
bool Digikam::SqueezedComboBox::contains | ( | const QString & | text | ) | const |
Returns true if the combobox contains the original (not-squeezed) version of text.
text | the original (not-squeezed) text to check for |
int Digikam::SqueezedComboBox::findOriginalText | ( | const QString & | text, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
Returns the index of the combobox if found the original (not-squeezed) version of text.
text | the original (not-squeezed) text to find for |
cs | case sensitive or case insensitive search |
void Digikam::SqueezedComboBox::insertSqueezedItem | ( | const QString & | newItem, |
int | index, | ||
const QVariant & | userData = QVariant() |
||
) |
This inserts a item to the list. See QComboBox::insertItem() for details. Please do not use QComboBox::insertItem() to this widget, as that will fail.
newItem | the original (long version) of the item which needs to be added to the combobox |
index | the position in the widget. |
userData | custom meta-data assigned to new item. |
Referenced by addSqueezedItem(), and insertSqueezedList().
void Digikam::SqueezedComboBox::insertSqueezedList | ( | const QStringList & | newItems, |
int | index | ||
) |
This inserts items to the list. See QComboBox::insertItems() for details. Please do not use QComboBox:: insertItems() to this widget, as that will fail.
newItems | the originals (long version) of the items which needs to be added to the combobox |
index | the position in the widget. |
References insertSqueezedItem().
QString Digikam::SqueezedComboBox::item | ( | int | index | ) | const |
This method returns the full text (not squeezed) for the index.
index | the position in the widget. |
QString Digikam::SqueezedComboBox::itemHighlighted | ( | ) | const |
This method returns the full text (not squeezed) of the currently highlighted item.
void Digikam::SqueezedComboBox::setCurrent | ( | const QString & | itemText | ) |
Set the current item to the one matching the given text.
itemText | the original (long version) of the item text |
|
override |
Sets the sizeHint() of this widget.