comparison src/main.cpp @ 132:dc9fe580da42

Rename setCommonStyleSheet() to slSetCommonStyleSheet().
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 23 Aug 2017 17:02:49 +0300
parents 10c6bd84eb32
children df03ab8b6413
comparison
equal deleted inserted replaced
131:931bb422a356 132:dc9fe580da42
184 query.finish(); 184 query.finish();
185 return true; 185 return true;
186 } 186 }
187 187
188 188
189 void setCommonStyleSheet(QWidget *widget) 189 void slSetCommonStyleSheet(QWidget *widget)
190 { 190 {
191 // Clamp scale value 191 // Clamp scale value
192 if (setScale < 0.5f) 192 if (setScale < 0.5f)
193 setScale = 0.5f; 193 setScale = 0.5f;
194 194
309 // Setup large logo in the main window 309 // Setup large logo in the main window
310 QPixmap logoImage(":/img/logo.png"); 310 QPixmap logoImage(":/img/logo.png");
311 ui->button_LogoImage->setPixmap(logoImage); 311 ui->button_LogoImage->setPixmap(logoImage);
312 ui->button_LogoImage->setAlignment(Qt::AlignCenter); 312 ui->button_LogoImage->setAlignment(Qt::AlignCenter);
313 313
314 setCommonStyleSheet(this); 314 slSetCommonStyleSheet(this);
315 315
316 // Validator for amount input 316 // Validator for amount input
317 //ui->edit_Amount->setValidator(new QDoubleValidator(0, 1000, 2, this)); 317 //ui->edit_Amount->setValidator(new QDoubleValidator(0, 1000, 2, this));
318 QRegExp vregex("\\d{0,4}[,.]\\d{0,2}|\\d{0,4}"); 318 QRegExp vregex("\\d{0,4}[,.]\\d{0,2}|\\d{0,4}");
319 ui->edit_Amount->setValidator(new QRegExpValidator(vregex, this)); 319 ui->edit_Amount->setValidator(new QRegExpValidator(vregex, this));
437 // Window scale / zoom changing 437 // Window scale / zoom changing
438 // 438 //
439 void SyntilistaMainWindow::changeUIZoomIn() 439 void SyntilistaMainWindow::changeUIZoomIn()
440 { 440 {
441 setScale += 0.1f; 441 setScale += 0.1f;
442 setCommonStyleSheet(this); 442 slSetCommonStyleSheet(this);
443 } 443 }
444 444
445 445
446 void SyntilistaMainWindow::changeUIZoomOut() 446 void SyntilistaMainWindow::changeUIZoomOut()
447 { 447 {
448 setScale -= 0.1f; 448 setScale -= 0.1f;
449 setCommonStyleSheet(this); 449 slSetCommonStyleSheet(this);
450 } 450 }
451 451
452 452
453 void SyntilistaMainWindow::changeUIZoomReset() 453 void SyntilistaMainWindow::changeUIZoomReset()
454 { 454 {
455 setScale = 1.0f; 455 setScale = 1.0f;
456 setCommonStyleSheet(this); 456 slSetCommonStyleSheet(this);
457 } 457 }
458 458
459 459
460 // 460 //
461 // Slot for changed selection of person entry 461 // Slot for changed selection of person entry
514 ui->tableview_Latest->setModel(model_Latest); 514 ui->tableview_Latest->setModel(model_Latest);
515 ui->tableview_Latest->setColumnHidden(0, true); 515 ui->tableview_Latest->setColumnHidden(0, true);
516 ui->tableview_Latest->verticalHeader()->setVisible(false); 516 ui->tableview_Latest->verticalHeader()->setVisible(false);
517 ui->tableview_Latest->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); 517 ui->tableview_Latest->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
518 518
519 setCommonStyleSheet(this); 519 slSetCommonStyleSheet(this);
520 return; // Ugly 520 return; // Ugly
521 } 521 }
522 } 522 }
523 523
524 // In case of id < 0 or errors .. 524 // In case of id < 0 or errors ..
526 ui->edit_Amount->clear(); 526 ui->edit_Amount->clear();
527 ui->label_BalanceValue->setText("--"); 527 ui->label_BalanceValue->setText("--");
528 ui->label_BalanceValue->setStyleSheet(NULL); 528 ui->label_BalanceValue->setStyleSheet(NULL);
529 ui->label_PersonName->setText("???"); 529 ui->label_PersonName->setText("???");
530 ui->tableview_Latest->setModel(NULL); 530 ui->tableview_Latest->setModel(NULL);
531 setCommonStyleSheet(this); 531 slSetCommonStyleSheet(this);
532 } 532 }
533 533
534 534
535 // 535 //
536 // Slot for changing person list sort order 536 // Slot for changing person list sort order
798 statusMsg(tr("Virhe! Ei henkilöä ID:llä #%1").arg(currPerson.id)); 798 statusMsg(tr("Virhe! Ei henkilöä ID:llä #%1").arg(currPerson.id));
799 return; 799 return;
800 } 800 }
801 801
802 QMessageBox dlg; 802 QMessageBox dlg;
803 setCommonStyleSheet(&dlg); 803 slSetCommonStyleSheet(&dlg);
804 dlg.setText(tr("Varmistus")); 804 dlg.setText(tr("Varmistus"));
805 dlg.setInformativeText( 805 dlg.setInformativeText(
806 tr("<br>Haluatko varmasti poistaa henkilön:<br>" 806 tr("<br>Haluatko varmasti poistaa henkilön:<br>"
807 "<br>" 807 "<br>"
808 "<b>'%1, %2'</b> <i>(ID #%3)</i>?<br>" 808 "<b>'%1, %2'</b> <i>(ID #%3)</i>?<br>"
1159 QDialog(parent), 1159 QDialog(parent),
1160 ui(new Ui::EditPerson) 1160 ui(new Ui::EditPerson)
1161 { 1161 {
1162 ui->setupUi(this); 1162 ui->setupUi(this);
1163 1163
1164 setCommonStyleSheet(this); 1164 slSetCommonStyleSheet(this);
1165 1165
1166 setModal(true); 1166 setModal(true);
1167 setAttribute(Qt::WA_DeleteOnClose); 1167 setAttribute(Qt::WA_DeleteOnClose);
1168 show(); 1168 show();
1169 activateWindow(); 1169 activateWindow();
1589 "<tr><td><b>F6</b></td><td>Muokkaa henkilöä</td></tr>" 1589 "<tr><td><b>F6</b></td><td>Muokkaa henkilöä</td></tr>"
1590 "<tr><td><b>F8</b></td><td>Poista henkilö</td></tr>" 1590 "<tr><td><b>F8</b></td><td>Poista henkilö</td></tr>"
1591 "</table>" 1591 "</table>"
1592 )); 1592 ));
1593 1593
1594 // setCommonStyleSheet(this); 1594 // slSetCommonStyleSheet(this);
1595 setModal(true); 1595 setModal(true);
1596 setAttribute(Qt::WA_DeleteOnClose); 1596 setAttribute(Qt::WA_DeleteOnClose);
1597 show(); 1597 show();
1598 activateWindow(); 1598 activateWindow();
1599 raise(); 1599 raise();