Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qlocale_win.cpp File Reference

(b68f1009187fee473f4c6477ec64300650e29904)

#include "qlocale_p.h"
#include "qlocale_tools_p.h"
#include "qstringlist.h"
#include "qvariant.h"
#include "qdatetime.h"
#include "qdebug.h"
#include "QtCore/private/qgregoriancalendar_p.h"
#include <q20algorithm.h>
#include <qt_windows.h>
#include <time.h>
+ Include dependency graph for qlocale_win.cpp:

Go to the source code of this file.

Classes

struct  QSystemLocalePrivate
 
struct  WindowsToISOListElt
 

Macros

#define MUI_LANGUAGE_NAME   0x8
 
#define LOCALE_SSHORTESTDAYNAME1   0x0060
 
#define LOCALE_SSHORTESTDAYNAME2   0x0061
 
#define LOCALE_SSHORTESTDAYNAME3   0x0062
 
#define LOCALE_SSHORTESTDAYNAME4   0x0063
 
#define LOCALE_SSHORTESTDAYNAME5   0x0064
 
#define LOCALE_SSHORTESTDAYNAME6   0x0065
 
#define LOCALE_SSHORTESTDAYNAME7   0x0066
 
#define LOCALE_SNATIVELANGUAGENAME   0x00000004
 
#define LOCALE_SNATIVECOUNTRYNAME   0x00000008
 
#define LOCALE_SSHORTTIME   0x00000079
 

Functions

static auto scanLangEnv ()
 
static auto getDefaultWinId ()
 
static QByteArray getWinLocaleName (LCID id=LOCALE_USER_DEFAULT)
 
static QString fourDigitYear (int year)
 
static const char * winLangCodeToIsoName (int code)
 
LCID qt_inIsoNametoLCID (const char *name)
 
static QString winIso639LangName (LCID id)
 
static QString winIso3116CtryName (LCID id)
 
Q_CORE_EXPORT QLocale qt_localeFromLCID (LCID id)
 

Variables

static constexpr WindowsToISOListElt windows_to_iso_list []
 

Macro Definition Documentation

◆ LOCALE_SNATIVECOUNTRYNAME

#define LOCALE_SNATIVECOUNTRYNAME   0x00000008

Definition at line 88 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::nativeTerritoryName().

◆ LOCALE_SNATIVELANGUAGENAME

#define LOCALE_SNATIVELANGUAGENAME   0x00000004

Definition at line 85 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::nativeLanguageName().

◆ LOCALE_SSHORTESTDAYNAME1

#define LOCALE_SSHORTESTDAYNAME1   0x0060

Definition at line 76 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTESTDAYNAME2

#define LOCALE_SSHORTESTDAYNAME2   0x0061

Definition at line 77 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTESTDAYNAME3

#define LOCALE_SSHORTESTDAYNAME3   0x0062

Definition at line 78 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTESTDAYNAME4

#define LOCALE_SSHORTESTDAYNAME4   0x0063

Definition at line 79 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTESTDAYNAME5

#define LOCALE_SSHORTESTDAYNAME5   0x0064

Definition at line 80 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTESTDAYNAME6

#define LOCALE_SSHORTESTDAYNAME6   0x0065

Definition at line 81 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTESTDAYNAME7

#define LOCALE_SSHORTESTDAYNAME7   0x0066

Definition at line 82 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::dayName().

◆ LOCALE_SSHORTTIME

#define LOCALE_SSHORTTIME   0x00000079

◆ MUI_LANGUAGE_NAME

#define MUI_LANGUAGE_NAME   0x8

Definition at line 73 of file qlocale_win.cpp.

Referenced by QSystemLocalePrivate::uiLanguages().

Function Documentation

◆ fourDigitYear()

static QString fourDigitYear ( int year)
static

Definition at line 441 of file qlocale_win.cpp.

References QStringLiteral.

◆ getDefaultWinId()

static auto getDefaultWinId ( )
static

Definition at line 52 of file qlocale_win.cpp.

References QString::fromUtf8(), and scanLangEnv().

Referenced by QSystemLocalePrivate::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWinLocaleName()

static QByteArray getWinLocaleName ( LCID id = LOCALE_USER_DEFAULT)
static

Definition at line 1153 of file qlocale_win.cpp.

References QString::isEmpty(), scanLangEnv(), QString::toLatin1(), winIso3116CtryName(), winIso639LangName(), and winLangCodeToIsoName().

Referenced by qt_localeFromLCID().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_inIsoNametoLCID()

LCID qt_inIsoNametoLCID ( const char * name)

Definition at line 1079 of file qlocale_win.cpp.

References i, and windows_to_iso_list.

◆ qt_localeFromLCID()

Q_CORE_EXPORT QLocale qt_localeFromLCID ( LCID id)

Definition at line 1175 of file qlocale_win.cpp.

References QString::fromLatin1(), and getWinLocaleName().

Referenced by QWindowsInputContext::handleInputLanguageChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scanLangEnv()

static auto scanLangEnv ( )
static

Definition at line 34 of file qlocale_win.cpp.

References QByteArray::data(), QString::fromLocal8Bit(), QByteArray(), qgetenv(), qstrntoll(), qt_splitLocaleName(), R, and QByteArray::size().

Referenced by getDefaultWinId(), and getWinLocaleName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ winIso3116CtryName()

static QString winIso3116CtryName ( LCID id)
static

Definition at line 1142 of file qlocale_win.cpp.

References QString::fromWCharArray(), and out.

Referenced by getWinLocaleName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ winIso639LangName()

static QString winIso639LangName ( LCID id)
static

Definition at line 1107 of file qlocale_win.cpp.

References QByteArray::data(), QString::fromWCharArray(), i, out, qstrntoull(), and QByteArray::size().

Referenced by getWinLocaleName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ winLangCodeToIsoName()

static const char * winLangCodeToIsoName ( int code)
static

Definition at line 1059 of file qlocale_win.cpp.

References it, and windows_to_iso_list.

Referenced by getWinLocaleName().

+ Here is the caller graph for this function:

Variable Documentation

◆ windows_to_iso_list

constexpr WindowsToISOListElt windows_to_iso_list[]
staticconstexpr

Definition at line 945 of file qlocale_win.cpp.

Referenced by qt_inIsoNametoLCID(), and winLangCodeToIsoName().