AdvancedRename syntax highlighting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

AdvancedRename syntax highlighting

Bugzilla from andi.clemens@gmx.net
Hi,

right now I'm trying to add the syntax highlighting widget into the combobox
of AR.
http://farm3.static.flickr.com/2626/4117052691_015bb053cf_o.jpg

The problem: It is a QTextEdit and I see no way how to add the clear button
again.
Why can't Syntax Highlighting be used for QLineEdit anyway, this would make it
so much easier.

Right now I use a ProxyLineEdit, in there a QTextEdit and this is added to a
combobox.

I think the ability to mark tokens is gone now, it is much too complicated to
mark with CTRL and hover over.
I will remove this (sigh, it took me days to implement it correctly ;-)).

Anyway the actual question is:
Can you think of a way to bring back the clear button?

Marcel:
Any idea why the QTextEdit is always overlapping? I needed to set a fixed
minimum height for the proxyLineEdit to make it work.

Andi
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: AdvancedRename syntax highlighting

Marcel Wiesweg

> 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);
}

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: AdvancedRename syntax highlighting

Bugzilla from andi.clemens@gmx.net
Actually it seems to work now, maybe I'm faking it by setting
setAutoFillBackground(false) :-)
In current trunk it looks normal, also under windows.
The only thing that is still annoying is that I'm able to scroll the viewport
a little bit and that I need to use the scrollwheel of the mouse twice to set
a history item from the combobox.

I will check that today...

Andi

On Friday 20 November 2009 14:21:57 Marcel Wiesweg wrote:

> > 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);
> }
>
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel