Qt World Summit: Submit your Presentation

The activated() signal is not emitted by a editable QComboBox

  • Hi,

    I have a strange problem with the QComboBox when I set it to editable it doesn’t emit the activated() signal when the user selects an item in the ComboBox list.

    But if I change the property so that it is not editable the activated() signal is emitted.

    I’m using Qt version 4.7.1 cross-compiled for an ARM cortex A8 platform.

    But if I setup a test program on my windows machine with a ComboBox the activated() signal is emitted even if I set the ComboBox to editable.

    Does anyone know how to solve this problem?


  • Just thinking to what you have wrote, maybe a problem of focus setting ?

  • Thanks for your replay

    I have tested changing the focusPolicy parameter to all available policy’s but the activated() signal is not emitted for any of the settings. I get the editTextChanged() signal when scrolling between items in the ComboBox list but not the activated() after selecting an item in the list.

    But if I set the ComboBox from editable to not editable and leave all other settings as they are then the activated() signal is emitted. It seems like the activated() signal has something to do with the editable property. But as I understand it I should get both the editTextChanged() and activated() signals in editable mode, and that’s how it works under Windows.

  • Take a look with your code searching in qt bug. If possible post a piece of code. Instead, I have seen that there are a lot of problems in QCombo with signals and editable / non-editable conditions.

    If possible create your own signal and manage it as needed. If it works it maybe a bug.

    P.S. Why not to move to further version than 4.7.1? I know that the beta 4.7.8 has a lot of this problems solved for the version of Qt anywhere

  • I performed a test yesterday where I copied the widget with the ComboBox out from our project to a new empty project and started it on our unit. For that program the activated() signal is emitted when an item is selected in the ComboBox list. It is not emitted if I reselect an already selected item as it should according to the doc but this is good enough for our needs.

    So it seems that there is something in our project which prevents the signal from being emitted. But I don't understand what that could be. Do you have any suggestions?

Log in to reply