| 1 | #include "stapeldisplay.h"
|
---|
| 2 |
|
---|
| 3 | #include <qvariant.h>
|
---|
| 4 | #include <qgroupbox.h>
|
---|
| 5 | #include <qpushbutton.h>
|
---|
| 6 | #include <qprogressbar.h>
|
---|
| 7 | #include <qlcdnumber.h>
|
---|
| 8 | #include <qlayout.h>
|
---|
| 9 | StapelGroupBox::StapelGroupBox( QWidget* parent, const char* name )
|
---|
| 10 | : QGroupBox( parent, name )
|
---|
| 11 | {
|
---|
| 12 | this->setAlignment( int( QGroupBox::AlignTop ) );
|
---|
| 13 |
|
---|
| 14 | stapelMin1PushButton = new QPushButton( this, "stapelMin1PushButton" );
|
---|
| 15 | stapelMin1PushButton->setGeometry( QRect( 11, 21, 51, 27 ) );
|
---|
| 16 | stapelMin1PushButton->setText( tr ( "-1" ) );
|
---|
| 17 |
|
---|
| 18 | stapelMin2PushButton = new QPushButton( this, "stapelMin2PushButton" );
|
---|
| 19 | stapelMin2PushButton->setGeometry( QRect( 68, 21, 51, 27 ) );
|
---|
| 20 | stapelMin2PushButton->setText( tr ( "-2" ) );
|
---|
| 21 |
|
---|
| 22 | stapelProgressBar = new QProgressBar( this, "stapelProgressBar" );
|
---|
| 23 | stapelProgressBar->setGeometry( QRect( 125, 23, 161, 22 ) );
|
---|
| 24 | stapelProgressBar->setPercentageVisible( false );
|
---|
| 25 | stapelLCDNumber = new QLCDNumber( this, "stapelLCDNumber" );
|
---|
| 26 | stapelLCDNumber->setGeometry( QRect( 292, 21, 37, 27 ) );
|
---|
| 27 | stapelLCDNumber->setNumDigits( 2 );
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | //connections
|
---|
| 31 | connect( stapelMin1PushButton, SIGNAL(pressed()),
|
---|
| 32 | this, SLOT(button1PressedSlot()) );
|
---|
| 33 | connect( stapelMin2PushButton, SIGNAL(pressed()),
|
---|
| 34 | this, SLOT(button2PressedSlot()) );
|
---|
| 35 |
|
---|
| 36 | // tab order
|
---|
| 37 | setTabOrder( stapelMin1PushButton, stapelMin2PushButton );
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | StapelGroupBox::~StapelGroupBox()
|
---|
| 42 | {
|
---|
| 43 |
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | void StapelGroupBox::setXY( int X, int Y )
|
---|
| 48 | {
|
---|
| 49 | this->setGeometry( X, Y, 341, 60 );
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | void StapelGroupBox::setCaption( int Number )
|
---|
| 54 | {
|
---|
| 55 | stapelNumber = Number;
|
---|
| 56 | this->setTitle( tr ( "Stapel " + QString::number( Number , 10 ) ) );
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | void StapelGroupBox::setRange( int Min, int Max )
|
---|
| 61 | {
|
---|
| 62 | this->stapelProgressBar->setTotalSteps( Max - Min );
|
---|
| 63 | this->stapelProgressBar->setProgress( Max );
|
---|
| 64 | this->stapelLCDNumber->display( Max );
|
---|
| 65 | stapelAantal = Max - Min;
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | //Acties
|
---|
| 69 | void StapelGroupBox::button1PressedSlot( )
|
---|
| 70 | {
|
---|
| 71 | emit buttonPressed ( stapelNumber , 1 );
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | void StapelGroupBox::button2PressedSlot( )
|
---|
| 75 | {
|
---|
| 76 | emit buttonPressed ( stapelNumber , 2 );
|
---|
| 77 | }
|
---|