0

The following "problem": I have a ComboBox in Qt with entries - let's say - ['one', 'two', 'three']. When I look in the window, the first choice 'one' is choosen. I don't need to change and click on the box to change it. So ".clicked.connect" or ".activated.connect" doesn't make sense. I tried it. Instead of creating a "dummy" field like 'choose' in the list ['choose', 'one', 'two', 'three'], it would be good it I could say: If NOTHING is clicked or activated or changed (so: just the first standard choice 'one'), use this or that slot.

How could I realize it? I didn't find this question, so I am sorry if some question like this exists but I didn't see it.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Markus
  • 101
  • 1
  • 7
  • mmm, explain yourself better please. – eyllanesc Jan 11 '20 at 17:09
  • Slots are triggered when a signal they are connected to is emitted. If nothing changes, how would your widget know when to emit a signal? – Heike Jan 12 '20 at 17:21
  • @Heike The widget should know the standard choice that exists when it is created. You know a ComboBox? You have choices [A, B, C, D] and not necessary ["please choose:", A, B, C, D] so that you HAVE to click to choose between A, B, C, D. If you just call the entries [A, B, C, D] then 'A' is choosen by default, so a "clicking" or "activating" or "change" is not carried out. And then the other widget didn't get the information. I choose a workaround now so I initiated another class with 'A', so that this is some kind of 'standard' and then it works. Bedankt for u medewerking. ;-) – Markus Jan 15 '20 at 10:19

0 Answers0