[Interest] ctrl+c in a read-only QTextEdit

Alexander Semke alexander.semke at web.de
Sat Apr 29 20:32:05 CEST 2017


In a read-only QTextEdit a CTRL+C event seems to be "converted" to a close event. CTRL+C in a read-only QTextEdit placed in QDockWidget closes the current MDI subwindow (https://bugs.kde.org/show_bug.cgi?id=379102):


#0  PartMdiView::closeEvent (this=0xef0fa0, event=0x7fffffffd0f0) at /home/alex/Projekte/labplot/src/commonfrontend/core/PartMdiView.cpp:80 
#1  0x00007fffeda1f028 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#2  0x00007fffedb3359b in QMdiSubWindow::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#3  0x00007fffed9db21c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#4  0x00007fffed9e21a0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#5  0x00007fffec9da005 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5 
#6  0x00007fffeda19e23 in QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) () from /usr/lib64/libQt5Widgets.so.5 
#7  0x00007fffedb2569d in ?? () from /usr/lib64/libQt5Widgets.so.5 
#8  0x00007fffeca01f55 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5 
#9  0x00007fffed9d4ae2 in QAction::triggered(bool) () from /usr/lib64/libQt5Widgets.so.5 
#10 0x00007fffed9d74bd in QAction::activate(QAction::ActionEvent) () from /usr/lib64/libQt5Widgets.so.5 
#11 0x00007fffed9d7684 in QAction::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#12 0x00007fffed9db21c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#13 0x00007fffed9e21a0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5 
#14 0x00007fffec9da005 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5 
#15 0x00007fffed2a213f in QShortcutMap::dispatchEvent(QKeyEvent*) () from /usr/lib64/libQt5Gui.so.5 
#16 0x00007fffed2a2204 in QShortcutMap::tryShortcut(QKeyEvent*) () from /usr/lib64/libQt5Gui.so.5 
#17 0x00007fffed25f4eb in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) () from /usr/lib64/libQt5Gui.so.5 
#18 0x00007fffed273c87 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /usr/lib64/libQt5Gui.so.5 
#19 0x00007fffed278635 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib64/libQt5Gui.so.5 
#20 0x00007fffed25a75b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Gui.so.5 
#21 0x00007fffdf8b1810 in ?? () from /usr/lib64/libQt5XcbQpa.so.5 
#22 0x00007fffe68b7c84 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0 
#23 0x00007fffe68b7ed8 in ?? () from /usr/lib64/libglib-2.0.so.0 
#24 0x00007fffe68b7f7c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0 
#25 0x00007fffeca289cc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5 
#26 0x00007fffec9d82db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5 
#27 0x00007fffec9e00d6 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5

Installing an event filter for TextEdit with the special handling for QKeyFrequence::Copy will probably help here. But what is the reason for this? How can I avoid this behavior? This doesn't happen if I set read-only to false.



-- 
Alexander



More information about the Interest mailing list