Subversion Repositories svn1

Rev

Rev 183 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 183 Rev 184
Line 6... Line 6...
6
    ui(new Ui::TwinSpinBox),
6
    ui(new Ui::TwinSpinBox),
7
    populating(false)
7
    populating(false)
8
{
8
{
9
    ui->setupUi(this);
9
    ui->setupUi(this);
10
 
10
 
11
    connect(ui->spinBoxL,SIGNAL(valueChanged(int)), this, SLOT(adjust(void)));
11
    connect(ui->spinBoxL,SIGNAL(valueChanged(int)), this, SLOT(adjustL(void)));
12
    connect(ui->spinBoxU,SIGNAL(valueChanged(int)), this, SLOT(adjust(void)));
12
    connect(ui->spinBoxU,SIGNAL(valueChanged(int)), this, SLOT(adjustU(void)));
13
 
13
 
14
}
14
}
15
 
15
 
16
TwinSpinBox::~TwinSpinBox()
16
TwinSpinBox::~TwinSpinBox()
17
{
17
{
18
    delete ui;
18
    delete ui;
19
}
19
}
20
 
20
 
21
void TwinSpinBox::adjust(void)
21
void TwinSpinBox::adjustL(void)
22
{
22
{
23
    if ( ! populating )
23
    if ( ! populating )
24
    {
24
    {
25
        qDebug("Changed");
25
        qDebug("Changed");
26
        emit changed();
26
        emit changed();
Line 28... Line 28...
28
        populating = true;
28
        populating = true;
29
        if (ui->spinBoxL->value() > ui->spinBoxU->value())
29
        if (ui->spinBoxL->value() > ui->spinBoxU->value())
30
        {
30
        {
31
            ui->spinBoxU->setValue(ui->spinBoxL->value());
31
            ui->spinBoxU->setValue(ui->spinBoxL->value());
32
        }
32
        }
-
 
33
        populating = false;
-
 
34
    }
-
 
35
}
-
 
36
 
-
 
37
void TwinSpinBox::adjustU(void)
-
 
38
{
-
 
39
    if ( ! populating )
-
 
40
    {
-
 
41
        qDebug("Changed");
-
 
42
        emit changed();
33
 
43
 
34
        qDebug("Values: %d, %d",ui->spinBoxU->value() , ui->spinBoxL->value() );
44
        populating = true;
35
        if (ui->spinBoxU->value() < ui->spinBoxL->value())
45
        if (ui->spinBoxU->value() < ui->spinBoxL->value())
36
        {
46
        {
37
            qDebug("SetL");
47
            qDebug("SetL");
38
            ui->spinBoxL->setValue(ui->spinBoxU->value());
48
            ui->spinBoxL->setValue(ui->spinBoxU->value());
39
        }
49
        }