[SOLVED] QCombobox: setCurrentIndex without emit the signal currentIndexChanged?
-
Hey guys,
I have a simple question. How can I set a new index for a QCombobox with setCurrentIndex without emit the signal currentIndexChanged. So I only need to fire the signal on user interaction.
-
Hi,
You can disconnect the signal to slot connection using "disconnect()":http://qt-project.org/doc/qt-5/qobject.html#disconnect ?
And then activate it again by "connect()":http://qt-project.org/doc/qt-5/qobject.html#connect when required. -
Hey thanks for your reply. Disconnecting works but I cant reconnect with signal. I tried it like before:
@connect(combo, SIGNAL(currentIndexChanged( const qint32 &)),this, SLOT (combo_currentIndexChanged (const qint32 &)));@
:(
-
Hi,
There's also "blockSignals":http://qt-project.org/doc/qt-5/qobject.html#blockSignals that you could use.
Hope it helps
-
Great, that's working. Thanks!