Qt 4.8
Public Functions | Public Variables | List of all members
QSystemLocaleData Struct Reference

Public Functions

 QSystemLocaleData ()
 
void updateLocale ()
 

Public Variables

QByteArray lc_measurement_var
 
QLocale lc_messages
 
QByteArray lc_messages_var
 
QLocale lc_monetary
 
QLocale lc_numeric
 
QLocale lc_time
 

Detailed Description

Definition at line 68 of file qlocale_unix.cpp.

Constructors and Destructors

◆ QSystemLocaleData()

QSystemLocaleData::QSystemLocaleData ( )
inline

Definition at line 70 of file qlocale_unix.cpp.

Functions

◆ updateLocale()

void QSystemLocaleData::updateLocale ( )
inline

Definition at line 79 of file qlocale_unix.cpp.

Referenced by QSystemLocaleData().

80  {
82  QByteArray numeric = all.isEmpty() ? qgetenv("LC_NUMERIC") : all;
83  QByteArray time = all.isEmpty() ? qgetenv("LC_TIME") : all;
84  QByteArray monetary = all.isEmpty() ? qgetenv("LC_MONETARY") : all;
85  lc_messages_var = all.isEmpty() ? qgetenv("LC_MESSAGES") : all;
86  lc_measurement_var = all.isEmpty() ? qgetenv("LC_MEASUREMENT") : all;
87 
88  QByteArray lang = qgetenv("LANG");
89  if (lang.isEmpty())
90  lang = QByteArray("C");
91  if (numeric.isEmpty())
92  numeric = lang;
93  if (time.isEmpty())
94  time = lang;
95  if (monetary.isEmpty())
96  monetary = lang;
98  lc_messages_var = lang;
100  lc_measurement_var = lang;
105  }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QByteArray lc_measurement_var
static QByteArray getSystemLocale()
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
QByteArray lc_messages_var

Properties

◆ lc_measurement_var

QByteArray QSystemLocaleData::lc_measurement_var

Definition at line 112 of file qlocale_unix.cpp.

Referenced by updateLocale().

◆ lc_messages

QLocale QSystemLocaleData::lc_messages

Definition at line 110 of file qlocale_unix.cpp.

Referenced by updateLocale().

◆ lc_messages_var

QByteArray QSystemLocaleData::lc_messages_var

Definition at line 111 of file qlocale_unix.cpp.

Referenced by updateLocale().

◆ lc_monetary

QLocale QSystemLocaleData::lc_monetary

Definition at line 109 of file qlocale_unix.cpp.

Referenced by updateLocale().

◆ lc_numeric

QLocale QSystemLocaleData::lc_numeric

Definition at line 107 of file qlocale_unix.cpp.

Referenced by updateLocale().

◆ lc_time

QLocale QSystemLocaleData::lc_time

Definition at line 108 of file qlocale_unix.cpp.

Referenced by updateLocale().


The documentation for this struct was generated from the following file: