krita/ui

SqueezedComboBox Class Reference

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

#include <squeezedcombobox.h>

Inheritance diagram for SqueezedComboBox:

List of all members.

Public Member Functions

 SqueezedComboBox (QWidget *parent=0, const char *name=0)
virtual ~SqueezedComboBox ()
void addSqueezedItem (const QString &newItem)
bool contains (const QString &text) const
void insertSqueezedItem (const QString &newItem, int index)
QString itemHighlighted ()
void setCurrent (const QString &itemText)
virtual QSize sizeHint () const

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.

squeezedcombobox.png

This is how it looks

Author:
Tom Albers

Definition at line 50 of file squeezedcombobox.h.


Constructor & Destructor Documentation

SqueezedComboBox::SqueezedComboBox ( QWidget parent = 0,
const char *  name = 0 
)

Constructor.

Parameters:
parent parent widget
name name to give to the widget

Definition at line 33 of file squeezedcombobox.cpp.

SqueezedComboBox::~SqueezedComboBox (  )  [virtual]

destructor

Definition at line 48 of file squeezedcombobox.cpp.


Member Function Documentation

void SqueezedComboBox::addSqueezedItem ( const QString newItem  ) 

Append an item.

Parameters:
newItem the original (long version) of the item which needs to be added to the combobox

Definition at line 93 of file squeezedcombobox.cpp.

bool SqueezedComboBox::contains ( const QString text  )  const

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

Parameters:
text the original (not-squeezed) text to check for

Definition at line 54 of file squeezedcombobox.cpp.

void SqueezedComboBox::insertSqueezedItem ( const QString newItem,
int  index 
)

This inserts a item to the list.

See QComboBox::insertItem() for detaills. Please do not use QComboBox::insertItem() to this widget, as that will fail.

Parameters:
newItem the original (long version) of the item which needs to be added to the combobox
index the position in the widget.

Definition at line 83 of file squeezedcombobox.cpp.

QString SqueezedComboBox::itemHighlighted (  ) 

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

Returns:
full text of the highlighted item

Definition at line 148 of file squeezedcombobox.cpp.

void SqueezedComboBox::setCurrent ( const QString itemText  ) 

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

Parameters:
itemText the original (long version) of the item text

Definition at line 98 of file squeezedcombobox.cpp.

QSize SqueezedComboBox::sizeHint (  )  const [virtual]

Sets the sizeHint() of this widget.

Definition at line 68 of file squeezedcombobox.cpp.


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