On Linux, Qt creates the following files in the /tmp directory when using QSharedMemory:
qipc_sharedmemory_mysharedmem5ffa537fd8798875c98e190df289da7e047c05
qipc_systemsem_mysharedmem5ffa537fd8798875c98e190df289da7e047c05
I have come across a problem where two different versions of the same software use two different locations for these files, making them incompatible. The "newer" version instead creates these files in the /tmp/username/ directory. I can't seem to figure out what causes this. Is this location defined by Qt itself, and if so, did it change across versions? Or can it somehow be configured by the user, and if so, where and how?
I think you are experiencing a known Qt bug, as reported in the official bug tracker here: https://bugreports.qt.io/browse/QTBUG-60771
Briefly, there was a change between Qt 5.6 and Qt 5.8 in the way QSystemSemaphore (which is used by QSharedMemory) creates its keys. It was discovered that the method used to create the keys may cause collisions.
The incompatibility is documented in the changelog for Qt 5.9 here: https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.9.0/?h=v5.9.0
You may experiment with the QSharedMemory::setNativeKey() method to force your own keys (and thus, file names in the /tmp directory). Although this means you should modify and recompile both versions of your software.
I'm afraid the "official" solution is to ensure you only use one version of Qt at the time.