Why do you check was_open so many times in CryptoFactory::decryptData function implementation?
If file.open(QIODevice::OpenModeFlag::ReadOnly) succeeds, you need to set was_open to true. I am not very familiar with Qt, so take my word with a grain of salt.