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

List:       kde-commits
Subject:    extragear/office/kmymoney/kmymoney/widgets
From:       Cristian OneČ› <onet.cristian () gmail ! com>
Date:       2011-05-31 20:15:09
Message-ID: 20110531201509.40D10AC779 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1234361 by conet:

BUG: 262707
On Windows when clicking the popup it seems that it is made the active window which \
causes a FocusOutEvent with the proper reason. So, on Windows, if the focus is lost \
due to a application window activation don't hide the completer.

Also on all version if the focus out reason is window activation don't trigger the \
category creation code this enables the user to switch windows while typing a \
category name.

This bug is yet another reason to port the account combobox to the \
QCombobox-QCompleter mechanism.

 M  +5 -0      kmymoneycombo.cpp  
 M  +5 -0      kmymoneycompletion.cpp  


--- trunk/extragear/office/kmymoney/kmymoney/widgets/kmymoneycombo.cpp \
#1234360:1234361 @@ -231,6 +231,11 @@
 
 void KMyMoneyCombo::focusOutEvent(QFocusEvent* e)
 {
+  // don't do anything if the focus is lost due to window activation, this way \
switching +  // windows while typing a category will not popup the category creation \
dialog +  if (e->reason() == Qt::ActiveWindowFocusReason)
+    return;
+
   if (m_inFocusOutEvent) {
     KComboBox::focusOutEvent(e);
     return;
--- trunk/extragear/office/kmymoney/kmymoney/widgets/kmymoneycompletion.cpp \
#1234360:1234361 @@ -183,7 +183,12 @@
   KMyMoneyCombo *c = dynamic_cast<KMyMoneyCombo*>(m_parent);
   if (o == m_parent || (c && o == c->lineEdit()) || o == this) {
     if (isVisible()) {
+#ifdef Q_OS_WIN32                   //krazy:exclude=cpp 
+      // hide the completer only if the focus was not lost because of windows \
activation or the activated window is not an application window +      if (e->type() \
== QEvent::FocusOut && (static_cast<QFocusEvent*>(e)->reason() != \
Qt::ActiveWindowFocusReason || QApplication::activeWindow() == 0)) { +#else
       if (e->type() == QEvent::FocusOut) {
+#endif
         hide();
       }
       if (e->type() == QEvent::KeyPress) {


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

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