Commit 45102c1
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 45102c1
1 file changed
Lines changed: 11 additions & 1 deletion
| 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 | | |
| |||
1044 | 1052 | | |
1045 | 1053 | | |
1046 | 1054 | | |
| 1055 | + | |
1047 | 1056 | | |
1048 | 1057 | | |
1049 | 1058 | | |
| |||
1053 | 1062 | | |
1054 | 1063 | | |
1055 | 1064 | | |
| 1065 | + | |
1056 | 1066 | | |
1057 | 1067 | | |
1058 | 1068 | | |
| |||
0 commit comments