# HG changeset patch # User Matti Hamalainen # Date 1491228967 -10800 # Node ID 9c6feafba7ce2f2cdd078fbdbf180ef086d4b5ff # Parent 9ca399a7229b5b967124c8779cc01f156abc4db0 Work on UI cosmetics and stylesheet stuff. diff -r 9ca399a7229b -r 9c6feafba7ce main.cpp --- a/main.cpp Mon Apr 03 16:33:11 2017 +0300 +++ b/main.cpp Mon Apr 03 17:16:07 2017 +0300 @@ -131,22 +131,22 @@ } QSqlQuery query; - query.exec( + query.exec(QStringLiteral( "CREATE TABLE people (id INTEGER PRIMARY KEY, " "first_name VARCHAR(128) NOT NULL, " "last_name VARCHAR(128) NOT NULL, " "extra_info VARCHAR(2048), " "added DATETIME NOT NULL, " - "updated DATETIME NOT NULL)"); + "updated DATETIME NOT NULL)")); checkAndReportSQLError("CREATE TABLE people", query.lastError()); - query.exec( + query.exec(QStringLiteral( "CREATE TABLE transactions (" "id INTEGER PRIMARY KEY, " "person INT NOT NULL, " "value REAL, " - "added DATETIME NOT NULL)"); + "added DATETIME NOT NULL)")); checkAndReportSQLError("CREATE TABLE transactions", query.lastError()); @@ -171,9 +171,27 @@ ui->edit_Amount->setValidator(new QDoubleValidator(0, 1000, 2, this)); - ui->button_AddDebt->setStyleSheet("background-color: #900; color: black;"); - ui->button_PayDebt->setStyleSheet("background-color: #090; color: black;"); - ui->button_PayFullDebt->setStyleSheet("background-color: #060; color: black;"); + this->setStyleSheet( + QStringLiteral( + "* { font-size: %1pt; }" + "QPushButton { font-size: %2pt; padding: 0.25em; }" + "#button_AddDebt { font-size: %3pt; background-color: #900; color: black; }" + "#button_PayDebt { font-size: %3pt; background-color: #090; color: black; }" + "#button_PayFullDebt { background-color: #060; color: black; }" + "#label_PersonName { font-size: %4pt; }" + "#label_BalanceValue { font-size: %4pt; }" + "#label_EUR { font-size: %4pt; }" + "#edit_Amount { font-size: %4pt; }" + ). + arg(14). + arg(16). + arg(20). + arg(16) + ); + +// ui->button_AddDebt->setStyleSheet("background-color: #900; color: black;"); +// ui->button_PayDebt->setStyleSheet("background-color: #090; color: black;"); +// ui->button_PayFullDebt->setStyleSheet("background-color: #060; color: black;"); // Setup person list filtering and sorting peopleSortIndex = 1; @@ -221,8 +239,6 @@ SyntilistaMainWindow::~SyntilistaMainWindow() { - printf("QUITTAUS\n"); - saveSettings(); delete ui; diff -r 9ca399a7229b -r 9c6feafba7ce mainwindow.ui --- a/mainwindow.ui Mon Apr 03 16:33:11 2017 +0300 +++ b/mainwindow.ui Mon Apr 03 17:16:07 2017 +0300 @@ -10,11 +10,6 @@ 646 - - - 12 - - Kampus Cafe Syntilista @@ -123,11 +118,6 @@ - - - 16 - - Henkilön nimi @@ -154,11 +144,6 @@ - - - 16 - - 12345 @@ -169,11 +154,6 @@ - - - 14 - - EUR @@ -196,11 +176,6 @@ - - - 14 - - @@ -213,11 +188,6 @@ - - - 14 - - Lisää velkaa @@ -227,11 +197,6 @@ - - - 14 - - Maksa velkaa @@ -302,11 +267,6 @@ - - - 14 - - Poistu ohjelmasta