Subversion Repositories tpanel

Rev

Rev 141 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 141 Rev 142
Line 43... Line 43...
43
    ui->label_Number->setText(mNumber);
43
    ui->label_Number->setText(mNumber);
44
    ui->label_Status->setText("");
44
    ui->label_Status->setText("");
45
    ui->toolButton_Call->setText("");
45
    ui->toolButton_Call->setText("");
46
    ui->toolButton_Call->setIcon(QIcon(":images/pickup.png"));
46
    ui->toolButton_Call->setIcon(QIcon(":images/pickup.png"));
47
 
47
 
48
    connect(ui->pushButton_Clear, &QAbstractButton::pressed, this, &TQtPhone::on_pushButton_Clear_clicked);
48
//    connect(ui->pushButton_Clear, &QAbstractButton::pressed, this, &TQtPhone::on_pushButton_Clear_clicked);
49
    connect(ui->toolButton_Call, &QAbstractButton::pressed, this, &TQtPhone::on_toolButton_Call_Clicked);
49
//    connect(ui->toolButton_Call, &QAbstractButton::pressed, this, &TQtPhone::on_toolButton_Call_clicked);
50
 
50
 
51
    connect(ui->pushButton_Exit, &QAbstractButton::pressed, this, &TQtPhone::on_pushButton_Exit_clicked);
51
//    connect(ui->pushButton_Exit, &QAbstractButton::pressed, this, &TQtPhone::on_pushButton_Exit_clicked);
52
}
52
}
53
 
53
 
54
TQtPhone::~TQtPhone()
54
TQtPhone::~TQtPhone()
55
{
55
{
56
    DECL_TRACER("TQtPhone::~TQtPhone()");
56
    DECL_TRACER("TQtPhone::~TQtPhone()");
Line 160... Line 160...
160
 
160
 
161
    mNumber.clear();
161
    mNumber.clear();
162
    ui->label_Number->setText(mNumber);
162
    ui->label_Number->setText(mNumber);
163
}
163
}
164
 
164
 
165
void TQtPhone::on_toolButton_Call_Clicked()
165
void TQtPhone::on_toolButton_Call_clicked()
166
{
166
{
167
    DECL_TRACER("TQtPhone::on_pushButton_Call_clicked()");
167
    DECL_TRACER("TQtPhone::on_pushButton_Call_clicked()");
168
 
168
 
169
    if (!gPageManager)
169
    if (!gPageManager)
170
        return;
170
        return;
Line 283... Line 283...
283
        else if (name.startsWith("pushButton"))
283
        else if (name.startsWith("pushButton"))
284
            scaleObject(dynamic_cast<QPushButton *>(obj));
284
            scaleObject(dynamic_cast<QPushButton *>(obj));
285
        else if (name.startsWith("label"))
285
        else if (name.startsWith("label"))
286
            scaleObject(dynamic_cast<QLabel *>(obj));
286
            scaleObject(dynamic_cast<QLabel *>(obj));
287
        else if (name.startsWith("line"))
287
        else if (name.startsWith("line"))
288
        {
-
 
289
            QLine *ln = dynamic_cast<QLine *>(obj);
288
            scaleObject(dynamic_cast<QFrame *>(obj));
290
            int x1, y1, x2, y2;
-
 
291
            x1 = scale(ln->x1());
-
 
292
            y1 = scale(ln->y1());
-
 
293
            x2 = scale(ln->x2());
-
 
294
            y2 = scale(ln->y2());
-
 
295
            ln->setLine(x1, y1, x2, y2);
-
 
296
        }
-
 
297
    }
289
    }
298
}
290
}
299
 
291
 
300
void TQtPhone::setPhoneNumber(const std::string& number)
292
void TQtPhone::setPhoneNumber(const std::string& number)
301
{
293
{
Line 384... Line 376...
384
}
376
}
385
 
377
 
386
template<typename T>
378
template<typename T>
387
void TQtPhone::scaleObject(T *obj)
379
void TQtPhone::scaleObject(T *obj)
388
{
380
{
389
    DECL_TRACER("TQtPhone::scaleObject(T *obj)");
381
    DECL_TRACER("TQtPhone::scaleObject(T *obj): " + obj->objectName().toStdString());
390
 
382
 
391
    QSize size = obj->size();
383
    QSize size = obj->size();
392
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
384
    size.scale(scale(size.width()), scale(size.height()), Qt::KeepAspectRatio);
393
    obj->resize(size);
385
    obj->resize(size);
394
    QRect rect = obj->geometry();
386
    QRect rect = obj->geometry();