WIP: Qt6 transition
Transition to Qt6. A work in progress. Continues the work from: https://github.com/keepassxreboot/keepassxc/pull/7783
Fixes #7774.
TODO:
- [ ] Test Auto-Type with macOS
- [ ] Test with Windows
- [ ] Test with Linux
- [ ] Test with macOS
- [x] MacPasteBoard
- [ ] Fix FdoSecrets
- [x] QXmlWriter::setCodec() no longer exists. UTF-16 support is needed in SSHAgent. Affects to TextStream also.
Tests failing locally:
- [ ] TestAutoType (at least on macOS)
- [ ] TestCli
- [ ] TestKdbx4
- [ ] TestKeePass2Format
- [x] TestOpenSSHKey
- [x] TestPasskeys
- [x] TestSSHAgent
Type of change
- ✅ Refactor (significant modification to existing code)
There is still lot to fix. One main headache is related to how QByteArray's are handled in Qt6: https://doc.qt.io/qt-6/qstring.html#QString-9. This breaks Base32 among other classes.
Note: : any null ('\0') bytes in the byte array will be included in this string, converted to Unicode null characters (U+0000). This behavior is different from Qt 5.x.
The easiest way to deal this is to replace QString(byteArray) calls with QString(byteArray.toStdString().c_str()) but it's not very convenient. Although it's mostly used in tests, we should make sure there are no places where this is actually used with some relevant data.
If we need to convert a non-string byte array (as in actual raw bytes) to qstring for comparison or printing, then we should convert it to hex or base64 first. Ideally we would just compare with the desired bytestring though.
If we need to convert a non-string byte array (as in actual raw bytes) to qstring for comparison or printing, then we should convert it to hex or base64 first. Ideally we would just compare with the desired bytestring though.
QString::fromUtf8() is the most problematic one here. It's used in multiple relevant places, like in KeePassReader classes. Even after changing those, the tests fail. There's also something strange about the Endian functions. Currently I'm out of ideas.
Is this still gradually moving or got stuck?
Want to merge other major refactoring first