https://bugs.kde.org/show_bug.cgi?id=347045

Thomas Karpiniec <t...@1.21jiggawatts.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |t...@1.21jiggawatts.net

--- Comment #8 from Thomas Karpiniec <t...@1.21jiggawatts.net> ---
I've tracked this down to this connection in `KCheckComboBox`:
https://invent.kde.org/pim/libkdepim/-/blob/master/src/widgets/kcheckcombobox.cpp#L122

    connect(this, &QComboBox::activated, this, [this]() {
        d->toggleCheckState();
    });

The idea is that the `activated` signal will fire when the user clicks on an
item in the list, so its check state should be toggled. The problem is that
this signal is _also_ firing when you first click the drop-down. I tested a
hack that swallows the first `activated` event after `showPopup()` and this
made it work correctly.

This doesn't appear to be normal behaviour for QComboBox which makes me wonder
if we have the signal connected somewhere else and causing problems. I captured
the following backtrace but haven't quite figured out where this is coming from
yet:

#0  KPIM::KCheckComboBox::KCheckComboBoxPrivate::toggleCheckState
(this=0x12ccc90) at
/home/tk/kde/src/libkdepim/src/widgets/kcheckcombobox.cpp:113
#1  0x00007ffff4f25232 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc170,
r=0x12cc800, this=0x12cccf0) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#2  doActivate<false> (sender=0x12cc800, signal_index=8, argv=0x7fffffffc170)
at kernel/qobject.cpp:3923
#3  0x00007ffff4f1de2f in QMetaObject::activate (sender=sender@entry=0x12cc800,
m=m@entry=0x7ffff60c25c0 <QComboBox::staticMetaObject>,
local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffc170)
at kernel/qobject.cpp:3983
#4  0x00007ffff5ca8a91 in QComboBox::activated (this=this@entry=0x12cc800,
_t1=<optimized out>) at .moc/moc_qcombobox.cpp:510
#5  0x00007ffff5caa23e in QComboBoxPrivate::emitActivated
(this=this@entry=0x12cc840, index=...) at
../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:62
#6  0x00007ffff5caf322 in QComboBoxPrivate::_q_editingFinished (this=0x12cc840)
at widgets/qcombobox.cpp:1358
#7  0x00007ffff4f251d3 in doActivate<false> (sender=0x12cd930, signal_index=11,
argv=0x7fffffffc2d0) at kernel/qobject.cpp:3935
#8  0x00007ffff4f1de2f in QMetaObject::activate (sender=sender@entry=0x12cd930,
m=m@entry=0x7ffff60c5b20 <QLineEdit::staticMetaObject>,
local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x0) at
kernel/qobject.cpp:3983
#9  0x00007ffff5ceafd3 in QLineEdit::editingFinished
(this=this@entry=0x12cd930) at .moc/moc_qlineedit.cpp:473
#10 0x00007ffff5cf1d61 in QLineEdit::focusOutEvent (this=0x12cd930,
e=0x7fffffffc530) at widgets/qlineedit.cpp:1959
#11 0x00007ffff5be6ee0 in QWidget::event (this=0x12cd930, event=0x7fffffffc530)
at kernel/qwidget.cpp:8793
#12 0x00007ffff5be6ee0 in QWidget::event (this=0x12cc800, event=0x7fffffffc530)
at kernel/qwidget.cpp:8793
#13 0x00007ffff5ba51ae in QApplicationPrivate::notify_helper (this=<optimized
out>, receiver=0x12cc800, e=0x7fffffffc530) at kernel/qapplication.cpp:3640
#14 0x00007ffff4eec978 in QCoreApplication::notifyInternal2
(receiver=0x12cc800, event=0x7fffffffc530) at kernel/qcoreapplication.cpp:1064
#15 0x00007ffff5baa160 in QApplicationPrivate::openPopup (this=<optimized out>,
popup=<optimized out>, popup@entry=0x12cf790) at kernel/qapplication.cpp:3767
#16 0x00007ffff5be3ab0 in QWidgetPrivate::show_helper
(this=this@entry=0x12d4aa0) at kernel/qwidget.cpp:7844
#17 0x00007ffff5be6823 in QWidgetPrivate::setVisible (this=0x12d4aa0,
visible=<optimized out>) at kernel/qwidget.cpp:8137
#18 0x00007ffff5cb034e in QComboBox::showPopup (this=0x12cc800) at
widgets/qcombobox.cpp:2953
#19 0x00007ffff5cb10de in QComboBoxPrivate::showPopupFromMouseEvent
(this=0x12cc840, e=<optimized out>) at widgets/qcombobox.cpp:3303
#20 0x00007ffff5be6d78 in QWidget::event (this=0x12cc800, event=0x7fffffffcd50)
at kernel/qwidget.cpp:9045
#21 0x00007ffff5ba51ae in QApplicationPrivate::notify_helper
(this=this@entry=0x435230, receiver=receiver@entry=0x12cc800,
e=e@entry=0x7fffffffcd50) at kernel/qapplication.cpp:3640
#22 0x00007ffff5bad5df in QApplication::notify (this=<optimized out>,
receiver=<optimized out>, e=0x7fffffffcd50) at kernel/qapplication.cpp:3084
#23 0x00007ffff4eec978 in QCoreApplication::notifyInternal2
(receiver=0x12cc800, event=0x7fffffffcd50) at kernel/qcoreapplication.cpp:1064
#24 0x00007ffff5bab93e in QApplicationPrivate::sendMouseEvent
(receiver=receiver@entry=0x12cc800, event=event@entry=0x7fffffffcd50,
alienWidget=<optimized out>, nativeWidget=0x7fffe0003430,
buttonDown=buttonDown@entry=0x7ffff60f2330 <qt_button_down>,
lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at
kernel/qapplication.cpp:2622
#25 0x00007ffff5bff80d in QWidgetWindow::handleMouseEvent (this=0x18dd660,
event=0x7fffffffd000) at kernel/qwidgetwindow.cpp:684
#26 0x00007ffff5c02d2f in QWidgetWindow::event (this=0x18dd660,
event=0x7fffffffd000) at kernel/qwidgetwindow.cpp:300
#27 0x00007ffff5ba51ae in QApplicationPrivate::notify_helper (this=<optimized
out>, receiver=0x18dd660, e=0x7fffffffd000) at kernel/qapplication.cpp:3640
#28 0x00007ffff4eec978 in QCoreApplication::notifyInternal2
(receiver=0x18dd660, event=0x7fffffffd000) at kernel/qcoreapplication.cpp:1064
#29 0x00007ffff537c9cb in
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)
() from /lib64/libQt5Gui.so.5
#30 0x00007ffff53500fc in
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib64/libQt5Gui.so.5
#31 0x00007ffff0f1a16a in ?? () from /lib64/libQt5XcbQpa.so.5
#32 0x00007ffff25168d8 in g_main_context_dispatch () from
/lib64/libglib-2.0.so.0
#33 0x00007ffff2516ce8 in ?? () from /lib64/libglib-2.0.so.0
#34 0x00007ffff2516d7c in g_main_context_iteration () from
/lib64/libglib-2.0.so.0
#35 0x00007ffff4f45f26 in QEventDispatcherGlib::processEvents (this=0x51f140,
flags=...) at kernel/qeventdispatcher_glib.cpp:423
#36 0x00007ffff4eeb40b in QEventLoop::exec (this=this@entry=0x7fffffffd330,
flags=..., flags@entry=...) at
../../include/QtCore/../../src/corelib/global/qflags.h:69
#37 0x00007ffff4ef38a0 in QCoreApplication::exec () at
../../include/QtCore/../../src/corelib/global/qflags.h:121
#38 0x000000000040b6a7 in main (argc=<optimized out>, argv=<optimized out>) at
/home/tk/kde/src/korganizer/src/main.cpp:72

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to