Пример #1
0
void SqueezedComboBox::slotTimeOut()
{
    for (QMap<int, QString>::iterator it = m_originalItems.begin() ; it != m_originalItems.end();
            ++it) {
        setItemText(it.key(), squeezeText(it.value()));
    }
}
Пример #2
0
KSqueezeLabel::KSqueezeLabel(const QString &text , QWidget *parent, const char *name)
    : QLabel(parent)
{
    setObjectName(name);
    setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    m_text = text;
    squeezeText();
}
Пример #3
0
void SqueezedComboBox::setCurrent(const QString& itemText)
{
    QString squeezedText = squeezeText(itemText);
    qint32 itemIndex = findText(squeezedText);
    if (itemIndex >= 0) {
        setCurrentIndex(itemIndex);
    }
}
Пример #4
0
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);
}
Пример #5
0
void KSqueezeLabel::setText(const QString &text) 
{
    m_text = text;
    squeezeText();
}
Пример #6
0
void KSqueezeLabel::resizeEvent(QResizeEvent *)
{
    squeezeText();
}