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);
Attachments
For Gerrit Dashboard: QTBUG-47974 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
150650,4 | QMenu: Add showTearOffMenu() | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
152434,4 | MDI example: use tear-off menus; save and restore their positions | 5.7 | qt/qtbase | Status: DEFERRED | -2 | 0 |