source: liacs/pm/qt-nim/stapelGroupBox.cc@ 4

Last change on this file since 4 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

  • Property svn:executable set to *
File size: 2.0 KB
RevLine 
[2]1#include "stapelGroupBox.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>
9StapelGroupBox::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
41StapelGroupBox::~StapelGroupBox()
42{
43
44}
45
46
47void StapelGroupBox::setXY( int X, int Y )
48{
49 this->setGeometry( X, Y, 341, 60 );
50}
51
52
53void StapelGroupBox::setCaption( int Number )
54{
55 stapelNumber = Number;
56 this->setTitle( tr ( "Stapel " + QString::number( Number , 10 ) ) );
57}
58
59
60void StapelGroupBox::setRange( int Min, int Max )
61{
62 this->stapelProgressBar->setTotalSteps( Max - Min );
63 this->stapelProgressBar->setProgress( Max );
64 this->stapelLCDNumber->display( Max );
65}
66
67//Acties
68void StapelGroupBox::button1PressedSlot( )
69{
70 emit buttonPressed ( stapelNumber , 1 );
71}
72
73void StapelGroupBox::button2PressedSlot( )
74{
75 emit buttonPressed ( stapelNumber , 2 );
76}
Note: See TracBrowser for help on using the repository browser.