summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.cpp
blob: dd40459f58d85de4ce0175ee678fa9bce4fd3c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <tqradiobutton.h>
#include <tqspinbox.h>
#include "receiver.h"

void Receiver::setParent( TQDialog *tqparent )
{
    p = tqparent;
    setAmount();
}

void Receiver::setAmount() 
{
    TQSpinBox *amount = 
	(TQSpinBox *) p->child( "amountSpinBox", "TQSpinBox" );

    TQRadioButton *radio = 
	(TQRadioButton *) p->child( "stdRadioButton", "TQRadioButton" );
    if ( radio && radio->isChecked() ) {
	if ( amount )
	    amount->setValue( amount->maxValue() / 2 );
	return;
    }

    radio = 
	(TQRadioButton *) p->child( "noneRadioButton", "TQRadioButton" );
    if ( radio && radio->isChecked() )
	if ( amount )
	    amount->setValue( amount->minValue() );
}