src/hbcore/gui/hbmenu.cpp
changeset 6 c3690ec91ef8
parent 5 627c4a0fd0e7
child 21 4633027730f5
child 34 ed14f46c0e55
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
   485     d->q_ptr = this;
   485     d->q_ptr = this;
   486     d->init();
   486     d->init();
   487     setTitle(title);
   487     setTitle(title);
   488 }
   488 }
   489 
   489 
       
   490 /*!
       
   491     Protected constructor.
       
   492 */
   490 HbMenu::HbMenu(HbMenuPrivate &dd, QGraphicsItem *parent) :
   493 HbMenu::HbMenu(HbMenuPrivate &dd, QGraphicsItem *parent) :
   491         HbPopup(dd, parent)
   494         HbPopup(dd, parent)
   492 {
   495 {
   493     Q_D(HbMenu);
   496     Q_D(HbMenu);
   494     d->q_ptr = this;
   497     d->q_ptr = this;
   673 {
   676 {
   674     menuAction()->setText(title);
   677     menuAction()->setText(title);
   675 }
   678 }
   676 
   679 
   677 /*!
   680 /*!
   678     \return the menu title. For a sub-menu, the title is the sub-menu action text.
   681     Returns the menu title. For a sub-menu, the title is the sub-menu action text.
       
   682 
       
   683     \return the menu title.
   679 
   684 
   680     \sa setTitle()
   685     \sa setTitle()
   681 */
   686 */
   682 QString HbMenu::title() const
   687 QString HbMenu::title() const
   683 {
   688 {
   684     return menuAction()->text();
   689     return menuAction()->text();
   685 }
   690 }
   686 
   691 
   687 /*!
   692 /*!
   688     \return the menu type. By default a menu is a context menu.
   693     Returns the menu type. By default a menu is a context menu.
       
   694 
       
   695     \return the menu type.
   689 */
   696 */
   690 HbMenu::MenuType HbMenu::menuType() const
   697 HbMenu::MenuType HbMenu::menuType() const
   691 {
   698 {
   692     Q_D(const HbMenu);
   699     Q_D(const HbMenu);
   693     return d->menuType;
   700     return d->menuType;
   745     }
   752     }
   746 
   753 
   747     return HbPopup::event(event);
   754     return HbPopup::event(event);
   748 }
   755 }
   749 
   756 
       
   757 /*!
       
   758   \reimp
       
   759   */
   750 void HbMenu::polish(HbStyleParameters &params)
   760 void HbMenu::polish(HbStyleParameters &params)
   751 {
   761 {
   752     Q_D(HbMenu);
   762     Q_D(HbMenu);
   753     const QString NumberOfCols = "number-of-columns";
   763     const QString NumberOfCols = "number-of-columns";
   754     params.addParameter(NumberOfCols);
   764     params.addParameter(NumberOfCols);
   781             }
   791             }
   782         }
   792         }
   783     }
   793     }
   784 }
   794 }
   785 
   795 
       
   796 /*!
       
   797   \reimp
       
   798   Returns the shape of this item as a QPainterPath.
       
   799  */
   786 QPainterPath HbMenu::shape() const
   800 QPainterPath HbMenu::shape() const
   787 {
   801 {
   788     /*QRectF rect = QRectF(-1.0, -1.0, boundingRect().width() + 1.0, boundingRect().height() + 1.0);
   802     /*QRectF rect = QRectF(-1.0, -1.0, boundingRect().width() + 1.0, boundingRect().height() + 1.0);
   789     QRectF clipRect = rect.intersected(mapRectFromParent(QRectF(pos().x() - 1.0, pos().y() - 1.0, size().width() + 1.0, size().height() + 1.0)));
   803     QRectF clipRect = rect.intersected(mapRectFromParent(QRectF(pos().x() - 1.0, pos().y() - 1.0, size().width() + 1.0, size().height() + 1.0)));
   790 
   804