[Qt-creator] Passing a value back from a form

Coda Highland coda at bobandgeorge.com
Tue Mar 22 22:32:22 CET 2011


Two things.

First, this mailing list is dedicated to the Qt Creator IDE, not the
Qt toolkit or general C++ language issues. Try qt-interest.

Second, I don't think you understand at all how Qt's supposed to work;
I suggest you work your way through one of the tutorials and the
answer to your problem should make itself pretty clear.

/s/ Adam

On Tue, Mar 22, 2011 at 2:44 PM, Robert Wood
<robert.wood at apostrophe.co.uk> wrote:
> I am trying to create a pop-up window that has a load of JPEGs on it.
> When one of the JEPGs (which is put on a push button) is clicked, I want
> the form to close and a value dependent on which button is pressed
> passed back to the calling form.
>
> I have tried a few things such as making it a dialogue box, but this
> doesn't work as you seem to need to press the OK button. I tried this
> (using a naughty global variable!):
>
>
> // This routine does return the value and close te form
> quint16 config_dialogue::returnConfig(void)
> {
>
>        return RetVal;
>
> }
>
> // This is one of the JPEG buttons; it does set the RetVal to 42
> // but it does not shut the form down and pass the value back
> quint16 config_dialogue::nineGroups(void)
> {
>
>        RetVal = 42;
>        returnConfig();
>
> }
>
> And although I do get 42 back. I still have to press the OK button.
>
> So, is there a way to have a load of buttons on a form and whichever
> button you press it passes a unique number back to the calling form
> please? It doesn't have to be a dialogue, just a normal form will be fine.
>
> Thanks!
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-creator
>



More information about the Qt-creator-old mailing list