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

Robert Wood robert.wood at apostrophe.co.uk
Wed Mar 23 14:29:05 CET 2011


Perfect and wonderfully clearly explained, thank you very much. :~)

On 23/03/11 07:48, Miha D. Puc wrote:
> that's easy
>
> MyDialog:: MyDialog(): QDialog()
> {
> ...
> you make your buttons here or if you made them with designer
> ...
>
>
> QButtonGroup* pGr = new QButtonGroup( this );
> pGr->addButton( pButton1, 1 );
> pGr->addButton( pButton2, 2 );
> pGr->addButton( pButton3, 3 );
>
> connect( pGr, SIGNAL( *buttonClicked
> <http://doc.trolltech.com/4.7/qbuttongroup.html#buttonClicked-2>* ( int
> ) ), this, SLOT( done( int ) ) );
> }
>
>
> void somewhere_else()
> {
> MyDialog* pDia = new MyDialog();
>
> int iButton = pDia->exec();
>
> switch ( iButton ) {
> case 0:
> // user canceled ( esc, cancel )
> break;
> case 1:
> // button 1 was pressed
> break;
> ....
>
> }
>
> }
>
>
>
>
> Miha D. Puc
> __________________________________________________________
> EBA, agencija za elektronsko poslovanje, d.o.o., Ljubljana
> Teslova ulica 30
> SI-1000 Ljubljana
> e-mail: miha.puc at eba.si <mailto:miha.puc at eba.si>
> internet: www.eba.si <http://www.eba.si/>
> __________________________________________________________
>
> On Mar 22, 2011, at 10:48 PM, Robert Wood wrote:
>
>>>> First, this mailing list is dedicated to the Qt Creator IDE, not
>> Qt toolkit or general C++ language issues. Try qt-interest. <<
>>
>> Ach, sorry!
>>
>>>> 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. <<
>>
>> Thanks for a staggeringly patronising reply. :~| Replies like this a so
>> incredibly disrespectful. Granted I am not the most skilled of C++
>> programmers, but am trying to learn more ad have actually written quite
>> a few Qt apps of varying degrees of difficulty. To say I don't
>> understand how Qt works is simply not true. To say there aspects of it I
>> don't understand is fair.
>>
>> Just because I come across something new doesn't mean that I haven't
>> spent a long time trying to understand tutorials. If they made things
>> clear I wouldn't have asked the question in the first place.
>>
>> You'd go down well on the Codeblocks forum, they're very elitists there
>> too.
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt.nokia.com <mailto:Qt-creator at qt.nokia.com>
>> http://lists.qt.nokia.com/mailman/listinfo/qt-creator
>
>
>   QButtonGroup
>
>



More information about the Qt-interest-old mailing list