[Qt-interest] Determining Whether Focus is in the Combobox DropDown
Jake Colman
colman at ppllc.com
Thu Oct 7 23:52:29 CEST 2010
>>>>> "GR" == Girish Ramakrishnan <girish at forwardbias.in> writes:
GR> Hi,
GR> On Wed, Oct 6, 2010 at 7:34 PM, Jake Colman <colman at ppllc.com> wrote:
GR> Here's how it's implemented - The QComboBox's popup is a
GR> QAbstractItemView (see QComboBox::view()). The popup's parent is
GR> an internal widget but this widget widget will have the Qt::Popup
GR> window flag. The parent of this internal widget is the QComboBox
GR> itself. Of course, all this is internal and you should not rely
GR> on it :-) So, in your code, you can qobject_cast to
GR> QAbstractItemView and check if it's parentWidget()'s flag has
GR> Qt::Popup and popup-> parentWidget()->parentWidget() is a
GR> QComboBox.
Thanks. I was able to work around it and not have to rely on the
internal representation.
--
Jake Colman | Director, Software Development
Principia Partners LLC
101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
e: colman at ppllc.com | w: www.principiapartners.com
Credit technology innovation awards winner 2008 and 2009
More information about the Qt-interest-old
mailing list