[Digikam-devel] AdvancedRename syntax highlighting
Marcel Wiesweg
marcel.wiesweg at gmx.de
Fri Nov 20 13:21:57 GMT 2009
> Anyway the actual question is:
> Can you think of a way to bring back the clear button?
Take a look in KDE sources, it will be in KLineEdit iirc.
If KDE can add it to a QLineEdit, then we can add it to a QTextEdit.
>
> Marcel:
> Any idea why the QTextEdit is always overlapping? I needed to set a fixed
> minimum height for the proxyLineEdit to make it work.
Did you try to copy the code from QComboBoxPrivate?
void QComboBoxPrivate::updateLineEditGeometry()
{
if (!lineEdit)
return;
Q_Q(QComboBox);
QStyleOptionComboBox opt;
q->initStyleOption(&opt);
QRect editRect = q->style()->subControlRect(QStyle::CC_ComboBox, &opt,
QStyle::SC_ComboBoxEditField, q);
if (!q->itemIcon(q->currentIndex()).isNull()) {
QRect comboRect(editRect);
editRect.setWidth(editRect.width() - q->iconSize().width() - 4);
editRect = QStyle::alignedRect(q->layoutDirection(), Qt::AlignRight,
editRect.size(), comboRect);
}
lineEdit->setGeometry(editRect);
}
More information about the Digikam-devel
mailing list