[Qt-interest] focusout
jani at wbsources.com
jani at wbsources.com
Mon Sep 5 16:34:22 CEST 2011
You didn't really get the point, maybe I have oversimplified what I want
to do to avoid confusing people. What I want is a custom item delegate
where my editor widget contains two more child widgets like a spinbox and
a combobox. When I double click on an item in QTableView and my delegate
creates the editor (my custom widget) I have to set the focus on the
spinbox to let the user type numbers into it. When the user click outside
the whole editor widget (spinbox and its main widget) I have to detect
focus out somehow. It is not good to install event filter on the spinbox
because if the user clicks on the combobox the spinbox will loose focus,
but the mouse pointer still within the main (container) widget. I can do
what I want differently, but wanted to use custom delegates. Would be nice
to connect spinbox and combobox to the main widget and if the user clicks
outside the main widget not only the spinbox/combobox would lost focus but
the main widget as well...
Another guy has similar problem:
http://developer.qt.nokia.com/forums/viewthread/3860
Thank you for reply.
>
>
> On Mon, 2011-09-05 at 18:54 +0530, jani at wbsources.com wrote:
>> Dear members,
>>
>> I have a main widget and child spinbox on it.
>> I want to filter focus out event only on the main widget.
>> The problem comes when the spinbox has the focus and the user clicks
>> outside the main widget then only spinbox looses focus, but I must
>> monitor
>> only the main widgets' events. Is there a way to link the main widget
>> with
>> the spinbox to detect focus out event on the parent?
>>
> I didnt quite understand what you want to do. But whichever way you want
> to monitor events eventFilter() is your friend.
>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at qt.nokia.com
>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
> --
> Thanks,
> Pritam
>
>
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely
> for the use of the addressee(s). If you are not the intended recipient,
> please
> notify the sender by e-mail and delete the original message. Further, you
> are not
> to copy, disclose, or distribute this e-mail or its contents to any other
> person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys
> has taken
> every reasonable precaution to minimize this risk, but is not liable for
> any damage
> you may sustain as a result of any virus in this e-mail. You should carry
> out your
> own virus checks before opening the e-mail or attachment. Infosys reserves
> the
> right to monitor and review the content of all messages sent to or from
> this e-mail
> address. Messages sent to or from this e-mail address may be stored on the
> Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list