MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / qStringToWCharArray

Function qStringToWCharArray

src/Gui/FileDialogWin32.cpp:92–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90using namespace Gui::FileDialogInternal;
91
92static std::unique_ptr<wchar_t[]> qStringToWCharArray(const QString& s, size_t reserveSize = 0)
93{
94 const size_t stringSize = s.size();
95 wchar_t* result = new wchar_t[qMax(stringSize + 1, reserveSize)];
96 s.toWCharArray(result);
97 result[stringSize] = 0;
98 return std::unique_ptr<wchar_t[]>(result);
99}
100
101/* The legacy Get{Open,Save}FileNameW() functions never change how the file filters are
102 * displayed, inherently avoiding the problem in issue #23139.

Callers 2

legacyNativeFileDialogFunction · 0.85
nativeFileDialogMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected