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

List:       kde-commits
Subject:    branches/KDE/4.1/kdelibs/kdeui/widgets
From:       Rafael Fernández López <ereslibre () kde ! org>
Date:       2008-12-11 22:35:39
Message-ID: 1229034939.125686.9327.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 895893 by ereslibre:

Sorry ! forgot to backport this one to 4.1. This corresponds to commit \
889449 in trunk. Backport fix of a fix =)

CCMAIL: woebbeking@kde.org
CCMAIL: wstephenson@kde.org
CCMAIL: mcguire@kde.org


 M  +7 -15     kcompletionbox.cpp  


--- branches/KDE/4.1/kdelibs/kdeui/widgets/kcompletionbox.cpp \
#895892:895893 @@ -114,7 +114,8 @@
         return false;
     }
 
-    if (wid && (wid->windowFlags() & Qt::Window) && (type == QEvent::Move \
|| type == QEvent::Resize)) { +    if (wid && (wid == d->m_parent || \
wid->windowFlags() & Qt::Window) &&  +               (type == QEvent::Move \
|| type == QEvent::Resize)) {  hide();
         return false;
     }
@@ -201,8 +202,7 @@
                     default:
                         break;
                 }
-            }
-            else if ( type == QEvent::ShortcutOverride ) {
+            } else if ( type == QEvent::ShortcutOverride ) {
                 // Override any accelerators that match
                 // the key sequences we use here...
                 QKeyEvent *ev = static_cast<QKeyEvent *>( e );
@@ -237,13 +237,7 @@
                     default:
                         break;
                 }
-            }
-            // parent gets a click -> we hide
-            else if ( type == QEvent::Resize ||
-                      type == QEvent::Close || type == QEvent::Hide ) {
-                hide();
-            }
-            else if ( type == QEvent::FocusOut ) {
+            } else if ( type == QEvent::FocusOut ) {
                   QFocusEvent* event = static_cast<QFocusEvent*>( e );
                   if (event->reason() != Qt::PopupFocusReason)
                     hide();
@@ -344,14 +338,12 @@
 
 QRect KCompletionBox::calculateGeometry() const
 {
-    if (count() == 0)
+    QRect visualRect;
+    if (count() == 0 || !(visualRect = visualItemRect(item(0))).isValid())
         return QRect();
 
     int x = 0, y = 0;
-
-    Q_ASSERT( visualItemRect(item(0)).isValid() );
-
-    int ih = visualItemRect(item(0)).height();
+    int ih = visualRect.height();
     int h = qMin( 15 * ih, (int) count() * ih ) + 2*frameWidth();
 
     int w = (d->m_parent) ? d->m_parent->width() : \
KListWidget::minimumSizeHint().width();


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

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