File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class NATIVE_EXPORT QgsMacNative : public QgsNative
2727
2828 virtual const char *currentAppLocalizedName ();
2929 void currentAppActivateIgnoringOtherApps () override ;
30+ void openFileExplorerAndSelectFile ( const QString &path ) override ;
3031};
3132
3233#endif // QGSMACNATIVE_H
Original file line number Diff line number Diff line change 3434 [[NSRunningApplication currentApplication ] activateWithOptions:
3535 (NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
3636}
37+
38+ void openFileExplorerAndSelectFile ( const QString &path )
39+ {
40+ NSString * pathStr = [[NSString alloc ] initWithUTF8String: path.toUtf8 ().data ()];
41+ NSArray *fileURLs = [NSArray arrayWithObjects: pathStr, /* ... */ nil ];
42+ [[NSWorkspace sharedWorkspace ] activateFileViewerSelectingURLs: fileURLs];
43+ }
You can’t perform that action at this time.
0 commit comments