digiKam
Digikam::SqueezedComboBox Class Reference
+ Inheritance diagram for Digikam::SqueezedComboBox:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SqueezedComboBox()

Digikam::SqueezedComboBox::SqueezedComboBox ( QWidget *const  parent = nullptr,
const char *  name = nullptr 
)
explicit

Constructor

Parameters
parentthe parent widget
namethe name to give to the widget

◆ ~SqueezedComboBox()

Digikam::SqueezedComboBox::~SqueezedComboBox ( )
override

destructor

Member Function Documentation

◆ addSqueezedItem()

void Digikam::SqueezedComboBox::addSqueezedItem ( const QString &  newItem,
const QVariant &  userData = QVariant() 
)

Append an item.

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

References insertSqueezedItem().

Referenced by Digikam::IccProfilesComboBox::addProfileSqueezed(), Digikam::IccProfilesComboBox::addProfilesSqueezed(), Digikam::IccProfilesComboBox::setNoProfileIfEmpty(), and Digikam::SearchFieldAlbum::setupValueWidgets().

◆ contains()

bool Digikam::SqueezedComboBox::contains ( const QString &  text) const

Returns true if the combobox contains the original (not-squeezed) version of text.

Parameters
textthe original (not-squeezed) text to check for

◆ findOriginalText()

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.

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() 
)

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.

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.

Referenced by addSqueezedItem(), and insertSqueezedList().

◆ 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.

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

References insertSqueezedItem().

◆ item()

QString Digikam::SqueezedComboBox::item ( int  index) const

This method returns the full text (not squeezed) for the index.

Parameters
indexthe position in the widget.
Returns
full text of the item

◆ itemHighlighted()

QString Digikam::SqueezedComboBox::itemHighlighted ( ) const

This method returns the full text (not squeezed) of the currently highlighted item.

Returns
full text of the highlighted item

◆ setCurrent()

void Digikam::SqueezedComboBox::setCurrent ( const QString &  itemText)

Set the current item to the one matching the given text.

Parameters
itemTextthe original (long version) of the item text

◆ sizeHint()

QSize Digikam::SqueezedComboBox::sizeHint ( ) const
override

Sets the sizeHint() of this widget.


The documentation for this class was generated from the following files: