Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.0
-
None
-
d19c9cfd29bcb3c8fb8108bbcb29d71be19711f5
Description
there is currently QMenu::hideTearOffMenu() function but no matching showTearOffMenu(QPoint) to do an initial tear off at a location
in qmenu.cpp
/*! This function will forcibly show the torn off menu making it appear on the users desktop. \sa hideTearOffMenu() isTearOffMenuVisible() isTearOffEnabled() */ void QMenu::showTearOffMenu(QPoint *pos) { if (!d_func()->tornPopup) d_func()->tornPopup = new QTornOffMenu(this); QSize s = sizeHint(); QPoint p; if(NULL != pos) { p.setX(pos->x()); p.setY(pos->y()); } else { p = QCursor::pos(); } d_func()->tornPopup->setGeometry(p.x(), p.y(), s.width(), s.height()); d_func()->tornPopup->show(); }
and added qmenu.h
void showTearOffMenu(QPoint *pos=0);