src/hbinput/inputwidgets/hbinputcandidatelist.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
--- a/src/hbinput/inputwidgets/hbinputcandidatelist.cpp	Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbinput/inputwidgets/hbinputcandidatelist.cpp	Wed Aug 18 10:05:37 2010 +0300
@@ -82,9 +82,7 @@
       mCandidateCommitted(false),
       mSpellQueryOpenIsPending(false)
 {
-    Q_Q(HbCandidateList);
-
-    mList = new HbListWidget(q);
+    mList = new HbListWidget();
     mList->setEnabledAnimations(HbAbstractItemView::None);
 }
 
@@ -96,10 +94,10 @@
 {
     Q_Q(HbCandidateList);
 
-    mFrameBackground = static_cast<HbFrameItem *>(q->primitive(HbStyle::P_Popup_background));
+    mFrameBackground = static_cast<HbFrameItem *>(q->primitive((HbStyle::Primitive)HbStylePrivate::P_Popup_background));
 
     if (mFrameBackground == 0) {
-        mFrameBackground = static_cast<HbFrameItem *>(q->style()->createPrimitive((HbStyle::Primitive)(HbStyle::P_Popup_background), q));
+        mFrameBackground = static_cast<HbFrameItem *>(HbStylePrivate::createPrimitive(HbStylePrivate::P_Popup_background, q));
     }
 }
 
@@ -171,8 +169,11 @@
     d->setPriority(HbPopupPrivate::VirtualKeyboard + 1);  // Should be shown on top of virtual keyboard.
     d->initFrameIcon();
 
+    d->mList->setParent(this);
+
     // Make sure the preview pane never steals focus.
     setFlag(QGraphicsItem::ItemIsPanel, true);
+    d->mActivePopup = false;
     setActive(false);
 
     setTimeout(NoTimeout);
@@ -200,6 +201,8 @@
 	// Mostly the problem is form Qt side, for the time being to resolve issue related to candidate list
 	// making visible property true.  
     setVisible(true);
+	QEvent event(QEvent::Polish);
+	QApplication::sendEvent(this, &event);
     setContentWidget(d->mList);
 
     d->setPriority(HbPopupPrivate::VirtualKeyboard + 1);  // Should be shown on top of virtual keyboard.
@@ -358,11 +361,11 @@
             freeViewRect.contains(microFocus)) {
             QRectF topRect = freeViewRect;
             topRect.setBottom(microFocus.top());
-            topRect.adjust(HbAutoComplPopupSideMargin, HbAutoComplPopupVerticalMargin, -HbAutoComplPopupSideMargin, -HbAutoComplPopupVerticalMargin);
+            topRect.adjust(HbAutoComplPopupSideMargin, 0, -HbAutoComplPopupSideMargin, 0);
 
             QRectF bottomRect = freeViewRect;
             bottomRect.setTop(microFocus.bottom());
-            bottomRect.adjust(HbAutoComplPopupSideMargin, HbAutoComplPopupVerticalMargin, -HbAutoComplPopupSideMargin, -HbAutoComplPopupVerticalMargin);
+            bottomRect.adjust(HbAutoComplPopupSideMargin, 0, -HbAutoComplPopupSideMargin, 0);
 
             if (topRect.height() > bottomRect.height()) {
                 if (topRect.height() > HbAutoComplPopupMinAllowedHeight) {