Mercurial > hg > syntilista
annotate src/main.h @ 241:ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 08 May 2018 00:18:59 +0300 |
parents | 14c6a4d40232 |
children | 43a5e09bb832 |
rev | line source |
---|---|
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 // |
140
783417da6da3
Change the program description to english etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
130
diff
changeset
|
2 // Syntilista - debt list/management database program |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 // Programmed and designed by Matti Hämäläinen <ccr@tnsp.org> |
217 | 4 // (C) Copyright 2017-2018 Tecnic Software productions (TNSP) |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 // |
57 | 6 // Distributed under 3-clause BSD style license, refer to |
7 // included file "COPYING" for exact terms. | |
8 // | |
41 | 9 #ifndef SYNTILISTA_H |
10 #define SYNTILISTA_H | |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 #include <QMainWindow> |
17
d40345d63733
Implement some keyboard shortcuts.
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
13 #include <QShortcut> |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 #include <QDialog> |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 #include <QtSql> |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 #include <QSqlQueryModel> |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
17 #include <QPainter> |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
18 #include <QPrinter> |
142
36c9cb759326
Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents:
141
diff
changeset
|
19 #include <QProgressDialog> |
150
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
20 #ifdef USE_QTHTTP |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
21 # include <QNetworkAccessManager> |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
22 # include <QNetworkRequest> |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
23 # include <QNetworkReply> |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
24 # include <QHttpMultiPart> |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
25 #endif |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
26 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 // |
41 | 29 // Global application defines |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
30 // |
149 | 31 #define APP_VENDOR "TNSP" // Vendor ID (for settings, etc.) |
32 #define APP_ID "Kampus Syntilista" // Application ID (for settings) | |
33 #define APP_NAME "Café Kampus Syntilista" // Application title/name | |
34 #define APP_SQLITE_FILE "syntilista.sqlite3" // SQLite3 database file name (without path) | |
35 #define APP_LOG_FILE "log.txt" // Application log file name (without path) | |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 |
149 | 37 // SQL database field width/lengths |
38 #define SQL_LEN_FIRST_NAME 128 | |
39 #define SQL_LEN_LAST_NAME 128 | |
40 #define SQL_LEN_EXTRA_INFO 2048 | |
113
907f2ddf6801
Use #defines for SQL table field lengths.
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
41 |
150
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
42 // Supported database backup modes |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
43 #define BACKUP_NONE 0 // No backup |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
44 #define BACKUP_HTTP 1 // HTTP(s) POST to a PHP script |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
45 |
113
907f2ddf6801
Use #defines for SQL table field lengths.
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
46 |
239
9626307f3eeb
Streamline SQL table creation.
Matti Hamalainen <ccr@tnsp.org>
parents:
237
diff
changeset
|
47 // Helper macros |
9626307f3eeb
Streamline SQL table creation.
Matti Hamalainen <ccr@tnsp.org>
parents:
237
diff
changeset
|
48 #define SL_STR_HELPER(x) #x |
9626307f3eeb
Streamline SQL table creation.
Matti Hamalainen <ccr@tnsp.org>
parents:
237
diff
changeset
|
49 #define SL_STR(x) SL_STR_HELPER(x) |
9626307f3eeb
Streamline SQL table creation.
Matti Hamalainen <ccr@tnsp.org>
parents:
237
diff
changeset
|
50 |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
51 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 // |
240
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
53 // Application settings struct |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
54 // |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
55 typedef struct |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
56 { |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
57 QPoint uiPos; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
58 QSize uiSize; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
59 double uiScale; // Global UI scale factor |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
60 |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
61 QString dataPath; // Application data path/directory |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
62 |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
63 // Backup related settings |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
64 int dbBackupMode; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
65 QString dbBackupURL; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
66 QString dbBackupSecret; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
67 QDateTime dbLastBackup; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
68 } SLAppSettings; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
69 |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
70 extern SLAppSettings settings; |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
71 |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
72 |
14c6a4d40232
Move settings struct definition to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
239
diff
changeset
|
73 // |
241
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
74 // SQL schema / table definitions |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
75 // |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
76 typedef struct |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
77 { |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
78 QString name; |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
79 QString schema; |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
80 } SLSQLSchemaDef; |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
81 |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
82 |
ea85ff97a01c
Move SLSQLSchemaDef struct def to main.h
Matti Hamalainen <ccr@tnsp.org>
parents:
240
diff
changeset
|
83 // |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
84 // Person information record |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
85 // |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
86 class SLPersonInfo : public QObject |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
87 { |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
88 Q_OBJECT |
112 | 89 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
90 public: |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
91 explicit SLPersonInfo() |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
92 { |
5 | 93 id = -1; |
94 firstName = ""; | |
95 lastName = ""; | |
96 extraInfo = ""; | |
97 balance = 0; | |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
98 } |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
99 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
100 ~SLPersonInfo() |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
101 { |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
102 } |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
103 |
5 | 104 void dump(); |
105 | |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
106 qint64 id; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
107 QString firstName, lastName, extraInfo; |
5 | 108 double balance; |
4 | 109 QDateTime added, updated; |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
110 }; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
111 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
112 |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
113 // |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
114 // Global functions |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
115 // |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
116 double slMoneyStrToValue(const QString &str); |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
117 QString slMoneyValueToStr(double val); |
213
131463be208b
Split the custom SQL models code into sqlmodels.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
211
diff
changeset
|
118 QString slMoneyValueToStrSign(double val); |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
119 QString slCleanupStr(const QString &str); |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
120 const QDateTime slDateTimeToLocal(const QDateTime &val); |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
121 const QString slDateTimeToStr(const QDateTime &val); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
122 |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
123 void slLog(const QString &mtype, const QString &msg); |
200 | 124 int slErrorMsg(const QString &title, const QString &msg); |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
125 bool slCheckAndReportSQLError(const QString where, const QSqlError &err, bool report = false); |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
126 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
127 void slGetPersonInfoRec(QSqlQuery &query, SLPersonInfo &info); |
237
54ab3f3e28c0
Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents:
218
diff
changeset
|
128 bool slGetPersonInfo(qint64 id, SLPersonInfo &info); |
54ab3f3e28c0
Split EditPerson and ViewTransactions to separate source files.
Matti Hamalainen <ccr@tnsp.org>
parents:
218
diff
changeset
|
129 void slSetCommonStyleSheet(QWidget *widget); |
157
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
130 |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
131 |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
132 // |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
133 // Custom SQL models |
325e7590f93e
Move most of the printing related code to printing.cpp
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
134 // |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
135 class SLPersonSQLModel : public QSqlQueryModel |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 { |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
137 Q_OBJECT |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
138 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
139 private: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
140 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
141 public: |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
142 SLPersonSQLModel(QObject *parent = 0); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
143 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
145 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
146 int updatePerson(const SLPersonInfo &person); |
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
147 qint64 addPerson(const SLPersonInfo &person); |
13 | 148 int deletePerson(qint64 id); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
149 void updateModel(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 }; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
153 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
154 class SLTransactionSQLModel : public QSqlQueryModel |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
155 { |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
156 Q_OBJECT |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
157 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
158 private: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
159 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
160 public: |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
161 SLTransactionSQLModel(QObject *parent = 0); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
162 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
163 QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
164 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
165 void updateModel(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
166 }; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
167 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
168 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
169 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
170 // |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
171 // Main window |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
172 // |
100 | 173 namespace Ui |
174 { | |
175 class SyntilistaMainWindow; | |
176 class EditPerson; | |
177 class AboutWindow; | |
218
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
178 class ViewTransactions; |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
179 } |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
180 |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
181 typedef struct |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
182 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
183 int nlinesPerPage; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
184 int npages; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
185 } SLPageInfo; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
186 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
187 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
188 class SyntilistaMainWindow : public QMainWindow |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
189 { |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
190 Q_OBJECT |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
191 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
192 public: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
193 explicit SyntilistaMainWindow(QWidget *parent = 0); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
194 ~SyntilistaMainWindow(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
195 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
196 void statusMsg(const QString &msg); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
197 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
198 void readSettings(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
199 void saveSettings(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
200 void setActivePerson(qint64 id); |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
201 int addTransaction(qint64 id, double value, SLPersonInfo &info); |
4 | 202 int addTransactionGUI(qint64 id, bool debt, double value); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
203 void updatePersonList(); |
145
9f3c0a99bcb1
Add display for total number of people on the database.
Matti Hamalainen <ccr@tnsp.org>
parents:
142
diff
changeset
|
204 void updateMiscValues(); |
142
36c9cb759326
Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents:
141
diff
changeset
|
205 void backupDatabase(); |
190
76afbf6508c8
Add check for last successful database backup, and show a warning dialog at
Matti Hamalainen <ccr@tnsp.org>
parents:
174
diff
changeset
|
206 void backupSuccess(); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
207 |
160
1c2f9d09e87b
Begin working on printing fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
157
diff
changeset
|
208 bool printDocumentPage(const bool getPageInfo, const int page, QPainter *pt, QPrinter *printer); |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
209 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
210 SLPersonSQLModel *model_People; |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
211 |
109
62e570222f66
Return inserted person ID from addPerson() (or negative value in case of errors.)
Matti Hamalainen <ccr@tnsp.org>
parents:
100
diff
changeset
|
212 public slots: |
62e570222f66
Return inserted person ID from addPerson() (or negative value in case of errors.)
Matti Hamalainen <ccr@tnsp.org>
parents:
100
diff
changeset
|
213 void focusDebtEdit(); |
62e570222f66
Return inserted person ID from addPerson() (or negative value in case of errors.)
Matti Hamalainen <ccr@tnsp.org>
parents:
100
diff
changeset
|
214 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
215 private slots: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
216 void on_button_AddPerson_clicked(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
217 void on_button_EditPerson_clicked(); |
66 | 218 void on_button_DeletePerson_clicked(); |
219 | |
79 | 220 void on_edit_PersonFilter_textChanged(const QString &arg1); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
221 void on_button_ClearFilter_clicked(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
222 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
223 void on_button_Quit_clicked(); |
60
d7a2a48ebe24
Add a separate "About" button, don't use the logo as one. Change logo widget
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
224 void on_button_About_clicked(); |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
225 void on_button_Print_clicked(); |
218
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
226 void on_button_ViewTransactions_clicked(); |
47 | 227 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
228 void on_button_AddDebt_clicked(); |
2
edc1e8cf6e2c
Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
229 void on_button_PayDebt_clicked(); |
edc1e8cf6e2c
Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
230 void on_button_PayFullDebt_clicked(); |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
231 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
232 void on_tableview_People_doubleClicked(const QModelIndex &index); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
233 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
234 void selectedPersonChanged(const QModelIndex &, const QModelIndex &); |
65 | 235 |
211
6585cac42b75
Rename selectRowDelta() to clearer void changeSelectedRow().
Matti Hamalainen <ccr@tnsp.org>
parents:
209
diff
changeset
|
236 void changeSelectedRow(const int delta); |
65 | 237 void selectRowPrev(); |
238 void selectRowNext(); | |
239 | |
46
372c1be58996
Improve shortcuts functionality a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
240 void changeUIZoomIn(); |
372c1be58996
Improve shortcuts functionality a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
241 void changeUIZoomOut(); |
372c1be58996
Improve shortcuts functionality a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
242 void changeUIZoomReset(); |
112 | 243 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
244 void updateSortOrder(int index, Qt::SortOrder order); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
245 |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
246 void printDocument(QPrinter *printer); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
247 |
150
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
248 #ifdef USE_QTHTTP |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
249 void httpBackupProgress(qint64 bytesSent, qint64 bytesTotal); |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
250 void httpBackupFinished(); |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
251 void httpBackupError(QNetworkReply::NetworkError code); |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
252 #endif |
142
36c9cb759326
Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents:
141
diff
changeset
|
253 |
6
0315a3b9f560
Implement person and transaction history deletion.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
254 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
255 private: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
256 Ui::SyntilistaMainWindow *ui; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
257 |
142
36c9cb759326
Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents:
141
diff
changeset
|
258 QProgressDialog *backupDialog; |
150
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
259 #ifdef USE_QTHTTP |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
260 QNetworkReply *httpBackupReply; |
2a8c97753381
Make the backup stuff compile-time optional.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
261 #endif |
142
36c9cb759326
Implement simple SQLite database backup at program exit using Qt HTTP/HTTPS
Matti Hamalainen <ccr@tnsp.org>
parents:
141
diff
changeset
|
262 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
263 SLTransactionSQLModel *model_Latest; |
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
264 SLPersonInfo currPerson; |
2
edc1e8cf6e2c
Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
265 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
266 int peopleSortIndex; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
267 Qt::SortOrder peopleSortOrder; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
268 QString peopleFilter; |
160
1c2f9d09e87b
Begin working on printing fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
157
diff
changeset
|
269 |
1c2f9d09e87b
Begin working on printing fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
157
diff
changeset
|
270 SLPageInfo pinfo; |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
271 |
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
272 int totalPeople; |
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
273 double totalBalance; |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
274 }; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
275 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
276 |
41 | 277 // |
278 // Person edit / new person dialog | |
279 // | |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
280 class EditPerson : public QDialog |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
281 { |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
282 Q_OBJECT |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
283 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
284 public: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
285 explicit EditPerson(QWidget *parent = 0); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
286 ~EditPerson(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
287 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
288 void statusMsg(const QString &msg); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
289 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
290 void clearForm(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
291 bool validateForm(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
292 void setPerson(qint64 id); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
293 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
294 private slots: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
295 void on_button_OK_clicked(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
296 void on_button_Cancel_clicked(); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
297 |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
298 void on_edit_FirstName_textChanged(const QString &arg1); |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
299 void on_edit_LastName_textChanged(const QString &arg1); |
121
404d567edaab
Validate the length of extra info field in the add/edit person dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
114
diff
changeset
|
300 void on_textedit_ExtraInfo_textChanged(); |
404d567edaab
Validate the length of extra info field in the add/edit person dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
114
diff
changeset
|
301 |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
302 private: |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
303 Ui::EditPerson *ui; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
304 |
174
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
305 SLPersonInfo selPerson; |
636a24c76232
Rename some classes to add a SL prefix to their names.
Matti Hamalainen <ccr@tnsp.org>
parents:
160
diff
changeset
|
306 SLTransactionSQLModel *model_Transactions; |
0
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
307 }; |
fec4d0c461f2
Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
308 |
90
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
309 |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
310 // |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
311 // About dialog |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
312 // |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
313 class AboutWindow : public QDialog |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
314 { |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
315 Q_OBJECT |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
316 |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
317 public: |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
318 explicit AboutWindow(QWidget *parent = 0); |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
319 ~AboutWindow(); |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
320 |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
321 private slots: |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
322 void on_button_Close_clicked(); |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
323 |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
324 private: |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
325 Ui::AboutWindow *ui; |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
326 }; |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
327 |
efab68769c75
Implement new separate About dialog/help window.
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
328 |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
329 // |
218
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
330 // Global transactions list viewer |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
331 // |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
332 class ViewTransactions : public QDialog |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
333 { |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
334 Q_OBJECT |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
335 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
336 public: |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
337 explicit ViewTransactions(QWidget *parent = 0); |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
338 ~ViewTransactions(); |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
339 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
340 // void statusMsg(const QString &msg); |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
341 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
342 private slots: |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
343 void on_button_Close_clicked(); |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
344 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
345 private: |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
346 Ui::ViewTransactions *ui; |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
347 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
348 SLTransactionSQLModel *model_Transactions; |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
349 }; |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
350 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
351 |
c3f47d489097
Implement global transactions viewer dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
217
diff
changeset
|
352 // |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
353 // Custom painter drawing helper class |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
354 // |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
355 class SLDrawContext : public QObject |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
356 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
357 Q_OBJECT |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
358 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
359 public: |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
360 QPointF m_pos; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
361 QString m_str; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
362 qreal m_lf_add; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
363 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
364 explicit SLDrawContext(QPainter *pt) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
365 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
366 painter = pt; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
367 metrics = NULL; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
368 m_str = "ABC"; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
369 setPos(0, 0); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
370 m_lf_add = 0; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
371 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
372 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
373 ~SLDrawContext() |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
374 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
375 if (metrics) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
376 delete metrics; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
377 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
378 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
379 void setFont(const QFont &ft) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
380 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
381 if (metrics) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
382 delete metrics; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
383 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
384 font = QFont(ft, painter->device()); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
385 painter->setFont(font); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
386 metrics = new QFontMetricsF(font); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
387 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
388 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
389 void setLFAdd(const qreal lf_add) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
390 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
391 m_lf_add = lf_add; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
392 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
393 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
394 void drawText(const QPointF &pos, const QString &str) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
395 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
396 m_str = str; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
397 painter->drawText(m_pos + pos, str); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
398 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
399 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
400 void drawText(const QString &str) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
401 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
402 drawText(QPointF(0, 0), str); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
403 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
404 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
405 void drawText(const qreal xc, const qreal width, const QString &str, const int flags = 0) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
406 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
407 m_str = str; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
408 painter->drawText( |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
409 m_pos.x() + xc, m_pos.y(), |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
410 width, boundRect().height(), |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
411 flags, |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
412 str); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
413 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
414 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
415 const QRectF boundRect(const QString str) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
416 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
417 return metrics->boundingRect(str); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
418 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
419 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
420 const QRectF boundRect() |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
421 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
422 return metrics->boundingRect(m_str); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
423 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
424 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
425 void lf(qreal yadd) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
426 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
427 m_pos.setY(m_pos.y() + boundRect().height() + yadd); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
428 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
429 |
125 | 430 qreal lfq(qreal yadd) |
431 { | |
432 return m_pos.y() + boundRect().height() + yadd; | |
433 } | |
434 | |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
435 void lf() |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
436 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
437 lf(m_lf_add); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
438 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
439 |
125 | 440 qreal lfq() |
441 { | |
442 return m_pos.y() + boundRect().height() + m_lf_add; | |
443 } | |
444 | |
114
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
445 void setPos(const QPointF &pos) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
446 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
447 m_pos = pos; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
448 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
449 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
450 void setPos(const qreal x, const qreal y) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
451 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
452 setPos(QPointF(x, y)); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
453 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
454 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
455 void move(const QPointF &pos) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
456 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
457 m_pos += pos; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
458 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
459 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
460 void move(const qreal x, const qreal y) |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
461 { |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
462 move(QPointF(x, y)); |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
463 } |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
464 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
465 private: |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
466 QPainter *painter; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
467 QFont font; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
468 QFontMetricsF *metrics; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
469 }; |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
470 |
a5c8741b8662
Initial prototype support for printing list of users + print preview dialog.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
471 |
41 | 472 #endif // SYNTILISTA_H |