Bug 173071 - Crash at KTextEdit::mousePopupMenu() when using setTextInteractionFlags(Qt::NoTextInteraction)
Summary: Crash at KTextEdit::mousePopupMenu() when using setTextInteractionFlags(Qt::N...
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: 4.1
Platform: openSUSE Unspecified
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-18 00:07 UTC by Philipp Wagner
Modified: 2008-11-26 15:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Wagner 2008-10-18 00:07:03 UTC
Version:            (using KDE 4.1.2)
Installed from:    SuSE RPMs

If you have a KTextEdit created like that:

KTextEdit *kte = new KTextEdit(this);
kte->setTextInteractionFlags(Qt::NoTextInteraction);

and then right-click on the edit field, the method KTextEdit::mousePopupMenu() gets called (http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/ktextedit_8cpp-source.html#l00394)

By defining that we want no interaction, Qt returns a NP at createStandardContextMenu();

The application crashes when calling connect():

QObject::connect: Cannot connect (null)::triggered ( QAction* ) to KTextEdit::menuActivated( QAction* )

I don't have a recent SVN checkout here to provide a patch, but it should be done with a simple check for a NP.
Comment 1 FiNeX 2008-11-19 20:25:54 UTC
Changed severity to "crash". I hope to have selected only the right bugs (>100) :-)
Comment 2 Rob Buis 2008-11-26 15:26:36 UTC
SVN commit 889338 by buis:

createStandardContextMenu can return 0 when Qt::NoTextInteraction flag is set, so
do not crash on that.
BUG: 173071


 M  +5 -2      ktextedit.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=889338