From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- tools/designer/examples/receiver2/receiver.cpp | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/designer/examples/receiver2/receiver.cpp (limited to 'tools/designer/examples/receiver2/receiver.cpp') diff --git a/tools/designer/examples/receiver2/receiver.cpp b/tools/designer/examples/receiver2/receiver.cpp new file mode 100644 index 0000000..1f66d0b --- /dev/null +++ b/tools/designer/examples/receiver2/receiver.cpp @@ -0,0 +1,29 @@ +#include +#include +#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() ); +} -- cgit v1.2.3