summaryrefslogtreecommitdiffstats
path: root/tools/designer/examples/receiver2/receiver.cpp
blob: 1f66d0bfa381f579962c82be2674ef23884b61dc (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 <qradiobutton.h>
#include <qspinbox.h>
#include "receiver.h"

void Receiver::setParent( QDialog *parent )
{
    p = parent;
    setAmount();
}

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

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

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