forked from foldynl/QLog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogLocale.h
36 lines (28 loc) · 943 Bytes
/
LogLocale.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef QLOG_CORE_LOGLOCALE_H
#define QLOG_CORE_LOGLOCALE_H
#include <QSettings>
#include <QLocale>
#include <QRegularExpression>
class LogLocale : public QLocale
{
public:
LogLocale();
const QString formatTimeLongWithoutTZ() const;
const QString formatTimeShort() const;
const QString formatTimeLong() const;
const QString formatDateShortWithYYYY() const;
const QString formatDateTimeShortWithYYYY() const;
bool getSettingUse24hformat() const;
void setSettingUse24hformat(bool value);
bool getSettingUseSystemDateFormat() const;
void setSettingUseSystemDateFormat(bool value);
const QString getSettingDateFormat() const;
void setSettingDateFormat(const QString &value);
private:
const QRegularExpression regexp;
bool is24hUsed;
QSettings settings;
QString systemDateFormat;
void changeTime12_24Format(QString &formatString) const;
};
#endif // QLOG_CORE_LOGLOCALE_H