| 213 | } |
| 214 | |
| 215 | QString 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 | |
| 231 | QDir appDir() { |
| 232 | QDir appDir = qApp->applicationDirPath(); |
no outgoing calls
no test coverage detected