> Ah. In our case, the QLineEdit is inside (and parented by) a widget that
> provides the background of the window. That parent widget can accept
> focus, so I guess our cases are not quite the same.
Ok, good! I thought I missed something. In my case, that is a problem since the
user can click an
Ah. In our case, the QLineEdit is inside (and parented by) a widget that
provides the background of the window. That parent widget can accept focus, so
I guess our cases are not quite the same.
> On Aug 14, 2019, at 9:35 AM, Murphy, Sean wrote:
>
>> I used the QLineEdit focusOutEvent() event.
> I used the QLineEdit focusOutEvent() event.
Can you elaborate on that? Because when I tested yesterday, if the user clicks
on something that does NOT grab focus (for example, any whitespace that exists
in the layout between widgets), the line edit never gets a focusOutEvent().
I need it to w
I used the QLineEdit focusOutEvent() event.
> On Aug 13, 2019, at 1:21 PM, Murphy, Sean wrote:
>
>> Hmm, about that extra step, to remember the filter stuff, since you already
>> have a custom line edit class, why not embed the MouseFilter class inside it?
>> I mean, the filter does not have to
> Hmm, about that extra step, to remember the filter stuff, since you already
> have a custom line edit class, why not embed the MouseFilter class inside it?
> I mean, the filter does not have to reside in MainWindow, it needs only the
> qApp pointer, so you could wire it up in your custom line edi
Hmm, about that extra step, to remember the filter stuff, since you
already have a custom line edit class, why not embed the MouseFilter
class inside it?
I mean, the filter does not have to reside in MainWindow, it needs only
the qApp pointer, so you could wire it up in your custom line edit's
> Hi, had a similar problem, couldn't find any other solution than using an
> event filter, but it turned out being not so bad, made a small class:
>
> In my MainWindow I have an instance of that class, and in MainWindows's
> ctor I initialize it:
>
> MouseFilter mf;
> ...
> mf.setWidget(ui->line
Hi, had a similar problem, couldn't find any other solution than using
an event filter, but it turned out being not so bad, made a small class:
#include "qevent.h"
class MouseFilter : public QObject
{
Q_OBJECT
QWidget* pW; // ptr to widget to check for inside/outside mouse clicks
I'm trying to create a custom QLineEdit where while editing, the user can click
anywhere *outside* the QLineEdit to finish editing.
The default QLineEdit behavior appears to be that once the user has clicked
inside the QLineEdit and begins editing the text, if the user then clicks on
some other