PDA

View Full Version : Small data entry window, not part of the dialog



dan3460
14th September 2017, 20:21
The title may be confusing but this is what i want to do: I have a button on a dialog that when clicked, i want a small window to popup where i can enter a code that is returned back to the calling dialog. I know that i can build a small QT model, with a small data entry and have it close when pressing the enter key. But is there any other way to do this on the fly?

d_stranz
15th September 2017, 02:00
Take a look at QInputDialog. It may not be exactly what you want, but it will do the job with no work on your part except to call it and retrieve the value. Unlike an entry-only window, it does give the ability to cancel the input in an obvious way (by clicking a Cancel button). With a simple window, you'd need to define a custom key sequence (Esc or something) that signifies "cancel this input".