src/hbcore/gui/hbpopupmanager.cpp
changeset 21 4633027730f5
parent 6 c3690ec91ef8
child 23 e6ad4ef83b23
--- a/src/hbcore/gui/hbpopupmanager.cpp	Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbcore/gui/hbpopupmanager.cpp	Wed Aug 18 10:05:37 2010 +0300
@@ -45,9 +45,7 @@
 HbPopupLayoutSpacer::HbPopupLayoutSpacer( QGraphicsItem *parent )
 : HbWidgetBase( parent )
 {
-#if QT_VERSION >= 0x040600
     setFlag(QGraphicsItem::ItemHasNoContents, true);
-#endif
     setAcceptedMouseButtons(Qt::NoButton);
 }
 
@@ -61,23 +59,10 @@
     return QSizeF(0.f,0.f);
 }
 
-/*
-\reimp
-*/
-void HbPopupLayoutSpacer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget )
-{
-    Q_UNUSED(option)
-    Q_UNUSED(widget);
-    Q_UNUSED(painter);
-}
-
-
 HbPopupLayoutProxy::HbPopupLayoutProxy( HbPopup *popup, QGraphicsItem *parent )
 : HbWidgetBase(parent), mPopup(popup)
 {
-#if QT_VERSION >= 0x040600
     setFlag(QGraphicsItem::ItemHasNoContents, true);
-#endif
     setAcceptedMouseButtons(Qt::NoButton);
     popup->installEventFilter(this);
 }
@@ -195,25 +180,15 @@
     return false;
 }
 
-
-/*
-\reimp
-*/
-void HbPopupLayoutProxy::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget )
-{
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-    Q_UNUSED(painter);
-}
-
 HbPopupLayoutManager::HbPopupLayoutManager( HbPopup *popup, QGraphicsScene *scene ) 
 : HbWidget()
 {        
-#if QT_VERSION >= 0x040600
     setFlag(QGraphicsItem::ItemHasNoContents, true);
-#endif
     setAcceptedMouseButtons(Qt::NoButton);
     scene->addItem( this );
+    //adjust the size of popuplayoutmanager to its preferredSize
+    //since it defines the geometries of popups.
+    adjustSize();
 
     // create proxy
     HbPopupLayoutProxy *childItem = new HbPopupLayoutProxy( popup, this );
@@ -276,16 +251,6 @@
 
 }
 
-/*
-\reimp
-*/
-void HbPopupLayoutManager::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget )
-{
-    Q_UNUSED(option)
-    Q_UNUSED(widget);
-    Q_UNUSED(painter);
-}
-
 
 /*
     \class HbPopupManagerPrivate