File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,17 @@ void ctkMenuButton::mousePressEvent(QMouseEvent *e)
186186{
187187 Q_D (ctkMenuButton);
188188 // we don't want to open the menu if the mouse is clicked anywhere on
189- // the button, only if it's clicked on the indecator
189+ // the button, only if it's clicked on the indicator
190+ #if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
190191 this ->disconnect (this ,SIGNAL (pressed ()), this , SLOT (_q_popupPressed ()));
191192 this ->QPushButton ::mousePressEvent (e);
193+ #else
194+ // Use blockSignals to prevent internal Qt slots from being called
195+ // (disconnecting internal implementation slots does not work in Qt6)
196+ const bool wasBlocked = this ->blockSignals (true );
197+ this ->QPushButton ::mousePressEvent (e);
198+ this ->blockSignals (wasBlocked);
199+ #endif
192200 if (e->isAccepted ())
193201 {
194202 return ;
You can’t perform that action at this time.
0 commit comments