[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: QLineEdit
From:       Scott Wheeler <scott () slackorama ! net>
Date:       2002-02-20 2:05:32
[Download RAW message or body]

Yes, that definitely fixes it for QLineEdit.  I commented out deselect()for 
now.  This fixes things for QLineEdit (and I saw the call for this too), but 
not for QComboBox (We can look at that later.)  

Your question is good.  What should KDE do with the selection when something 
is selected in another app?  It seems that this is inconsistent between apps.  

For instance, if I select something in Konsole and then in KMail my selection 
is removed from the Konsole.  However, if I select something in Konq and then 
go to KMail, my selection in Konq stays.

So, what *should* KDE/Qt do in these situations?  It seems that the problem of 
consistent behavior is bigger than the specific problems with QLineEdit and 
QComboBox.

My first thought on QLineEdit is that maybe there should be two slots, or a 
boolean flag for the slot indicating if the change comes from a different 
application.  Having this called when you change the selection within an app 
just doesn't seem to make any sense.  Or maybe I'm just missing something 
(probably).

Does anyone know why it's set up like this?

-Scott

On Tuesday 19 February 2002 07:08 pm, Mickael Marchand wrote:
> On Tuesday 19 February 2002 21:55, Scott Wheeler wrote:
> > No, that didn't do it for me.  I'm curious where you tracked that from,
> > the only function that it's used for in qlineedit.cpp is insert().  I'll
> > keep looking too.
>
> i think i'm on it now :
> ----------------------------------------
> void QLineEdit::clipboardChanged()
> {
> #if defined(Q_WS_X11)
>     disconnect( QApplication::clipboard(), SIGNAL(dataChanged()),
>         this, SLOT(clipboardChanged()) );
>     disconnect( QApplication::clipboard(), SIGNAL(selectionChanged()),
>         this, SLOT(clipboardChanged()) );
>     deselect();
> #endif
> }
>
> --------------------------------------
> it seems to be caused by this one (confirm ? ;p)
> but it looks correct to remove the selection when you select something in
> another app, so we can't simply remove the deselect() line
> i think there is a wrong signal emit somewhere which causes a call to
> clipboardChanged() ...
>
> if you look into the code you can see :
>     connect( QApplication::clipboard(), SIGNAL(dataChanged()),
>          this, SLOT(clipboardChanged()) );
>     connect( QApplication::clipboard(), SIGNAL(selectionChanged()),
>          this, SLOT(clipboardChanged()) );
> in copy()
>
> dataChanged() is emitted by the clipboard itself
> (kernel/qclipboard_x11.cpp) selectionChanged() is defined in qlineedit and
> emitted quite some times
>
> we need to go deeper in that way i think...
>
> cheers,
> Mik

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic