diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2010-03-03 16:25:07 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2010-03-03 16:26:40 (GMT) |
commit | c7f2181a25243ed07f1406c7023dfdd5fb75d77d (patch) | |
tree | f969ba6296fa6eb597140c975082934f33d07911 | |
parent | b489394e695f78d78db9bf08bc985219f8fb9bb2 (diff) | |
download | Qt-c7f2181a25243ed07f1406c7023dfdd5fb75d77d.zip Qt-c7f2181a25243ed07f1406c7023dfdd5fb75d77d.tar.gz Qt-c7f2181a25243ed07f1406c7023dfdd5fb75d77d.tar.bz2 |
Make sure not to crash if createStandardContextMenu() returns 0 (e.g. on Maemo5)
Reviewed-by: Harald Fernengel
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 0ba8b9f..595f552 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2038,9 +2038,10 @@ void QLineEdit::dropEvent(QDropEvent* e) */ void QLineEdit::contextMenuEvent(QContextMenuEvent *event) { - QMenu *menu = createStandardContextMenu(); - menu->setAttribute(Qt::WA_DeleteOnClose); - menu->popup(event->globalPos()); + if (QMenu *menu = createStandardContextMenu()) { + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->popup(event->globalPos()); + } } #if defined(Q_WS_WIN) |