Unsolved QComboBox Does Not Display Current Text in UI When a Non-Default Value is Selected
-
I am developing a UWP application for Windows 10 using Qt for UWP.
One of the UI elements in my application is a QComboBox. The application's logic and the corresponding UI works as expected when the default value (text) is not changed.
However, when I select a different value from the drop-down list, the selected value is not displayed once the drop-down list closes. The box still shows the default value (text). But when I observe the value received by
currentIndex
, it corresponds to the selected value. Whenever I select a non-default value, the UI seems to be blocked. I cannot interact with any other UI elements except the QComboBox element.Has anyone faced this problem before? How do I ensure that the current selected values is displayed in the QComboBox?
UPDATE:
I built a demo application to check the
QComboBox
functionality on its own and I see the same behavior. I just added a few items to theQComboBox
widget and built the application with both msvc2017_64 and winrt_x64_msvc2017 of Qt 5.14.1.When I launch the app that was build using msvc2017_64, I get a window with the
QComboBox
widget. When I select a value, that value is displayed when the drop-down menu closes.However, when this is not the case with the UWP application that I build with winrt_x64_msvc2017. It does not show me the updated value. It stays stuck at the default value.
Another problem that I observed in my original UWP app was that whenever I click on the
QComboBox
and select a value, I do not get control of the UI back. Everything in the UI is stuck but whichever button I click is emitting the signal in the background. The UI does not respond at all.I was tinkering around trying to understand what was causing this behavior. During this process, I stumbled upon a workaround to get the UI to respond again. If I launch a
QMessageBox
within theQComboBox
'scurrentTextChanged
signal, I get the UI control back (thecurrentText
changes to the value that I previously selected) when I press OK on theQMessageBox
pop-up.I do not understand why this workaround gives me back control of the UI and gets things working. Please help me understand this.
-
@vb0987 said in QComboBox Does Not Display Current Text in UI When a Non-Default Value is Selected:
Whenever I select a non-default value, the UI seems to be blocked
Does your application do anything special when you select values in this combo box?
-
No. In my original application, I connected
currentIndexChanged()
to a function that just disables other widgets, updates some local variables and unblocks the widgets.I built a demo application to check the
QComboBox
functionality on its own and I see the same behavior. I just added a few items to the QComboBox widget and built the application with both msvc2017_64 and winrt_x64_msvc2017 of Qt 5.14.1.When I launch the app that was build using msvc2017_64, I get a window with the
QComboBox
widget. When I select a value, that value is displayed when the drop-down menu closes.However, when this is not the case with the UWP application that I build with winrt_x64_msvc2017. It does not show me the updated value. It stays stuck at the default value.
Another problem that I observed in my original UWP app was that whenever I click on the
QComboBox
and select a value, I do not get control of the UI back. Everything in the UI is stuck but whichever button I click is emitting the signal in the background. The UI does not respond at all. -