Commit 9f0f06e
committed
QT, Win32: The QT GUI now compiles on Windows and loading/saving works...
Fix compilation on Windows
QT5: Compiles and works, but the property browser window is broken.
QT6: Compiles but crashes.
Fix file opening and saving on Windows by using `QDir::toNativeSeparators()`
in `Platform::Path GetFilename()` to retrieve the path returned by
`QFileDialog` in a platform-independent way and normalize the file
separators (`/` for Unix-like platforms and `\` for Windows).
Here’s how the returned path differs by platform:
1. **Unix/Linux/macOS**:
- File path: `"/home/user/example/file.slvs"`
- Result of `QDir::toNativeSeparators()`: `"/home/user/example/file.slvs"`
2. **Windows**:
- File path: `"C:/Users/user/example/file.slvs"`
- Result of `QDir::toNativeSeparators()`: `"C:\Users\user\example\file.slvs"`1 parent ac932ab commit 9f0f06e
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
162 | | - | |
| 165 | + | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
| |||
935 | 938 | | |
936 | 939 | | |
937 | 940 | | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
938 | 946 | | |
939 | 947 | | |
940 | 948 | | |
| |||
968 | 976 | | |
969 | 977 | | |
970 | 978 | | |
971 | | - | |
972 | 979 | | |
973 | 980 | | |
974 | 981 | | |
| |||
1044 | 1051 | | |
1045 | 1052 | | |
1046 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
1047 | 1056 | | |
1048 | 1057 | | |
1049 | 1058 | | |
| |||
1053 | 1062 | | |
1054 | 1063 | | |
1055 | 1064 | | |
| 1065 | + | |
1056 | 1066 | | |
1057 | 1067 | | |
1058 | 1068 | | |
| |||
0 commit comments