void SqueezedComboBox::slotTimeOut() { for (QMap<int, QString>::iterator it = m_originalItems.begin() ; it != m_originalItems.end(); ++it) { setItemText(it.key(), squeezeText(it.value())); } }
KSqueezeLabel::KSqueezeLabel(const QString &text , QWidget *parent, const char *name) : QLabel(parent) { setObjectName(name); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); m_text = text; squeezeText(); }
void SqueezedComboBox::setCurrent(const QString& itemText) { QString squeezedText = squeezeText(itemText); qint32 itemIndex = findText(squeezedText); if (itemIndex >= 0) { setCurrentIndex(itemIndex); } }
void SqueezedComboBox::insertSqueezedItem(const QString& newItem, int index) { m_originalItems[index] = newItem; QComboBox::insertItem(index, squeezeText(newItem)); // if this is the first item, set the tooltip. if (index == 0) slotUpdateToolTip(0); }
void KSqueezeLabel::setText(const QString &text) { m_text = text; squeezeText(); }
void KSqueezeLabel::resizeEvent(QResizeEvent *) { squeezeText(); }