MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / randomString

Function randomString

gui/qt/utils.cpp:215–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215QString randomString(const int length) {
216 const QString possibleCharacters(QStringLiteral("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"));
217
218 QString randomString;
219 for(int i=0; i<length; ++i) {
220#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
221 int index = QRandomGenerator::global()->generate() % possibleCharacters.length();
222#else
223 int index = qrand() % possibleCharacters.length();
224#endif
225 QChar nextChar = possibleCharacters.at(index);
226 randomString.append(nextChar);
227 }
228 return randomString;
229}
230
231QDir appDir() {
232 QDir appDir = qApp->applicationDirPath();

Callers 6

mouseMoveEventMethod · 0.85
MainWindowMethod · 0.85
ipcSpawnMethod · 0.85
stateAddNewMethod · 0.85
gotoMemAddrNoRaiseMethod · 0.85
mousePressEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected