![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
This widget is a QComboBox, but then a little bit different. More...
Signals | |
void | signalItemActivated (const QString &) |
Public Member Functions | |
SqueezedComboBox (QWidget *const parent=nullptr, const char *name=nullptr) | |
Constructor. | |
~SqueezedComboBox () override | |
destructor | |
void | addSqueezedItem (const QString &newItem, const QVariant &userData=QVariant()) |
Append an item. | |
bool | contains (const QString &text) const |
Returns true if the combobox contains the original (not-squeezed) version of text. | |
int | 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. | |
void | insertSqueezedItem (const QString &newItem, int index, const QVariant &userData=QVariant()) |
This inserts a item to the list. | |
void | insertSqueezedList (const QStringList &newItems, int index) |
This inserts items to the list. | |
QString | item (int index) const |
This method returns the full text (not squeezed) for the index. | |
QString | itemHighlighted () const |
This method returns the full text (not squeezed) of the currently highlighted item. | |
void | setCurrent (const QString &itemText) |
Set the current item to the one matching the given text. | |
QSize | sizeHint () const override |
Sets the sizeHint() of this widget. | |
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 |
parent | the parent widget |
name | the name to give to the widget |
void Digikam::SqueezedComboBox::addSqueezedItem | ( | const QString & | newItem, |
const QVariant & | userData = QVariant() |
||
) |
newItem | the original (long version) of the item which needs to be added to the combobox |
userData | custom meta-data assigned to new item. |
bool Digikam::SqueezedComboBox::contains | ( | const QString & | text | ) | const |
text | the original (not-squeezed) text to check for |
int Digikam::SqueezedComboBox::findOriginalText | ( | const QString & | text, |
Qt::CaseSensitivity | cs = Qt::CaseSensitive |
||
) | const |
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() |
||
) |
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. |
void Digikam::SqueezedComboBox::insertSqueezedList | ( | const QStringList & | newItems, |
int | index | ||
) |
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. |
QString Digikam::SqueezedComboBox::item | ( | int | index | ) | const |
index | the position in the widget. |
QString Digikam::SqueezedComboBox::itemHighlighted | ( | ) | const |
void Digikam::SqueezedComboBox::setCurrent | ( | const QString & | itemText | ) |
itemText | the original (long version) of the item text |