digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::SqueezedComboBox Class Reference

This widget is a QComboBox, but then a little bit different. More...

+ Inheritance diagram for Digikam::SqueezedComboBox:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SqueezedComboBox()

Digikam::SqueezedComboBox::SqueezedComboBox ( QWidget *const  parent = nullptr,
const char *  name = nullptr 
)
explicit
Parameters
parentthe parent widget
namethe name to give to the widget

Member Function Documentation

◆ addSqueezedItem()

void Digikam::SqueezedComboBox::addSqueezedItem ( const QString &  newItem,
const QVariant &  userData = QVariant() 
)
Parameters
newItemthe original (long version) of the item which needs to be added to the combobox
userDatacustom meta-data assigned to new item.

◆ contains()

bool Digikam::SqueezedComboBox::contains ( const QString &  text) const
Parameters
textthe original (not-squeezed) text to check for

◆ findOriginalText()

int Digikam::SqueezedComboBox::findOriginalText ( const QString &  text,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const
Parameters
textthe original (not-squeezed) text to find for
cscase sensitive or case insensitive search

◆ insertSqueezedItem()

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.

Parameters
newItemthe original (long version) of the item which needs to be added to the combobox
indexthe position in the widget.
userDatacustom meta-data assigned to new item.

◆ insertSqueezedList()

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.

Parameters
newItemsthe originals (long version) of the items which needs to be added to the combobox
indexthe position in the widget.

◆ item()

QString Digikam::SqueezedComboBox::item ( int  index) const
Parameters
indexthe position in the widget.
Returns
full text of the item

◆ itemHighlighted()

QString Digikam::SqueezedComboBox::itemHighlighted ( ) const
Returns
full text of the highlighted item

◆ setCurrent()

void Digikam::SqueezedComboBox::setCurrent ( const QString &  itemText)
Parameters
itemTextthe original (long version) of the item text