44 #ifndef QT_NO_FILEDIALOG 52 #include <private/qapplication_p.h> 53 #include <private/qfiledialog_p.h> 54 #include <private/qt_mac_p.h> 55 #include <private/qt_cocoa_helpers_mac_p.h> 66 #import <AppKit/NSSavePanel.h> 67 #include "ui_qfiledialog.h" 88 @interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
89 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 90 : NSObject<NSOpenSavePanelDelegate>
96 NSOpenPanel *mOpenPanel;
118 - (NSString *)strip:(const
QString &)label;
119 - (BOOL)panel:(
id)sender shouldShowFilename:(NSString *)filename;
120 - (void)filterChanged:(
id)sender;
121 - (void)showModelessPanel;
122 - (BOOL)runApplicationModalPanel;
123 - (void)showWindowModalSheet:(
QWidget *)docWidget;
124 - (void)updateProperties;
127 - (void)createTextField;
128 - (void)createPopUpButton:(const
QString &)selectedFilter hideDetails:(BOOL)hideDetails;
130 - (void)createAccessory;
134 @implementation QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
138 hideNameFilterDetails:(
bool)hideNameFilterDetails
142 selectFile:(const
QString &)selectFile
143 confirmOverwrite:(
bool)confirm
148 mAcceptMode = acceptMode;
150 mOpenPanel = [NSOpenPanel openPanel];
151 mSavePanel = mOpenPanel;
153 mSavePanel = [NSSavePanel savePanel];
157 if ([mSavePanel respondsToSelector:
@selector(setLevel:)])
158 [
mSavePanel setLevel:NSModalPanelWindowLevel];
162 mFileMode = fileMode;
163 mConfirmOverwrite = confirm;
166 mLastFilterCheckPath =
new QString;
170 mSelectedNameFilter =
new QStringList([
self findStrippedFilterWithVisualFilterName:selectedVisualNameFilter]);
174 mCurrentDir = [qt_mac_QStringToNSString(sel.absoluteFilePath()) retain];
175 mCurrentSelection =
new QString;
177 mCurrentDir = [qt_mac_QStringToNSString(sel.absolutePath()) retain];
181 [
mSavePanel setTitle:qt_mac_QStringToNSString(title)];
185 [
mSavePanel setAccessoryView:mNameFilterDropDownList->size() > 1 ? mAccessoryView : nil];
189 if (mPriv->fileNameLabelExplicitlySat)
190 [
mSavePanel setNameFieldLabel:[
self strip:mPriv->qFileDialogUi->fileNameLabel->text()]];
202 delete mLastFilterCheckPath;
203 delete mQDirFilterEntryList;
204 delete mNameFilterDropDownList;
205 delete mSelectedNameFilter;
206 delete mCurrentSelection;
208 if ([mSavePanel respondsToSelector:
@selector(orderOut:)])
209 [mSavePanel orderOut:mSavePanel];
223 return qt_mac_QStringToNSString(a.
iconText());
229 if ([mSavePanel respondsToSelector:
@selector(close)])
231 if ([mSavePanel isSheet])
232 [NSApp endSheet: mSavePanel];
235 - (void)showModelessPanel
242 || [
self panel:nil shouldShowFilename:filepath];
244 beginForDirectory:mCurrentDir
245 file:selectable ? filename : nil
247 modelessDelegate:self
248 didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
253 - (BOOL)runApplicationModalPanel
259 || [
self panel:nil shouldShowFilename:filepath];
261 runModalForDirectory:mCurrentDir
262 file:selectable ? filename : @"untitled"];
265 return (mReturnCode == NSOKButton);
273 - (void)showWindowModalSheet:(
QWidget *)docWidget
280 || [
self panel:nil shouldShowFilename:filepath];
282 beginSheetForDirectory:mCurrentDir
283 file:selectable ? filename : nil
284 #ifdef QT_MAC_USE_COCOA
285 modalForWindow:QT_PREPEND_NAMESPACE(qt_mac_window_for)(docWidget)
290 didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
294 - (BOOL)isHiddenFile:(NSString *)filename isDir:(BOOL)isDir
296 #ifdef QT_MAC_USE_COCOA 297 CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (
CFStringRef)filename, kCFURLPOSIXPathStyle, isDir);
298 CFBooleanRef isHidden;
300 if (!CFURLCopyResourcePropertyForKey(url, kCFURLIsHiddenKey, &isHidden, NULL)) {
301 errorOrHidden =
true;
303 if (CFBooleanGetValue(isHidden))
304 errorOrHidden =
true;
308 return errorOrHidden;
316 - (BOOL)panel:(
id)sender shouldShowFilename:(NSString *)filename
320 if ([filename length] == 0)
324 NSFileManager *fm = [NSFileManager defaultManager];
325 NSDictionary *fileAttrs = [fm attributesOfItemAtPath:filename error:nil];
328 NSString *fileType = [fileAttrs fileType];
329 bool isDir = [fileType isEqualToString:NSFileTypeDirectory];
331 if ([mSavePanel treatsFilePackagesAsDirectories] == NO) {
332 if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename] == NO)
340 bool nameMatches = mSelectedNameFilter->
isEmpty();
342 for (
int i = 0; !nameMatches && i < mSelectedNameFilter->size(); ++i) {
343 if (
QDir::match(mSelectedNameFilter->at(i), qtFileName))
349 QDir::Filters filter = *mQDirFilter;
351 || (!(filter &
QDir::Files) && [fileType isEqualToString:NSFileTypeRegular])
352 || ((filter &
QDir::NoSymLinks) && [fileType isEqualToString:NSFileTypeSymbolicLink]))
357 if (filterPermissions) {
358 if ((!(filter &
QDir::Readable) && [fm isReadableFileAtPath:filename])
359 || (!(filter &
QDir::Writable) && [fm isWritableFileAtPath:filename])
370 - (NSString *)panel:(
id)sender userEnteredFilename:(NSString *)filename confirmed:(BOOL)okFlag
375 if (mConfirmOverwrite)
380 return [@"___qt_very_unlikely_prefix_" stringByAppendingString:filename];
386 *mNameFilterDropDownList =
filters;
388 for (
int i=0; i<
filters.size(); ++i) {
390 [
mPopUpButton addItemWithTitle:QT_PREPEND_NAMESPACE(qt_mac_QStringToNSString)(filter)];
400 - (void)filterChanged:(
id)sender
404 QString selection = mNameFilterDropDownList->value([mPopUpButton indexOfSelectedItem]);
406 if ([mSavePanel respondsToSelector:
@selector(validateVisibleColumns)])
410 mPriv->QNSOpenSavePanelDelegate_filterSelected([mPopUpButton indexOfSelectedItem]);
415 return mNameFilterDropDownList->value([mPopUpButton indexOfSelectedItem]);
430 - (void)updateProperties
441 [mOpenPanel setCanChooseFiles:!chooseDirsOnly];
442 [mOpenPanel setCanChooseDirectories:!chooseFilesOnly];
443 [
mSavePanel setCanCreateDirectories:!(*mFileOptions & QT_PREPEND_NAMESPACE(QFileDialog::ReadOnly))];
444 [mOpenPanel setAllowsMultipleSelection:(mFileMode == QT_PREPEND_NAMESPACE(QFileDialog::ExistingFiles))];
445 [mOpenPanel setResolvesAliases:!(*mFileOptions & QT_PREPEND_NAMESPACE(QFileDialog::DontResolveSymlinks))];
448 if (mPriv && !ext.
isEmpty() && !mPriv->defaultSuffix.isEmpty())
449 ext.
prepend(mPriv->defaultSuffix);
450 [
mSavePanel setAllowedFileTypes:ext.isEmpty() ? nil : QT_PREPEND_NAMESPACE(qt_mac_QStringListToNSMutableArray(ext))];
452 if ([mSavePanel respondsToSelector:
@selector(isVisible)] && [mSavePanel isVisible])
454 if ([mOpenPanel respondsToSelector:
@selector(validateVisibleColumns)])
455 [mOpenPanel validateVisibleColumns];
459 - (void)panelSelectionDidChange:(
id)sender
464 if (selection != mCurrentSelection) {
465 *mCurrentSelection = selection;
466 mPriv->QNSOpenSavePanelDelegate_selectionChanged(selection);
471 - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(
void *)contextInfo
475 mReturnCode = returnCode;
477 mPriv->QNSOpenSavePanelDelegate_panelClosed(returnCode == NSOKButton);
480 - (void)panel:(
id)sender directoryDidChange:(NSString *)path
485 if ([path isEqualToString:mCurrentDir])
488 if ([mSavePanel respondsToSelector:
@selector(isVisible)] && ![mSavePanel isVisible])
490 [mCurrentDir release];
491 mCurrentDir = [path retain];
492 mPriv->QNSOpenSavePanelDelegate_directoryEntered(
QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString(mCurrentDir)));
504 for (
int i=0; i<mSelectedNameFilter->count(); ++i) {
505 const QString &filter = mSelectedNameFilter->
at(i);
509 result += filter.
mid(2);
520 if (regExp.
indexIn(filter) != -1)
525 - (void)createTextField
527 NSRect textRect = { { 0.0, 3.0 }, { 100.0, 25.0 } };
528 mTextField = [[NSTextField alloc] initWithFrame:textRect];
529 [[
mTextField cell] setFont:[NSFont systemFontOfSize:
530 [NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
531 [
mTextField setAlignment:NSRightTextAlignment];
537 [
mTextField setStringValue:[
self strip:mPriv->qFileDialogUi->fileTypeLabel->text()]];
539 [
mTextField setStringValue:QT_PREPEND_NAMESPACE(qt_mac_QStringToNSString)(QT_PREPEND_NAMESPACE(QFileDialog::tr)("Files of type:"))];
542 - (void)createPopUpButton:(const
QString &)selectedFilter hideDetails:(BOOL)hideDetails
544 NSRect popUpRect = { { 100.0, 5.0 }, { 250.0, 25.0 } };
545 mPopUpButton = [[NSPopUpButton alloc] initWithFrame:popUpRect pullsDown:NO];
549 if (mNameFilterDropDownList->size() > 0) {
550 int filterToUse = -1;
551 for (
int i=0; i<mNameFilterDropDownList->size(); ++i) {
552 QString currentFilter = mNameFilterDropDownList->
at(i);
553 if (selectedFilter == currentFilter ||
554 (filterToUse == -1 && currentFilter.
startsWith(selectedFilter)))
557 [
mPopUpButton addItemWithTitle:QT_PREPEND_NAMESPACE(qt_mac_QStringToNSString)(filter)];
559 if (filterToUse != -1)
566 for (
int i=0; i<mNameFilterDropDownList->size(); ++i) {
567 if (mNameFilterDropDownList->at(i).startsWith(name))
573 - (void)createAccessory
575 NSRect accessoryRect = { { 0.0, 0.0 }, { 450.0, 33.0 } };
576 mAccessoryView = [[NSView alloc] initWithFrame:accessoryRect];
587 emit q_func()->currentChanged(newPath);
600 setLastVisitedDirectory(newDir);
601 emit q_func()->directoryEntered(newDir);
606 emit q_func()->filterSelected(nameFilters.at(menuIndex));
611 #ifndef QT_MAC_USE_COCOA 612 if (directory == mCurrentLocation)
614 mCurrentLocation = directory;
615 emit q_func()->directoryEntered(mCurrentLocation);
620 if (AECreateDesc(typeFSRef, &fsRef,
sizeof(FSRef), &desc) == noErr)
621 NavCustomControl(mDialog, kNavCtlSetLocation, (
void*)&desc);
626 [delegate->mSavePanel setDirectory:qt_mac_QStringToNSString(directory)];
632 #ifndef QT_MAC_USE_COCOA 633 return mCurrentLocation;
637 return qt_mac_NSStringToQString([delegate->mSavePanel directory]);
647 #ifndef QT_MAC_USE_COCOA 650 mCurrentSelectionList.
clear();
651 mCurrentSelectionList << filename;
652 if (mCurrentSelection != filename){
653 mCurrentSelection = filename;
654 emit q_func()->currentChanged(mCurrentSelection);
658 if (AECreateList(0, 0,
false, &descList) != noErr)
664 if (AECreateDesc(typeFSRef, &fsRef,
sizeof(FSRef), &desc) == noErr){
665 if (AEPutDesc(&descList, 0, &desc) == noErr)
666 NavCustomControl(mDialog, kNavCtlSetSelection, (
void*)&descList);
671 UInt8 *strBuffer = (UInt8 *)malloc(1024);
673 NavCustomControl(mDialog, kNavCtlSetEditFileName, strBuffer);
678 setDirectory_sys(
QFileInfo(filePath).absolutePath());
684 #ifndef QT_MAC_USE_COCOA 686 return mCurrentSelectionList;
694 return [delegate selectedFiles];
700 #ifndef QT_MAC_USE_COCOA 706 [delegate setNameFilters:filters hideDetails:hideDetails];
712 #ifndef QT_MAC_USE_COCOA 717 *(delegate->mQDirFilter) = model->filter();
718 delegate->mFileMode = fileMode;
719 [delegate->mSavePanel setTitle:qt_mac_QStringToNSString(q->windowTitle())];
720 [delegate->mSavePanel setPrompt:[delegate strip:acceptLabel]];
721 if (fileNameLabelExplicitlySat)
722 [delegate->mSavePanel setNameFieldLabel:[delegate strip:qFileDialogUi->fileNameLabel->text()]];
724 [delegate updateProperties];
730 int index = nameFilters.indexOf(filter);
732 #ifndef QT_MAC_USE_COCOA 733 NavMenuItemSpec navSpec;
734 bzero(&navSpec,
sizeof(NavMenuItemSpec));
735 navSpec.menuType =
index;
736 NavCustomControl(mDialog, kNavCtlSelectCustomType, &navSpec);
740 [delegate->mPopUpButton selectItemAtIndex:index];
741 [delegate filterChanged:nil];
748 #ifndef QT_MAC_USE_COCOA 749 int index = filterInfo.currentSelection;
753 int index = [delegate->mPopUpButton indexOfSelectedItem];
755 return index != -1 ? nameFilters.at(index) :
QString();
760 #ifndef QT_MAC_USE_COCOA 762 NavDialogDispose(mDialog);
764 mDialogStarted =
false;
767 [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate) release];
770 nativeDialogInUse =
false;
776 if (!visible == q->isHidden())
787 #ifndef QT_MAC_USE_COCOA 788 return visible ? showCarbonNavServicesDialog() : hideCarbonNavServicesDialog();
790 return visible ? showCocoaFilePanel() : hideCocoaFilePanel();
794 #ifndef QT_MAC_USE_COCOA 796 void *
data, NavFilterModes)
806 NavFileOrFolderInfo *theInfo =
static_cast<NavFileOrFolderInfo *
>(
info);
811 if (theItem->descriptorType == typeFSRef) {
813 AEGetDescData(theItem, &ref,
sizeof(ref));
814 UInt8 str_buffer[1024];
815 FSRefMakePath(&ref, str_buffer, 1024);
826 #ifdef DEBUG_FILEDIALOG_FILTERS 827 qDebug(
"QFileDialogPrivate::qt_mac_filedialog_filter_proc:%d, asked to filter.. %s (%s)", __LINE__,
834 if (theInfo->isFolder) {
835 if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:qt_mac_QStringToNSString(path)])
843 NavCBRecPtr p, NavCallBackUserData
data)
848 case kNavCBPopupMenuSelect: {
849 NavMenuItemSpec *s =
static_cast<NavMenuItemSpec *
>(p->eventData.eventDataParms.param);
852 emit fileDialogPrivate->q_func()->filterSelected(fileDialogPrivate->
nameFilters.
at(s->menuType));
868 #ifdef DEBUG_FILEDIALOG_FILTERS 869 qDebug(
"QFileDialogPrivate::qt_mac_filedialog_event_proc:%d - Selected a filter: %ld", __LINE__, s->menuType);
884 case kNavCBSelectEntry:{
892 UInt8 strBuffer[1024];
894 OSErr err = AECountItems(descList, &count);
895 if (err != noErr || !count)
900 err = AEGetNthPtr(descList,
index, typeFSRef, 0, 0, &ref,
sizeof(ref), 0);
903 FSRefMakePath(&ref, strBuffer, 1024);
906 if (!prevSelectionList.
contains(selected))
907 fileNameToEmit = selected;
911 emit fileDialogPrivate->q_func()->currentChanged(fileNameToEmit);
914 case kNavCBShowDesktop:
915 case kNavCBNewLocation:{
917 AEDesc *desc = (AEDesc *)p->eventData.eventDataParms.param;
919 AEGetDescData(desc, &ref,
sizeof(ref));
920 UInt8 *strBuffer = (UInt8 *)malloc(1024);
921 FSRefMakePath(&ref, strBuffer, 1024);
938 emit fileDialogPrivate->q_func()->directoryEntered(newLocation);
943 fileDialogPrivate->q_func()->accept();
947 fileDialogPrivate->q_func()->reject();
976 #ifdef DEBUG_FILEDIALOG_FILTERS 977 qDebug(
"QFileDialog:%d - Got filter (%s)", __LINE__, filter.latin1());
989 #ifdef DEBUG_FILEDIALOG_FILTERS 990 qDebug(
"QFileDialog:%d Split out filter (%d) '%s' '%s' [%s]", __LINE__, ret.count(),
991 filter->regxp.latin1(), filter->
description.latin1(), (*it).latin1());
1002 deleteNativeDialog_sys();
1004 NavDialogCreationOptions navOptions;
1005 NavGetDefaultDialogCreationOptions(&navOptions);
1009 navOptions.modality = kWindowModalityWindowModal;
1012 navOptions.modality = kWindowModalityAppModal;
1014 navOptions.modality = kWindowModalityNone;
1015 navOptions.optionFlags |= kNavSupportPackages;
1017 navOptions.optionFlags |= kNavDontConfirmReplacement;
1019 navOptions.optionFlags &= ~kNavAllowMultipleFiles;
1023 navOptions.location.h = -1;
1024 navOptions.location.v = -1;
1030 parent = parent->
window();
1035 filterInfo.currentSelection = 0;
1038 if (filterInfo.filters.size() > 1) {
1041 * filterInfo.filters.size()));
1042 for (i = 0; i < filterInfo.filters.size(); ++i) {
1045 filterArray = CFArrayCreate(kCFAllocatorDefault,
1046 reinterpret_cast<const void **>(cfstringArray), filterInfo.filters.size(),
1047 &kCFTypeArrayCallBacks);
1048 navOptions.popupExtension = filterArray;
1049 free(cfstringArray);
1053 if (NavCreatePutFileDialog(&navOptions,
'cute', kNavGenericSignature,
1055 qDebug(
"Shouldn't happen %s:%d", __FILE__, __LINE__);
1059 if (NavCreateChooseFolderDialog(&navOptions,
1061 qDebug(
"Shouldn't happen %s:%d", __FILE__, __LINE__);
1065 if (NavCreateGetFileDialog(&navOptions, 0,
1068 qDebug(
"Shouldn't happen %s:%d", __FILE__, __LINE__);
1074 if (mCurrentLocation.isEmpty())
1075 mCurrentLocation = rootPath();
1079 if (AECreateDesc(typeFSRef, &fsRef,
sizeof(FSRef), &desc) == noErr)
1080 NavCustomControl(mDialog, kNavCtlSetLocation, (
void*)&desc);
1089 createNavServicesDialog();
1090 mDialogClosed =
false;
1092 NavDialogRun(mDialog);
1098 if (!mDialogClosed){
1099 mDialogClosed =
true;
1100 NavCustomControl(mDialog, kNavCtlCancel, 0);
1113 bool selectDir = q->selectedFiles().isEmpty();
1114 QString selection(selectDir ? q->directory().absolutePath() : q->selectedFiles().value(0));
1116 initWithAcceptMode:acceptMode
1117 title:q->windowTitle()
1118 hideNameFilterDetails:q->testOption(QFileDialog::HideNameFilterDetails)
1119 qDirFilter:model->filter()
1122 selectFile:selection
1123 confirmOverwrite:!q->testOption(QFileDialog::DontConfirmOverwrite)
1126 mDelegate = delegate;
1129 bool QFileDialogPrivate::showCocoaFilePanel()
1133 createNSOpenSavePanelDelegate();
1136 [delegate showWindowModalSheet:q->parentWidget()];
1138 [delegate showModelessPanel];
1142 bool QFileDialogPrivate::hideCocoaFilePanel()
1151 [delegate closePanel];
1169 if (nativeDialogInUse){
1178 #ifndef QT_MAC_USE_COCOA 1179 NavDialogRun(mDialog);
1184 [delegate runApplicationModalPanel];
1191 #ifndef QT_MAC_USE_COCOA 1192 NavUserAction result = NavDialogGetUserAction(mDialog);
1193 if (result == kNavUserActionCancel || result == kNavUserActionNone)
1199 return [delegate dialogResultCode];
1206 #endif // QT_NO_FILEDIALOG The QDir class provides access to directory structures and their contents.
void createPopUpButton:hideDetails:(const QString &selectedFilter, [hideDetails] BOOL hideDetails)
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QFileDialogPrivate::QtMacFilterName qt_mac_extract_filter(const QString &rawFilter, bool showDetails)
const struct __CFString * CFStringRef
const char * qt_file_dialog_filter_reg_exp
::QDir::Filters * mQDirFilter
::QFileDialog::Options * mFileOptions
virtual void interrupt()=0
Interrupts event dispatching; i.
void createNSOpenSavePanelDelegate()
static mach_timebase_info_data_t info
static bool match(const QStringList &filters, const QString &fileName)
Returns true if the fileName matches any of the wildcard (glob) patterns in the list of filters; othe...
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
#define QT_END_NAMESPACE
This macro expands to.
void filterChanged:(id sender)
QDialog::DialogCode dialogResultCode_sys()
const QChar at(int i) const
Returns the character at the given index position in the string.
QStringList qt_make_filter_list(const QString &filter)
bool showCarbonNavServicesDialog()
The QRegExp class provides pattern matching using regular expressions.
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QString mCurrentSelection
void QNSOpenSavePanelDelegate_directoryEntered(const QString &newDir)
#define it(className, varName)
static QAbstractEventDispatcher * instance(QThread *thread=0)
Returns a pointer to the event dispatcher object for the specified thread.
QFileDialog::AcceptMode acceptMode
QString removeExtensions:(const QString &filter)
QString & replace(int i, int len, QChar after)
void selectFile_sys(const QString &filename)
bool qt_mac_is_macsheet(const QWidget *w)
int length() const
Returns the number of characters in this string.
QStringList * mNameFilterDropDownList
QString fileName() const
Returns the name of the file, excluding the path.
static CFStringRef toCFStringRef(const QString &str)
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QStringList * mQDirFilterEntryList
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
static QString toQString(CFStringRef cfstr)
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
NSString * strip:(const QString &label)
QString absoluteFilePath() const
Returns an absolute path including the file name.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
void QNSOpenSavePanelDelegate_panelClosed(bool accepted)
NSPopUpButton * mPopUpButton
static bool isRelativePath(const QString &path)
Returns true if path is relative; returns false if it is absolute.
The QString class provides a Unicode character string.
The QFileDialog class provides a dialog that allow users to select files or directories.
QStringList mCurrentSelectionList
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
OSWindowRef qt_mac_window_for(const QWidget *)
OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref)
void QNSOpenSavePanelDelegate_selectionChanged(const QString &newPath)
QStringList typedFiles() const
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_FORWARD_DECLARE_CLASS(name)
friend class const_iterator
QStringList findStrippedFilterWithVisualFilterName:(QString name)
void _q_macRunNativeAppModalPanel()
QStringList acceptableExtensionsForSave()
#define QT_BEGIN_NAMESPACE
This macro expands to.
QString completeBaseName() const
Returns the complete base name of the file without the path.
static void qt_mac_filedialog_event_proc(const NavEventCallbackMessage msg, NavCBRecPtr p, NavCallBackUserData data)
void QNSOpenSavePanelDelegate_filterSelected(int menuIndex)
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory; otherwise ret...
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
void mac_nativeDialogModalHelp()
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QList< QtMacFilterName > filters
static Boolean qt_mac_filedialog_filter_proc(AEDesc *theItem, void *info, void *data, NavFilterModes)
void prepend(const T &t)
Inserts value at the beginning of the list.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
void createNavServicesDialog()
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
::QFileDialog::AcceptMode mAcceptMode
QString directory_sys() const
QFileDialog::FileMode fileMode
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
void selectNameFilter_sys(const QString &filter)
QString right(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n rightmost characters of the string.
T value(int i) const
Returns the value at index position i in the list.
void clear()
Removes all items from the list.
QString selectedNameFilter_sys() const
QStringList selectedFiles_sys() const
T & first()
Returns a reference to the first item in the list.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
static const char *const filters[3]
FileMode
This enum is used to indicate what the user may select in the file dialog; i.
void clear()
Clears the contents of the string and makes it empty.
#define QT_MANGLE_NAMESPACE(name)
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
bool singleShot
This static function calls a slot after a given time interval.
if(void) toggleToolbarShown
QStringList * mSelectedNameFilter
static bool native_modal_dialog_active
QFuture< void > filter(Sequence &sequence, FilterFunction filterFunction)
QString * mLastFilterCheckPath
void deleteNativeDialog_sys()
QString iconText
the action's descriptive icon text
#define QT_USE_NAMESPACE
This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined and nothing otherwise.
bool exactMatch(const QString &str) const
Returns true if str is matched exactly by this regular expression; otherwise returns false...
bool isBundle() const
Returns true if this object points to a bundle or to a symbolic link to a bundle on Mac OS X; otherwi...
DialogCode
The value returned by a modal dialog.
void setLastVisitedDirectory(const QString &dir)
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
static QList< QFileDialogPrivate::QtMacFilterName > qt_mac_make_filters_list(const QString &filter, bool showDetails)
struct QFileDialogPrivate::QtMacNavFilterInfo filterInfo
void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding, int len)
QString * mCurrentSelection
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
bool hideCarbonNavServicesDialog()
The QFileInfo class provides system-independent file information.
void setNameFilters_sys(const QStringList &filters)
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
QStringList qt_clean_filter_list(const QString &filter)
void setDirectory_sys(const QString &directory)
#define qPrintable(string)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QString fileName(const QString &fileUrl)
QStringList qt_mac_NSArrayToQStringList(void *nsarray)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
The QAction class provides an abstract user interface action that can be inserted into widgets...
QFileDialogPrivate * mPriv
QScopedPointer< Ui_QFileDialog > qFileDialogUi
::QFileDialog::FileMode mFileMode
bool setVisible_sys(bool visible)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...