Qt 4.8
Classes | Public Functions | Static Public Functions | Public Variables | List of all members
QFileDialogPrivate Class Reference

#include <qfiledialog_p.h>

Inheritance diagram for QFileDialogPrivate:
QDialogPrivate QWidgetPrivate QObjectPrivate QObjectData

Classes

struct  QtMacFilterName
 
struct  QtMacNavFilterInfo
 

Public Functions

void _q_autoCompleteFileName (const QString &)
 
void _q_createDirectory ()
 Creates a new directory, first asking the user for a suitable name. More...
 
void _q_currentChanged (const QModelIndex &index)
 
void _q_deleteCurrent ()
 Deletes the currently selected item in the dialog. More...
 
void _q_enterDirectory (const QModelIndex &index)
 This is called when the user double clicks on a file with the corresponding model item index. More...
 
void _q_fileRenamed (const QString &path, const QString oldName, const QString newName)
 
void _q_goHome ()
 
void _q_goToDirectory (const QString &)
 Changes the file dialog's current directory to the one specified by path. More...
 
void _q_goToUrl (const QUrl &url)
 
void _q_macRunNativeAppModalPanel ()
 
void _q_navigateBackward ()
 Navigates to the last directory viewed in the dialog. More...
 
void _q_navigateForward ()
 Navigates to the last directory viewed in the dialog. More...
 
void _q_navigateToParent ()
 Navigates to the parent directory of the currently displayed directory in the dialog. More...
 
void _q_pathChanged (const QString &)
 
void _q_renameCurrent ()
 
void _q_rowsInserted (const QModelIndex &parent)
 When parent is root and rows have been inserted when none was there before then select the first one. More...
 
void _q_selectionChanged ()
 This is called when the model index corresponding to the current file is changed from index to current. More...
 
void _q_showContextMenu (const QPoint &position)
 
void _q_showDetailsView ()
 
void _q_showHeader (QAction *)
 
void _q_showHidden ()
 Includes hidden files and directories in the items displayed in the dialog. More...
 
void _q_showListView ()
 
void _q_updateOkButton ()
 
void _q_useNameFilter (int index)
 Sets the current name filter to be nameFilter and update the qFileDialogUi->fileNameEdit when in AcceptSave mode with the new extension. More...
 
QStringList addDefaultSuffixToFiles (const QStringList filesToFix) const
 
QString basename (const QString &path) const
 
bool canBeNativeDialog ()
 
void createMenuActions ()
 Create actions which will be used in the right click. More...
 
void createNavServicesDialog ()
 
void createNSOpenSavePanelDelegate ()
 
void createToolButtons ()
 
void createWidgets ()
 
QAbstractItemViewcurrentView () const
 
void deleteNativeDialog_sys ()
 
QDialog::DialogCode dialogResultCode_sys ()
 
QString directory_sys () const
 
void emitFilesSelected (const QStringList &files)
 
QDir::Filters filterForMode (QDir::Filters filters) const
 
QString getEnvironmentVariable (const QString &string)
 
bool hideCarbonNavServicesDialog ()
 
void init (const QString &directory=QString(), const QString &nameFilter=QString(), const QString &caption=QString())
 
bool itemViewKeyboardEvent (QKeyEvent *event)
 
QLineEditlineEdit () const
 
void mac_nativeDialogModalHelp ()
 
QModelIndex mapFromSource (const QModelIndex &index) const
 
QModelIndex mapToSource (const QModelIndex &index) const
 
int maxNameLength (const QString &path)
 
 QFileDialogPrivate ()
 
void QNSOpenSavePanelDelegate_directoryEntered (const QString &newDir)
 
void QNSOpenSavePanelDelegate_filterSelected (int menuIndex)
 
void QNSOpenSavePanelDelegate_panelClosed (bool accepted)
 
void QNSOpenSavePanelDelegate_selectionChanged (const QString &newPath)
 
bool removeDirectory (const QString &path)
 
void retranslateStrings ()
 
void retranslateWindowTitle ()
 
QModelIndex rootIndex () const
 
QString rootPath () const
 
QModelIndex select (const QModelIndex &index) const
 
QStringList selectedFiles_sys () const
 
QString selectedNameFilter_sys () const
 
void selectFile_sys (const QString &filename)
 
void selectNameFilter_sys (const QString &filter)
 
void setDirectory_sys (const QString &directory)
 
void setFilter_sys ()
 
void setLastVisitedDirectory (const QString &dir)
 
void setNameFilters_sys (const QStringList &filters)
 
void setRootIndex (const QModelIndex &index) const
 
bool setVisible_sys (bool visible)
 
bool showCarbonNavServicesDialog ()
 
QStringList typedFiles () const
 
 ~QFileDialogPrivate ()
 
- Public Functions inherited from QDialogPrivate
void hideDefault ()
 Hides the default button indicator. More...
 
 QDialogPrivate ()
 
void resetModalitySetByOpen ()
 
void setDefault (QPushButton *)
 This function is called by the push button pushButton when it becomes the default button. More...
 
void setMainDefault (QPushButton *)
 This function sets the default default push button to pushButton. More...
 
- Public Functions inherited from QWidgetPrivate
void _q_showIfNotHidden ()
 
virtual void aboutToDestroy ()
 
void activateChildLayoutsRecursively ()
 
QSize adjustedSize () const
 
void adjustQuitOnCloseAttribute ()
 
QInputContextassignedInputContext () const
 
QPainterbeginSharedPainter ()
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool, bool includeFrame=false) const
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void clipToEffectiveMask (QRegion &region) const
 
bool close_helper (CloseMode mode)
 
void create_sys (WId window, bool initializeWindow, bool destroyOldWindow)
 
QWindowSurfacecreateDefaultWindowSurface ()
 
QWindowSurfacecreateDefaultWindowSurface_sys ()
 
void createExtra ()
 Creates the widget extra data. More...
 
void createRecursively ()
 
void createSysExtra ()
 
void createTLExtra ()
 
void createTLSysExtra ()
 
void createWinId (WId id=0)
 
void deactivateWidgetCleanup ()
 
void deleteExtra ()
 Deletes the widget extra data. More...
 
void deleteSysExtra ()
 
void deleteTLSysExtra ()
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
 
QWidgeteffectiveFocusWidget ()
 
QRect effectiveRectFor (const QRect &rect) const
 
bool endSharedPainter ()
 
void enforceNativeChildren ()
 
QWExtraextraData () const
 
QRect frameStrut () const
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
const QRegiongetOpaqueChildren () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
virtual bool hasHeightForWidth () const
 
void hide_helper ()
 
void hide_sys ()
 Platform-specific part of QWidget::hide(). More...
 
void hideChildren (bool spontaneous)
 
void inheritStyle ()
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
QInputContextinputContext () const
 
void invalidateBuffer (const QRegion &)
 Invalidates the rgn (in widget's coordinates) of the backing store, i.e. More...
 
void invalidateBuffer (const QRect &)
 This function is equivalent to calling invalidateBuffer(QRegion(rect), ...), but is more efficient as it eliminates QRegion operations/allocations and can use the rect more precisely for additional cut-offs. More...
 
void invalidateBuffer_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the buffer when the widget is resized. More...
 
void invalidateGraphicsEffectsRecursively ()
 
bool isAboutToShow () const
 
bool isBackgroundInherited () const
 
bool isOverlapped (const QRect &) const
 
void lower_sys ()
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QWidgetBackingStoremaybeBackingStore () const
 
QTLWExtramaybeTopData () const
 
void moveRect (const QRect &, int dx, int dy)
 
bool nativeChildrenForced () const
 
QFont naturalWidgetFont (uint inheritedMask) const
 
QPalette naturalWidgetPalette (uint inheritedMask) const
 Returns the palette that the widget w inherits from its ancestors and QApplication::palette. More...
 
void paintBackground (QPainter *, const QRegion &, int flags=DrawAsRoot) const
 
bool paintOnScreen () const
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore)
 
bool pointInsideRectAndMask (const QPoint &) const
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void propagatePaletteChange ()
 Propagate this widget's palette to all children, except style sheet widgets, and windows that don't enable window propagation (palettes don't normally propagate to windows). More...
 
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
void raise_sys ()
 
QPaintDeviceredirected (QPoint *offset) const
 
void registerDropSite (bool)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, bool readyToRender)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint_sys (const QRegion &rgn)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void resolveFont ()
 Determine which font is implicitly imposed on this widget by its ancestors and QApplication::font, resolve this against its own font (attributes from the implicit font are copied over). More...
 
void resolveLayoutDirection ()
 
void resolveLocale ()
 
void resolvePalette ()
 Determine which palette is inherited from this widget's ancestors and QApplication::palette, resolve this against this widget's palette (attributes from the inherited palette are copied over this widget's palette). More...
 
void restoreRedirected ()
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void scrollChildren (int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void sendStartupMessage (const char *message) const
 Platform-specific part of QWidget::show(). More...
 
void setConstraints_sys ()
 
void setCursor_sys (const QCursor &cursor)
 
void setDirtyOpaqueRegion ()
 
void setEnabled_helper (bool)
 
void setFocus_sys ()
 
void setFont_helper (const QFont &font)
 
void setGeometry_sys (int, int, int, int, bool)
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=0)
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void setMask_sys (const QRegion &)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
void setModal_sys ()
 
void setNetWmWindowTypes ()
 
void setOpaque (bool opaque)
 
void setPalette_helper (const QPalette &)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
void setSharedPainter (QPainter *painter)
 
void setStyle_helper (QStyle *newStyle, bool propagate, bool metalHack=false)
 
void setUpdatesEnabled_helper (bool)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys (bool forceReset=false)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowOpacity_sys (qreal opacity)
 
void setWindowRole ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWinId (WId)
 
QPaintersharedPainter () const
 
void show_helper ()
 
void show_recursive ()
 Makes the widget visible in the isVisible() meaning of the word. More...
 
void show_sys ()
 Platform-specific part of QWidget::show(). More...
 
void showChildren (bool spontaneous)
 
void stackUnder_sys (QWidget *)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=0, bool alsoNonOpaque=false) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
QTLWExtratopData () const
 
void unsetCursor_sys ()
 
void updateFont (const QFont &)
 Assign font to this widget, and propagate it to all children, except style sheet widgets (handled differently) and windows that don't enable window propagation. More...
 
void updateFrameStrut ()
 Computes the frame rectangle when needed. More...
 
void updateGeometry_helper (bool forceUpdate)
 
void updateIsOpaque ()
 
void updateIsTranslucent ()
 
void updateSystemBackground ()
 
void updateX11AcceptFocus ()
 
void x11UpdateIsOpaque ()
 
 ~QWidgetPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static QString initialSelection (const QString &path)
 
static void qt_mac_filedialog_event_proc (const NavEventCallbackMessage msg, NavCBRecPtr p, NavCallBackUserData data)
 
static Boolean qt_mac_filedialog_filter_proc (AEDesc *theItem, void *info, void *data, NavFilterModes)
 
static QString toInternal (const QString &path)
 
static QString workingDirectory (const QString &path)
 
- Static Public Functions inherited from QWidgetPrivate
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=0)
 
static QGraphicsProxyWidgetnearestGraphicsProxyWidget (const QWidget *origin)
 Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget and its ancestors. More...
 
static int pointToRect (const QPoint &p, const QRect &r)
 
static QRect screenGeometry (const QWidget *widget)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

QString acceptLabel
 
QFileDialog::AcceptMode acceptMode
 
QFSCompletercompleter
 
bool confirmOverwrite
 
QStringList currentHistory
 
int currentHistoryLocation
 
bool defaultFileTypes
 
QString defaultSuffix
 
QActiondeleteAction
 
QFileDialog::FileMode fileMode
 
bool fileNameLabelExplicitlySat
 
struct QFileDialogPrivate::QtMacNavFilterInfo filterInfo
 
QString mCurrentLocation
 
QString mCurrentSelection
 
QStringList mCurrentSelectionList
 
void * mDelegate
 
NavDialogRef mDialog
 
bool mDialogClosed
 
bool mDialogStarted
 
QByteArray memberToDisconnectOnClose
 
QFileSystemModelmodel
 
QStringList nameFilters
 
bool nativeDialogInUse
 
QActionnewFolderAction
 
QFileDialog::Options opts
 
QAbstractProxyModelproxyModel
 
QScopedPointer< Ui_QFileDialog > qFileDialogUi
 
QPointer< QObjectreceiverToDisconnectOnClose
 
QActionrenameAction
 
QString setWindowTitle
 
QActionshowHiddenAction
 
QByteArray signalToDisconnectOnClose
 
bool useDefaultCaption
 
QStringList watching
 
- Public Variables inherited from QDialogPrivate
bool doShowExtension
 
QPointer< QEventLoopeventLoop
 
QWidgetextension
 
QPoint lastRMBPress
 
QPointer< QPushButtonmainDef
 
QSize max
 
QSize min
 
Qt::Orientation orientation
 
int rescode
 
int resetModalityTo
 
QSizeGripresizer
 
QSize size
 
bool sizeGripEnabled
 
bool wasModalitySet
 
- Public Variables inherited from QWidgetPrivate
QString accessibleDescription
 
QString accessibleName
 
QList< QAction * > actions
 
QPalette::ColorRole bg_role: 8
 
signed char bottomLayoutItemMargin
 
short bottommargin
 
QWidgetData data
 
QRegion dirty
 
uint dirtyOpaqueChildren: 1
 
QWExtraextra
 
QPaintEngineextraPaintEngine
 
QPalette::ColorRole fg_role: 8
 
QWidgetfocus_child
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
QGraphicsEffectgraphicsEffect
 
Qt::HANDLE hd
 
uint high_attributes [4]
 
QPointer< QInputContextic
 
Qt::InputMethodHints imHints
 
uint inDirtyList: 1
 
uint inheritedFontResolveMask
 
uint inheritedPaletteResolveMask
 
uint inheritsInputMethodHints: 1
 
uint inSetParent: 1
 
uint isGLWidget: 1
 
uint isMoved: 1
 
uint isOpaque: 1
 
uint isScrolled: 1
 
QLayoutlayout
 
signed char leftLayoutItemMargin
 
short leftmargin
 
QLocale locale
 
QRegionneedsFlush
 
QRegion opaqueChildren
 
Qt::HANDLE picture
 
const QMetaObjectpolished
 
QPaintDeviceredirectDev
 
QPoint redirectOffset
 
signed char rightLayoutItemMargin
 
short rightmargin
 
QSizePolicy size_policy
 
QString statusTip
 
QString toolTip
 
signed char topLayoutItemMargin
 
short topmargin
 
uint usesDoubleBufferedGLContext: 1
 
QString whatsThis
 
QWidgetItemV2widgetItem
 
QX11Info xinfo
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QWidgetPrivate
enum  CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }
 
enum  Direction { DirectionNorth = 0x01, DirectionEast = 0x10, DirectionSouth = 0x02, DirectionWest = 0x20 }
 
enum  DrawWidgetFlags {
  DrawAsRoot = 0x01, DrawPaintOnScreen = 0x02, DrawRecursive = 0x04, DrawInvisible = 0x08,
  DontSubtractOpaqueChildren = 0x10, DontSetCompositionMode = 0x20, DontDrawOpaqueChildren = 0x40, DontDrawNativeChildren = 0x80
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Variables inherited from QWidgetPrivate
static QWidgetSetallWidgets = 0
 
static int instanceCounter = 0
 
static QWidgetkeyboardGrabber = 0
 
static QWidgetMappermapper = 0
 
static int maxInstances = 0
 
static QWidgetmouseGrabber = 0
 

Detailed Description

Definition at line 112 of file qfiledialog_p.h.

Constructors and Destructors

◆ QFileDialogPrivate()

QFileDialogPrivate::QFileDialogPrivate ( )

Definition at line 554 of file qfiledialog.cpp.

555  :
556 #ifndef QT_NO_PROXYMODEL
557  proxyModel(0),
558 #endif
559  model(0),
563  renameAction(0),
564  deleteAction(0),
565  showHiddenAction(0),
566  useDefaultCaption(true),
567  defaultFileTypes(true),
569  nativeDialogInUse(false),
570 #ifdef Q_WS_MAC
571  mDelegate(0),
572 #ifndef QT_MAC_USE_COCOA
573  mDialog(0),
574  mDialogStarted(false),
575  mDialogClosed(true),
576 #endif
577 #endif
578  qFileDialogUi(0)
579 {
580 }
QAbstractProxyModel * proxyModel
QFileDialog::AcceptMode acceptMode
QAction * renameAction
QFileDialog::FileMode fileMode
QAction * showHiddenAction
NavDialogRef mDialog
QAction * deleteAction
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ ~QFileDialogPrivate()

QFileDialogPrivate::~QFileDialogPrivate ( )

Definition at line 582 of file qfiledialog.cpp.

583 {
584 }

Functions

◆ _q_autoCompleteFileName()

void QFileDialogPrivate::_q_autoCompleteFileName ( const QString text)

Definition at line 2982 of file qfiledialog.cpp.

Referenced by createWidgets().

2983 {
2984  if (text.startsWith(QLatin1String("//")) || text.startsWith(QLatin1Char('\\'))) {
2985  qFileDialogUi->listView->selectionModel()->clearSelection();
2986  return;
2987  }
2988 
2989  QStringList multipleFiles = typedFiles();
2990  if (multipleFiles.count() > 0) {
2991  QModelIndexList oldFiles = qFileDialogUi->listView->selectionModel()->selectedRows();
2992  QModelIndexList newFiles;
2993  for (int i = 0; i < multipleFiles.count(); ++i) {
2994  QModelIndex idx = model->index(multipleFiles.at(i));
2995  if (oldFiles.contains(idx))
2996  oldFiles.removeAll(idx);
2997  else
2998  newFiles.append(idx);
2999  }
3000  for (int i = 0; i < newFiles.count(); ++i)
3001  select(newFiles.at(i));
3002  if (lineEdit()->hasFocus())
3003  for (int i = 0; i < oldFiles.count(); ++i)
3004  qFileDialogUi->listView->selectionModel()->select(oldFiles.at(i),
3006  }
3007 }
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool hasFocus() const
Definition: qwidget.cpp:6583
QStringList typedFiles() const
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QLineEdit * lineEdit() const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QModelIndex select(const QModelIndex &index) const
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ _q_createDirectory()

void QFileDialogPrivate::_q_createDirectory ( )

Creates a new directory, first asking the user for a suitable name.

Warning
This function is not part of the public interface.

Definition at line 2817 of file qfiledialog.cpp.

Referenced by createMenuActions(), and createToolButtons().

2818 {
2819  Q_Q(QFileDialog);
2820  qFileDialogUi->listView->clearSelection();
2821 
2822  QString newFolderString = QFileDialog::tr("New Folder");
2823  QString folderName = newFolderString;
2824  QString prefix = q->directory().absolutePath() + QDir::separator();
2825  if (QFile::exists(prefix + folderName)) {
2826  qlonglong suffix = 2;
2827  while (QFile::exists(prefix + folderName)) {
2828  folderName = newFolderString + QString::number(suffix++);
2829  }
2830  }
2831 
2833  QModelIndex index = model->mkdir(parent, folderName);
2834  if (!index.isValid())
2835  return;
2836 
2837  index = select(index);
2838  if (index.isValid()) {
2839  qFileDialogUi->treeView->setCurrentIndex(index);
2840  currentView()->edit(index);
2841  }
2842 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QChar separator()
Returns the native directory separator: "/" under Unix (including Mac OS X) and "\\" under Windows...
Definition: qdir.cpp:1831
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
QAbstractItemView * currentView() const
#define Q_Q(Class)
Definition: qglobal.h:2483
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
Definition: qfile.cpp:626
QModelIndex mkdir(const QModelIndex &parent, const QString &name)
Create a directory with the name in the parent model index.
QModelIndex select(const QModelIndex &index) const
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QByteArray suffix
The QModelIndex class is used to locate data in a data model.
QModelIndex rootIndex() const
void edit(const QModelIndex &index)
Starts editing the item corresponding to the given index if it is editable.
quint16 index
QObject * parent
Definition: qobject.h:92
qint64 qlonglong
Definition: qglobal.h:951
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_currentChanged()

void QFileDialogPrivate::_q_currentChanged ( const QModelIndex index)
Warning
This function is not part of the public interface.

Definition at line 3110 of file qfiledialog.cpp.

Referenced by createWidgets(), and QFileDialog::setProxyModel().

3111 {
3113  emit q_func()->currentChanged(index.data(QFileSystemModel::FilePathRole).toString());
3114 }
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
#define emit
Definition: qobjectdefs.h:76

◆ _q_deleteCurrent()

void QFileDialogPrivate::_q_deleteCurrent ( )

Deletes the currently selected item in the dialog.

Warning
This function is not part of the public interface.

Definition at line 2930 of file qfiledialog.cpp.

Referenced by createMenuActions(), and createWidgets().

2931 {
2932  if (model->isReadOnly())
2933  return;
2934 
2935  QModelIndexList list = qFileDialogUi->listView->selectionModel()->selectedRows();
2936  for (int i = list.count() - 1; i >= 0; --i) {
2937  QModelIndex index = list.at(i);
2938  if (index == qFileDialogUi->listView->rootIndex())
2939  continue;
2940 
2941  index = mapToSource(index.sibling(index.row(), 0));
2942  if (!index.isValid())
2943  continue;
2944 
2947  bool isDir = model->isDir(index);
2948 
2949  QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt());
2950 #ifndef QT_NO_MESSAGEBOX
2951  Q_Q(QFileDialog);
2952  if (!(p & QFile::WriteUser) && (QMessageBox::warning(q_func(), q_func()->windowTitle(),
2953  QFileDialog::tr("'%1' is write protected.\nDo you want to delete it anyway?")
2954  .arg(fileName),
2956  return;
2957  else if (QMessageBox::warning(q_func(), q_func()->windowTitle(),
2958  QFileDialog::tr("Are sure you want to delete '%1'?")
2959  .arg(fileName),
2961  return;
2962 
2963 #else
2964  if (!(p & QFile::WriteUser))
2965  return;
2966 #endif // QT_NO_MESSAGEBOX
2967 
2968  // the event loop has run, we can NOT reuse index because the model might have removed it.
2969  if (isDir) {
2970  if (!removeDirectory(filePath)) {
2971 #ifndef QT_NO_MESSAGEBOX
2972  QMessageBox::warning(q, q->windowTitle(),
2973  QFileDialog::tr("Could not delete directory."));
2974 #endif
2975  }
2976  } else {
2977  model->remove(index);
2978  }
2979  }
2980 }
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a warning message box with the given title and text in front of the specified parent widget...
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
int row() const
Returns the row this model index refers to.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool isDir(const QModelIndex &index) const
Returns true if the model item index represents a directory; otherwise returns false.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QModelIndex mapToSource(const QModelIndex &index) const
The QModelIndex class is used to locate data in a data model.
quint16 index
bool removeDirectory(const QString &path)
bool remove(const QModelIndex &index) const
Removes the model item index from the file system model and deletes the corresponding file from the f...
static QString fileName(const QString &fileUrl)
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_enterDirectory()

void QFileDialogPrivate::_q_enterDirectory ( const QModelIndex index)

This is called when the user double clicks on a file with the corresponding model item index.

Warning
This function is not part of the public interface.

Definition at line 3125 of file qfiledialog.cpp.

Referenced by _q_goToDirectory(), _q_goToUrl(), and createWidgets().

3126 {
3127  Q_Q(QFileDialog);
3128  // My Computer or a directory
3129  QModelIndex sourceIndex = index.model() == proxyModel ? mapToSource(index) : index;
3130  QString path = sourceIndex.data(QFileSystemModel::FilePathRole).toString();
3131  if (path.isEmpty() || model->isDir(sourceIndex)) {
3132  q->setDirectory(path);
3133  emit q->directoryEntered(path);
3136  // ### find out why you have to do both of these.
3137  lineEdit()->setText(QString());
3138  lineEdit()->clear();
3139  }
3140  } else {
3141  // Do not accept when shift-clicking to multi-select a file in environments with single-click-activation (KDE)
3142  if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)
3144  q->accept();
3145  }
3146  }
3147 }
QAbstractProxyModel * proxyModel
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
#define emit
Definition: qobjectdefs.h:76
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool isDir(const QModelIndex &index) const
Returns true if the model item index represents a directory; otherwise returns false.
QLineEdit * lineEdit() const
QFileDialog::FileMode fileMode
QModelIndex mapToSource(const QModelIndex &index) const
void setText(const QString &)
Definition: qlineedit.cpp:401
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
void clear()
Clears the contents of the line edit.
Definition: qlineedit.cpp:1443
The QModelIndex class is used to locate data in a data model.
QFileSystemModel * model

◆ _q_fileRenamed()

void QFileDialogPrivate::_q_fileRenamed ( const QString path,
const QString  oldName,
const QString  newName 
)

Definition at line 3306 of file qfiledialog.cpp.

Referenced by createWidgets().

3307 {
3309  if (path == rootPath() && lineEdit()->text() == oldName)
3310  lineEdit()->setText(newName);
3311  }
3312 }
QLineEdit * lineEdit() const
QString rootPath() const
QFileDialog::FileMode fileMode
void setText(const QString &)
Definition: qlineedit.cpp:401
#define text
Definition: qobjectdefs.h:80

◆ _q_goHome()

void QFileDialogPrivate::_q_goHome ( )

Definition at line 2719 of file qfiledialog.cpp.

Referenced by createMenuActions().

2720 {
2721  Q_Q(QFileDialog);
2722  q->setDirectory(QDir::homePath());
2723 }
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
static QString homePath()
Returns the absolute path of the user&#39;s home directory.
Definition: qdir.cpp:1942

◆ _q_goToDirectory()

void QFileDialogPrivate::_q_goToDirectory ( const QString path)

Changes the file dialog's current directory to the one specified by path.

Warning
This function is not part of the public interface.

Definition at line 3158 of file qfiledialog.cpp.

Referenced by createWidgets().

3159 {
3160  #ifndef QT_NO_MESSAGEBOX
3161  Q_Q(QFileDialog);
3162 #endif
3163  QModelIndex index = qFileDialogUi->lookInCombo->model()->index(qFileDialogUi->lookInCombo->currentIndex(),
3164  qFileDialogUi->lookInCombo->modelColumn(),
3165  qFileDialogUi->lookInCombo->rootModelIndex());
3166  QString path2 = path;
3167  if (!index.isValid())
3169  else {
3170  path2 = index.data(UrlRole).toUrl().toLocalFile();
3171  index = mapFromSource(model->index(path2));
3172  }
3173  QDir dir(path2);
3174  if (!dir.exists())
3175  dir = getEnvironmentVariable(path2);
3176 
3177  if (dir.exists() || path2.isEmpty() || path2 == model->myComputer().toString()) {
3178  _q_enterDirectory(index);
3179 #ifndef QT_NO_MESSAGEBOX
3180  } else {
3181  QString message = QFileDialog::tr("%1\nDirectory not found.\nPlease verify the "
3182  "correct directory name was given.");
3183  QMessageBox::warning(q, q->windowTitle(), message.arg(path2));
3184 #endif // QT_NO_MESSAGEBOX
3185  }
3186 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
QModelIndex mapFromSource(const QModelIndex &index) const
void _q_enterDirectory(const QModelIndex &index)
This is called when the user double clicks on a file with the corresponding model item index...
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QString class provides a Unicode character string.
Definition: qstring.h:83
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a warning message box with the given title and text in front of the specified parent widget...
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QVariant myComputer(int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item "My Computer".
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
Definition: qurl.cpp:6412
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
Definition: qvariant.cpp:2528
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
quint16 index
#define UrlRole
QString getEnvironmentVariable(const QString &string)
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_goToUrl()

void QFileDialogPrivate::_q_goToUrl ( const QUrl url)
Warning
This function is not part of the public interface. set the directory to url

Definition at line 821 of file qfiledialog.cpp.

Referenced by createWidgets().

822 {
823  //The shortcut in the side bar may have a parent that is not fetched yet (e.g. an hidden file)
824  //so we force the fetching
825  QFileSystemModelPrivate::QFileSystemNode *node = model->d_func()->node(url.toLocalFile(), true);
826  QModelIndex idx = model->d_func()->index(node);
827  _q_enterDirectory(idx);
828 }
void _q_enterDirectory(const QModelIndex &index)
This is called when the user double clicks on a file with the corresponding model item index...
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
Definition: qurl.cpp:6412
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
QFileSystemModel * model

◆ _q_macRunNativeAppModalPanel()

void QFileDialogPrivate::_q_macRunNativeAppModalPanel ( )

Definition at line 1175 of file qfiledialog_mac.mm.

1176 {
1178 #ifndef QT_MAC_USE_COCOA
1179  NavDialogRun(mDialog);
1180 #else
1181  Q_Q(QFileDialog);
1184  [delegate runApplicationModalPanel];
1185  dialogResultCode_sys() == QDialog::Accepted ? q->accept() : q->reject();
1186 #endif
1187 }
QDialog::DialogCode dialogResultCode_sys()
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
NavDialogRef mDialog
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
static bool native_modal_dialog_active

◆ _q_navigateBackward()

void QFileDialogPrivate::_q_navigateBackward ( )

Navigates to the last directory viewed in the dialog.

Warning
This function is not part of the public interface.

Definition at line 2757 of file qfiledialog.cpp.

Referenced by createToolButtons(), and itemViewKeyboardEvent().

2758 {
2759  Q_Q(QFileDialog);
2762  QString previousHistory = currentHistory.at(currentHistoryLocation);
2763  q->setDirectory(previousHistory);
2764  }
2765 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QStringList currentHistory

◆ _q_navigateForward()

void QFileDialogPrivate::_q_navigateForward ( )

Navigates to the last directory viewed in the dialog.

Warning
This function is not part of the public interface.

Definition at line 2775 of file qfiledialog.cpp.

Referenced by createToolButtons().

2776 {
2777  Q_Q(QFileDialog);
2781  q->setDirectory(nextHistory);
2782  }
2783 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QStringList currentHistory

◆ _q_navigateToParent()

void QFileDialogPrivate::_q_navigateToParent ( )

Navigates to the parent directory of the currently displayed directory in the dialog.

Warning
This function is not part of the public interface.

Definition at line 2794 of file qfiledialog.cpp.

Referenced by createMenuActions(), createToolButtons(), and itemViewKeyboardEvent().

2795 {
2796  Q_Q(QFileDialog);
2797  QDir dir(model->rootDirectory());
2798  QString newDirectory;
2799  if (dir.isRoot()) {
2800  newDirectory = model->myComputer().toString();
2801  } else {
2802  dir.cdUp();
2803  newDirectory = dir.absolutePath();
2804  }
2805  q->setDirectory(newDirectory);
2806  emit q->directoryEntered(newDirectory);
2807 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76
QVariant myComputer(int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item "My Computer".
QDir rootDirectory() const
The currently set directory.
QFileSystemModel * model

◆ _q_pathChanged()

void QFileDialogPrivate::_q_pathChanged ( const QString newPath)
Warning
This function is not part of the public interface.

Update history with new path, buttons, and combo

Definition at line 2730 of file qfiledialog.cpp.

Referenced by createWidgets().

2731 {
2732  Q_Q(QFileDialog);
2733  QDir dir(model->rootDirectory());
2734  qFileDialogUi->toParentButton->setEnabled(dir.exists());
2735  qFileDialogUi->sidebar->selectUrl(QUrl::fromLocalFile(newPath));
2736  q->setHistory(qFileDialogUi->lookInCombo->history());
2737 
2741  }
2744  }
2745  qFileDialogUi->forwardButton->setEnabled(currentHistory.size() - currentHistoryLocation > 1);
2746  qFileDialogUi->backButton->setEnabled(currentHistoryLocation > 0);
2747 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
void removeLast()
Removes the last item in the list.
Definition: qlist.h:287
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
T value(int i) const
Returns the value at index position i in the list.
Definition: qlist.h:661
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QDir rootDirectory() const
The currently set directory.
QStringList currentHistory
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
Definition: qurl.cpp:6374
static QString toNativeSeparators(const QString &pathName)
Returns pathName with the &#39;/&#39; separators converted to separators that are appropriate for the underly...
Definition: qdir.cpp:812
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_renameCurrent()

void QFileDialogPrivate::_q_renameCurrent ( )
Warning
This function is not part of the public interface.

Definition at line 2905 of file qfiledialog.cpp.

Referenced by createMenuActions().

2906 {
2907  Q_Q(QFileDialog);
2908  QModelIndex index = qFileDialogUi->listView->currentIndex();
2909  index = index.sibling(index.row(), 0);
2910  if (q->viewMode() == QFileDialog::List)
2911  qFileDialogUi->listView->edit(index);
2912  else
2913  qFileDialogUi->treeView->edit(index);
2914 }
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column.
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
int row() const
Returns the row this model index refers to.
The QModelIndex class is used to locate data in a data model.
quint16 index
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_rowsInserted()

void QFileDialogPrivate::_q_rowsInserted ( const QModelIndex parent)

When parent is root and rows have been inserted when none was there before then select the first one.

Warning
This function is not part of the public interface.

Definition at line 3296 of file qfiledialog.cpp.

Referenced by createWidgets(), and QFileDialog::setProxyModel().

3297 {
3298  if (!qFileDialogUi->treeView
3299  || parent != qFileDialogUi->treeView->rootIndex()
3300  || !qFileDialogUi->treeView->selectionModel()
3301  || qFileDialogUi->treeView->selectionModel()->hasSelection()
3302  || qFileDialogUi->treeView->model()->rowCount(parent) == 0)
3303  return;
3304 }
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_selectionChanged()

void QFileDialogPrivate::_q_selectionChanged ( )

This is called when the model index corresponding to the current file is changed from index to current.

Warning
This function is not part of the public interface.

Definition at line 3245 of file qfiledialog.cpp.

Referenced by createWidgets(), and QFileDialog::setProxyModel().

3246 {
3247  QModelIndexList indexes = qFileDialogUi->listView->selectionModel()->selectedRows();
3249 
3250  QStringList allFiles;
3251  for (int i = 0; i < indexes.count(); ++i) {
3252  if (stripDirs && model->isDir(mapToSource(indexes.at(i))))
3253  continue;
3254  allFiles.append(indexes.at(i).data().toString());
3255  }
3256  if (allFiles.count() > 1)
3257  for (int i = 0; i < allFiles.count(); ++i) {
3258  allFiles.replace(i, QString(QLatin1Char('"') + allFiles.at(i) + QLatin1Char('"')));
3259  }
3260 
3261  QString finalFiles = allFiles.join(QLatin1String(" "));
3262  if (!finalFiles.isEmpty() && !lineEdit()->hasFocus() && lineEdit()->isVisible())
3263  lineEdit()->setText(finalFiles);
3264  else
3266 }
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
bool isVisible() const
Definition: qwidget.h:1005
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool hasFocus() const
Definition: qwidget.cpp:6583
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool isDir(const QModelIndex &index) const
Returns true if the model item index represents a directory; otherwise returns false.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QLineEdit * lineEdit() const
QFileDialog::FileMode fileMode
void replace(int i, const T &t)
Replaces the item at index position i with value.
Definition: qlist.h:609
QModelIndex mapToSource(const QModelIndex &index) const
void setText(const QString &)
Definition: qlineedit.cpp:401
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_showContextMenu()

void QFileDialogPrivate::_q_showContextMenu ( const QPoint position)
Warning
This function is not part of the public interface.

Show the context menu for the file/dir under position

Definition at line 2869 of file qfiledialog.cpp.

Referenced by createWidgets().

2870 {
2871 #ifdef QT_NO_MENU
2872  Q_UNUSED(position);
2873 #else
2874  Q_Q(QFileDialog);
2875  QAbstractItemView *view = 0;
2876  if (q->viewMode() == QFileDialog::Detail)
2877  view = qFileDialogUi->treeView;
2878  else
2879  view = qFileDialogUi->listView;
2880  QModelIndex index = view->indexAt(position);
2881  index = mapToSource(index.sibling(index.row(), 0));
2882 
2883  QMenu menu(view);
2884  if (index.isValid()) {
2885  // file context menu
2886  QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt());
2888  menu.addAction(renameAction);
2889  deleteAction->setEnabled(p & QFile::WriteUser);
2890  menu.addAction(deleteAction);
2891  menu.addSeparator();
2892  }
2893  menu.addAction(showHiddenAction);
2894  if (qFileDialogUi->newFolderButton->isVisible()) {
2895  newFolderAction->setEnabled(qFileDialogUi->newFolderButton->isEnabled());
2896  menu.addAction(newFolderAction);
2897  }
2898  menu.exec(view->viewport()->mapToGlobal(position));
2899 #endif // QT_NO_MENU
2900 }
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
void setEnabled(bool)
Definition: qaction.cpp:1192
#define Q_Q(Class)
Definition: qglobal.h:2483
QWidget * viewport() const
Returns the viewport widget.
QAction * renameAction
QAction * newFolderAction
QAction * showHiddenAction
QModelIndex mapToSource(const QModelIndex &index) const
The QAbstractItemView class provides the basic functionality for item view classes.
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus...
Definition: qmenu.h:72
QAction * deleteAction
The QModelIndex class is used to locate data in a data model.
quint16 index
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.
QScopedPointer< Ui_QFileDialog > qFileDialogUi
virtual QModelIndex indexAt(const QPoint &point) const =0
Returns the model index of the item at the viewport coordinates point.

◆ _q_showDetailsView()

void QFileDialogPrivate::_q_showDetailsView ( )

Definition at line 2854 of file qfiledialog.cpp.

Referenced by createToolButtons().

2855 {
2856  qFileDialogUi->listModeButton->setDown(false);
2857  qFileDialogUi->detailModeButton->setDown(true);
2858  qFileDialogUi->listView->hide();
2859  qFileDialogUi->treeView->show();
2860  qFileDialogUi->stackedWidget->setCurrentWidget(qFileDialogUi->treeView->parentWidget());
2861  qFileDialogUi->treeView->doItemsLayout();
2862 }
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_showHeader()

void QFileDialogPrivate::_q_showHeader ( QAction action)

Definition at line 2536 of file qfiledialog.cpp.

Referenced by createWidgets().

2537 {
2538  Q_Q(QFileDialog);
2539  QActionGroup *actionGroup = qobject_cast<QActionGroup*>(q->sender());
2540  qFileDialogUi->treeView->header()->setSectionHidden(actionGroup->actions().indexOf(action) + 1, !action->isChecked());
2541 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
The QActionGroup class groups actions together.
Definition: qactiongroup.h:57
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847
bool isChecked() const
Definition: qaction.cpp:1151
QList< QAction * > actions() const
Returns the list of this groups&#39;s actions.
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_showHidden()

void QFileDialogPrivate::_q_showHidden ( )

Includes hidden files and directories in the items displayed in the dialog.

Warning
This function is not part of the public interface.

Definition at line 3276 of file qfiledialog.cpp.

Referenced by createMenuActions().

3277 {
3278  Q_Q(QFileDialog);
3279  QDir::Filters dirFilters = q->filter();
3280  if (showHiddenAction->isChecked())
3281  dirFilters |= QDir::Hidden;
3282  else
3283  dirFilters &= ~QDir::Hidden;
3284  q->setFilter(dirFilters);
3285 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
QAction * showHiddenAction
bool isChecked() const
Definition: qaction.cpp:1151
void setFilter(Filters filter)
Sets the filter used by entryList() and entryInfoList() to filters.
Definition: qdir.cpp:1170

◆ _q_showListView()

void QFileDialogPrivate::_q_showListView ( )

Definition at line 2844 of file qfiledialog.cpp.

Referenced by createToolButtons().

2845 {
2846  qFileDialogUi->listModeButton->setDown(true);
2847  qFileDialogUi->detailModeButton->setDown(false);
2848  qFileDialogUi->treeView->hide();
2849  qFileDialogUi->listView->show();
2850  qFileDialogUi->stackedWidget->setCurrentWidget(qFileDialogUi->listView->parentWidget());
2851  qFileDialogUi->listView->doItemsLayout();
2852 }
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_updateOkButton()

void QFileDialogPrivate::_q_updateOkButton ( )
Warning
This function is not part of the public interface.

Definition at line 3012 of file qfiledialog.cpp.

Referenced by _q_currentChanged(), _q_selectionChanged(), createWidgets(), and init().

3013 {
3014  Q_Q(QFileDialog);
3015  QPushButton *button = qFileDialogUi->buttonBox->button((acceptMode == QFileDialog::AcceptOpen)
3017  if (!button)
3018  return;
3019 
3020  bool enableButton = true;
3021  bool isOpenDirectory = false;
3022 
3023  QStringList files = q->selectedFiles();
3024  QString lineEditText = lineEdit()->text();
3025 
3026  if (lineEditText.startsWith(QLatin1String("//")) || lineEditText.startsWith(QLatin1Char('\\'))) {
3027  button->setEnabled(true);
3029  button->setText(acceptLabel);
3030  return;
3031  }
3032 
3033  if (files.isEmpty()) {
3034  enableButton = false;
3035  } else if (lineEditText == QLatin1String("..")) {
3036  isOpenDirectory = true;
3037  } else {
3038  switch (fileMode) {
3040  case QFileDialog::Directory: {
3041  QString fn = files.first();
3042  QModelIndex idx = model->index(fn);
3043  if (!idx.isValid())
3044  idx = model->index(getEnvironmentVariable(fn));
3045  if (!idx.isValid() || !model->isDir(idx))
3046  enableButton = false;
3047  break;
3048  }
3049  case QFileDialog::AnyFile: {
3050  QString fn = files.first();
3051  QFileInfo info(fn);
3052  QModelIndex idx = model->index(fn);
3053  QString fileDir;
3054  QString fileName;
3055  if (info.isDir()) {
3056  fileDir = info.canonicalFilePath();
3057  } else {
3058  fileDir = fn.mid(0, fn.lastIndexOf(QLatin1Char('/')));
3059  fileName = fn.mid(fileDir.length() + 1);
3060  }
3061  if (lineEditText.contains(QLatin1String(".."))) {
3062  fileDir = info.canonicalFilePath();
3063  fileName = info.fileName();
3064  }
3065 
3066  if (fileDir == q->directory().canonicalPath() && fileName.isEmpty()) {
3067  enableButton = false;
3068  break;
3069  }
3070  if (idx.isValid() && model->isDir(idx)) {
3071  isOpenDirectory = true;
3072  enableButton = true;
3073  break;
3074  }
3075  if (!idx.isValid()) {
3076  int maxLength = maxNameLength(fileDir);
3077  enableButton = maxLength < 0 || fileName.length() <= maxLength;
3078  }
3079  break;
3080  }
3083  for (int i = 0; i < files.count(); ++i) {
3084  QModelIndex idx = model->index(files.at(i));
3085  if (!idx.isValid())
3086  idx = model->index(getEnvironmentVariable(files.at(i)));
3087  if (!idx.isValid()) {
3088  enableButton = false;
3089  break;
3090  }
3091  if (idx.isValid() && model->isDir(idx)) {
3092  isOpenDirectory = true;
3093  break;
3094  }
3095  }
3096  break;
3097  default:
3098  break;
3099  }
3100  }
3101 
3102  button->setEnabled(enableButton);
3104  button->setText(isOpenDirectory ? QFileDialog::tr("&Open") : acceptLabel);
3105 }
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
static mach_timebase_info_data_t info
void setText(const QString &text)
QFileDialog::AcceptMode acceptMode
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QPushButton widget provides a command button.
Definition: qpushbutton.h:57
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QString text
the line edit&#39;s text
Definition: qlineedit.h:72
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool isDir(const QModelIndex &index) const
Returns true if the model item index represents a directory; otherwise returns false.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QLineEdit * lineEdit() const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QFileDialog::FileMode fileMode
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
void setEnabled(bool)
Definition: qwidget.cpp:3447
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
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...
Definition: qstring.cpp:3706
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:3000
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
int maxNameLength(const QString &path)
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
static QString fileName(const QString &fileUrl)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QString getEnvironmentVariable(const QString &string)
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ _q_useNameFilter()

void QFileDialogPrivate::_q_useNameFilter ( int  index)

Sets the current name filter to be nameFilter and update the qFileDialogUi->fileNameEdit when in AcceptSave mode with the new extension.

Warning
This function is not part of the public interface.

Definition at line 3208 of file qfiledialog.cpp.

Referenced by createWidgets().

3209 {
3210  if (index == nameFilters.size()) {
3211  QAbstractItemModel *comboModel = qFileDialogUi->fileTypeCombo->model();
3212  nameFilters.append(comboModel->index(comboModel->rowCount() - 1, 0).data().toString());
3213  }
3214 
3215  QString nameFilter = nameFilters.at(index);
3216  QStringList newNameFilters = qt_clean_filter_list(nameFilter);
3218  QString newNameFilterExtension;
3219  if (newNameFilters.count() > 0)
3220  newNameFilterExtension = QFileInfo(newNameFilters.at(0)).suffix();
3221 
3222  QString fileName = lineEdit()->text();
3223  const QString fileNameExtension = QFileInfo(fileName).suffix();
3224  if (!fileNameExtension.isEmpty() && !newNameFilterExtension.isEmpty()) {
3225  const int fileNameExtensionLength = fileNameExtension.count();
3226  fileName.replace(fileName.count() - fileNameExtensionLength,
3227  fileNameExtensionLength, newNameFilterExtension);
3228  qFileDialogUi->listView->clearSelection();
3229  lineEdit()->setText(fileName);
3230  }
3231  }
3232 
3233  model->setNameFilters(newNameFilters);
3234 }
QFileDialog::AcceptMode acceptMode
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
QStringList qt_clean_filter_list(const QString &filter)
QWidgetData data
Definition: qwidget_p.h:755
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
void setNameFilters(const QStringList &filters)
Sets the name filters to apply against the existing files.
QString text
the line edit&#39;s text
Definition: qlineedit.h:72
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QLineEdit * lineEdit() const
QStringList nameFilters
int count() const
Definition: qstring.h:103
The QAbstractItemModel class provides the abstract interface for item model classes.
void setText(const QString &)
Definition: qlineedit.cpp:401
QString suffix() const
Returns the suffix of the file.
Definition: qfileinfo.cpp:834
QByteArray suffix
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
quint16 index
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
static QString fileName(const QString &fileUrl)
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ addDefaultSuffixToFiles()

QStringList QFileDialogPrivate::addDefaultSuffixToFiles ( const QStringList  filesToFix) const

Definition at line 1019 of file qfiledialog.cpp.

Referenced by typedFiles().

1020 {
1021  QStringList files;
1022  for (int i=0; i<filesToFix.size(); ++i) {
1023  QString name = toInternal(filesToFix.at(i));
1024  QFileInfo info(name);
1025  // if the filename has no suffix, add the default suffix
1026  if (!defaultSuffix.isEmpty() && !info.isDir() && name.lastIndexOf(QLatin1Char('.')) == -1)
1027  name += QLatin1Char('.') + defaultSuffix;
1028  if (info.isAbsolute()) {
1029  files.append(name);
1030  } else {
1031  // at this point the path should only have Qt path separators.
1032  // This check is needed since we might be at the root directory
1033  // and on Windows it already ends with slash.
1034  QString path = rootPath();
1035  if (!path.endsWith(QLatin1Char('/')))
1036  path += QLatin1Char('/');
1037  path += name;
1038  files.append(path);
1039  }
1040  }
1041  return files;
1042 }
static mach_timebase_info_data_t info
The QString class provides a Unicode character string.
Definition: qstring.h:83
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const char * name
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QString rootPath() const
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:3000
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static QString toInternal(const QString &path)
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
Definition: qstring.cpp:3796
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ basename()

QString QFileDialogPrivate::basename ( const QString path) const
inline

Definition at line 162 of file qfiledialog_p.h.

163  {
164  int separator = QDir::toNativeSeparators(path).lastIndexOf(QDir::separator());
165  if (separator != -1)
166  return path.mid(separator + 1);
167  return path;
168  }
static QChar separator()
Returns the native directory separator: "/" under Unix (including Mac OS X) and "\\" under Windows...
Definition: qdir.cpp:1831
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...
Definition: qstring.cpp:3706
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:3000
static QString toNativeSeparators(const QString &pathName)
Returns pathName with the &#39;/&#39; separators converted to separators that are appropriate for the underly...
Definition: qdir.cpp:812

◆ canBeNativeDialog()

bool QFileDialogPrivate::canBeNativeDialog ( )

Definition at line 650 of file qfiledialog.cpp.

651 {
652  Q_Q(QFileDialog);
653  if (nativeDialogInUse)
654  return true;
655  if (q->testAttribute(Qt::WA_DontShowOnScreen))
656  return false;
658  return false;
659 
661  QLatin1String dynamicName(q->metaObject()->className());
662  return (staticName == dynamicName);
663 }
QFileDialog::Options opts
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Definition: qobject.h:128
const char * className
Definition: qwizard.cpp:137
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654

◆ createMenuActions()

void QFileDialogPrivate::createMenuActions ( )

Create actions which will be used in the right click.

Warning
This function is not part of the public interface.

Definition at line 2678 of file qfiledialog.cpp.

Referenced by init().

2679 {
2680  Q_Q(QFileDialog);
2681 
2682  QAction *goHomeAction = new QAction(q);
2683 #ifndef QT_NO_SHORTCUT
2684  goHomeAction->setShortcut(Qt::CTRL + Qt::Key_H + Qt::SHIFT);
2685 #endif
2686  QObject::connect(goHomeAction, SIGNAL(triggered()), q, SLOT(_q_goHome()));
2687  q->addAction(goHomeAction);
2688 
2689  // ### TODO add Desktop & Computer actions
2690 
2691  QAction *goToParent = new QAction(q);
2692  goToParent->setObjectName(QLatin1String("qt_goto_parent_action"));
2693 #ifndef QT_NO_SHORTCUT
2694  goToParent->setShortcut(Qt::CTRL + Qt::UpArrow);
2695 #endif
2696  QObject::connect(goToParent, SIGNAL(triggered()), q, SLOT(_q_navigateToParent()));
2697  q->addAction(goToParent);
2698 
2699  renameAction = new QAction(q);
2700  renameAction->setEnabled(false);
2701  renameAction->setObjectName(QLatin1String("qt_rename_action"));
2703 
2704  deleteAction = new QAction(q);
2705  deleteAction->setEnabled(false);
2706  deleteAction->setObjectName(QLatin1String("qt_delete_action"));
2708 
2709  showHiddenAction = new QAction(q);
2710  showHiddenAction->setObjectName(QLatin1String("qt_show_hidden_action"));
2713 
2714  newFolderAction = new QAction(q);
2715  newFolderAction->setObjectName(QLatin1String("qt_new_folder_action"));
2717 }
void setShortcut(const QKeySequence &shortcut)
Definition: qaction.cpp:450
void setCheckable(bool)
Definition: qaction.cpp:1094
#define SLOT(a)
Definition: qobjectdefs.h:226
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void _q_deleteCurrent()
Deletes the currently selected item in the dialog.
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
void setEnabled(bool)
Definition: qaction.cpp:1192
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
#define Q_Q(Class)
Definition: qglobal.h:2483
QAction * renameAction
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
QAction * newFolderAction
QAction * showHiddenAction
void _q_createDirectory()
Creates a new directory, first asking the user for a suitable name.
QAction * deleteAction
void _q_navigateToParent()
Navigates to the parent directory of the currently displayed directory in the dialog.
void _q_showHidden()
Includes hidden files and directories in the items displayed in the dialog.
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64

◆ createNavServicesDialog()

void QFileDialogPrivate::createNavServicesDialog ( )

Definition at line 998 of file qfiledialog_mac.mm.

999 {
1000  Q_Q(QFileDialog);
1001  if (mDialog)
1003 
1004  NavDialogCreationOptions navOptions;
1005  NavGetDefaultDialogCreationOptions(&navOptions);
1006 
1007  // Translate QFileDialog settings into NavDialog options:
1008  if (qt_mac_is_macsheet(q)) {
1009  navOptions.modality = kWindowModalityWindowModal;
1010  navOptions.parentWindow = qt_mac_window_for(q->parentWidget());
1011  } else if (q->windowModality() == Qt::ApplicationModal)
1012  navOptions.modality = kWindowModalityAppModal;
1013  else
1014  navOptions.modality = kWindowModalityNone;
1015  navOptions.optionFlags |= kNavSupportPackages;
1016  if (q->testOption(QFileDialog::DontConfirmOverwrite))
1017  navOptions.optionFlags |= kNavDontConfirmReplacement;
1019  navOptions.optionFlags &= ~kNavAllowMultipleFiles;
1020 
1021  navOptions.windowTitle = QCFString::toCFStringRef(q->windowTitle());
1022 
1023  navOptions.location.h = -1;
1024  navOptions.location.v = -1;
1025 
1026  QWidget *parent = q->parentWidget();
1027  if (parent && parent->isVisible()) {
1028  WindowClass wclass;
1029  GetWindowClass(qt_mac_window_for(parent), &wclass);
1030  parent = parent->window();
1031  QString s = parent->windowTitle();
1032  navOptions.clientName = QCFString::toCFStringRef(s);
1033  }
1034 
1036  filterInfo.filters = qt_mac_make_filters_list(nameFilters.join(QLatin1String(";;")), q->isNameFilterDetailsVisible());
1037  QCFType<CFArrayRef> filterArray;
1038  if (filterInfo.filters.size() > 1) {
1039  int i = 0;
1040  CFStringRef *cfstringArray = static_cast<CFStringRef *>(malloc(sizeof(CFStringRef)
1041  * filterInfo.filters.size()));
1042  for (i = 0; i < filterInfo.filters.size(); ++i) {
1043  cfstringArray[i] = QCFString::toCFStringRef(filterInfo.filters.at(i).description);
1044  }
1045  filterArray = CFArrayCreate(kCFAllocatorDefault,
1046  reinterpret_cast<const void **>(cfstringArray), filterInfo.filters.size(),
1047  &kCFTypeArrayCallBacks);
1048  navOptions.popupExtension = filterArray;
1049  free(cfstringArray);
1050  }
1051 
1052  if (q->acceptMode() == QFileDialog::AcceptSave) {
1053  if (NavCreatePutFileDialog(&navOptions, 'cute', kNavGenericSignature,
1055  qDebug("Shouldn't happen %s:%d", __FILE__, __LINE__);
1056  return;
1057  }
1059  if (NavCreateChooseFolderDialog(&navOptions,
1061  qDebug("Shouldn't happen %s:%d", __FILE__, __LINE__);
1062  return;
1063  }
1064  } else {
1065  if (NavCreateGetFileDialog(&navOptions, 0,
1068  qDebug("Shouldn't happen %s:%d", __FILE__, __LINE__);
1069  return;
1070  }
1071  }
1072 
1073  // Set start-up directory:
1074  if (mCurrentLocation.isEmpty())
1076  FSRef fsRef;
1077  if (qt_mac_create_fsref(mCurrentLocation, &fsRef) == noErr) {
1078  AEDesc desc;
1079  if (AECreateDesc(typeFSRef, &fsRef, sizeof(FSRef), &desc) == noErr)
1080  NavCustomControl(mDialog, kNavCtlSetLocation, (void*)&desc);
1081  }
1082 }
const struct __CFString * CFStringRef
bool isVisible() const
Definition: qwidget.h:1005
bool qt_mac_is_macsheet(const QWidget *w)
Definition: qwidget_mac.mm:295
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static CFStringRef toCFStringRef(const QString &str)
Definition: qcore_mac.cpp:69
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref)
Definition: qcore_mac.cpp:125
#define Q_Q(Class)
Definition: qglobal.h:2483
Q_CORE_EXPORT void qDebug(const char *,...)
static void qt_mac_filedialog_event_proc(const NavEventCallbackMessage msg, NavCBRecPtr p, NavCallBackUserData data)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QList< QtMacFilterName > filters
static Boolean qt_mac_filedialog_filter_proc(AEDesc *theItem, void *info, void *data, NavFilterModes)
QString rootPath() const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QString windowTitle
the window title (caption)
Definition: qwidget.h:198
QFileDialog::FileMode fileMode
QStringList nameFilters
NavDialogRef mDialog
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162
if(void) toggleToolbarShown
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
QObject * parent
Definition: qobject.h:92
static QList< QFileDialogPrivate::QtMacFilterName > qt_mac_make_filters_list(const QString &filter, bool showDetails)
struct QFileDialogPrivate::QtMacNavFilterInfo filterInfo

◆ createNSOpenSavePanelDelegate()

void QFileDialogPrivate::createNSOpenSavePanelDelegate ( )

◆ createToolButtons()

void QFileDialogPrivate::createToolButtons ( )
Warning
This function is not part of the public interface.

Create tool buttons, set properties and connections

Definition at line 2629 of file qfiledialog.cpp.

Referenced by createWidgets().

2630 {
2631  Q_Q(QFileDialog);
2632  qFileDialogUi->backButton->setIcon(q->style()->standardIcon(QStyle::SP_ArrowBack, 0, q));
2633  qFileDialogUi->backButton->setAutoRaise(true);
2634  qFileDialogUi->backButton->setEnabled(false);
2635  QObject::connect(qFileDialogUi->backButton, SIGNAL(clicked()), q, SLOT(_q_navigateBackward()));
2636 
2637  qFileDialogUi->forwardButton->setIcon(q->style()->standardIcon(QStyle::SP_ArrowForward, 0, q));
2638  qFileDialogUi->forwardButton->setAutoRaise(true);
2639  qFileDialogUi->forwardButton->setEnabled(false);
2640  QObject::connect(qFileDialogUi->forwardButton, SIGNAL(clicked()), q, SLOT(_q_navigateForward()));
2641 
2642  qFileDialogUi->toParentButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogToParent, 0, q));
2643  qFileDialogUi->toParentButton->setAutoRaise(true);
2644  qFileDialogUi->toParentButton->setEnabled(false);
2645  QObject::connect(qFileDialogUi->toParentButton, SIGNAL(clicked()), q, SLOT(_q_navigateToParent()));
2646 
2647  qFileDialogUi->listModeButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogListView, 0, q));
2648  qFileDialogUi->listModeButton->setAutoRaise(true);
2649  qFileDialogUi->listModeButton->setDown(true);
2650  QObject::connect(qFileDialogUi->listModeButton, SIGNAL(clicked()), q, SLOT(_q_showListView()));
2651 
2652  qFileDialogUi->detailModeButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogDetailedView, 0, q));
2653  qFileDialogUi->detailModeButton->setAutoRaise(true);
2654  QObject::connect(qFileDialogUi->detailModeButton, SIGNAL(clicked()), q, SLOT(_q_showDetailsView()));
2655 
2656  QSize toolSize(qFileDialogUi->fileNameEdit->sizeHint().height(), qFileDialogUi->fileNameEdit->sizeHint().height());
2657  qFileDialogUi->backButton->setFixedSize(toolSize);
2658  qFileDialogUi->listModeButton->setFixedSize(toolSize);
2659  qFileDialogUi->detailModeButton->setFixedSize(toolSize);
2660  qFileDialogUi->forwardButton->setFixedSize(toolSize);
2661  qFileDialogUi->toParentButton->setFixedSize(toolSize);
2662 
2663  qFileDialogUi->newFolderButton->setIcon(q->style()->standardIcon(QStyle::SP_FileDialogNewFolder, 0, q));
2664  qFileDialogUi->newFolderButton->setFixedSize(toolSize);
2665  qFileDialogUi->newFolderButton->setAutoRaise(true);
2666  qFileDialogUi->newFolderButton->setEnabled(false);
2667  QObject::connect(qFileDialogUi->newFolderButton, SIGNAL(clicked()), q, SLOT(_q_createDirectory()));
2668 }
void _q_navigateForward()
Navigates to the last directory viewed in the dialog.
void _q_navigateBackward()
Navigates to the last directory viewed in the dialog.
#define SLOT(a)
Definition: qobjectdefs.h:226
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void _q_createDirectory()
Creates a new directory, first asking the user for a suitable name.
void _q_navigateToParent()
Navigates to the parent directory of the currently displayed directory in the dialog.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ createWidgets()

void QFileDialogPrivate::createWidgets ( )
Warning
This function is not part of the public interface.

Create the widgets, set properties and connections

Definition at line 2410 of file qfiledialog.cpp.

Referenced by init().

2411 {
2412  Q_Q(QFileDialog);
2413  model = new QFileSystemModel(q);
2414  model->setObjectName(QLatin1String("qt_filesystem_model"));
2415 #ifdef Q_WS_MAC
2417 #else
2418  model->setNameFilterDisables(false);
2419 #endif
2420  model->d_func()->disableRecursiveSort = true;
2422  QFileDialog::connect(model, SIGNAL(rootPathChanged(QString)),
2423  q, SLOT(_q_pathChanged(QString)));
2424  QFileDialog::connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
2426  model->setReadOnly(false);
2427 
2428  qFileDialogUi.reset(new Ui_QFileDialog());
2429  qFileDialogUi->setupUi(q);
2430 
2431  QList<QUrl> initialBookmarks;
2432  initialBookmarks << QUrl::fromLocalFile(QLatin1String(""))
2434  qFileDialogUi->sidebar->init(model, initialBookmarks);
2435  QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(QUrl)),
2436  q, SLOT(_q_goToUrl(QUrl)));
2437 
2438  QObject::connect(qFileDialogUi->buttonBox, SIGNAL(accepted()), q, SLOT(accept()));
2439  QObject::connect(qFileDialogUi->buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
2440 
2441 
2442  qFileDialogUi->lookInCombo->init(this);
2443  QObject::connect(qFileDialogUi->lookInCombo, SIGNAL(activated(QString)), q, SLOT(_q_goToDirectory(QString)));
2444 
2445  qFileDialogUi->lookInCombo->setInsertPolicy(QComboBox::NoInsert);
2446  qFileDialogUi->lookInCombo->setDuplicatesEnabled(false);
2447 
2448  // filename
2449  qFileDialogUi->fileNameEdit->init(this);
2450 #ifndef QT_NO_SHORTCUT
2451  qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
2452 #endif
2453 #ifndef QT_NO_FSCOMPLETER
2454  completer = new QFSCompleter(model, q);
2455  qFileDialogUi->fileNameEdit->setCompleter(completer);
2456 #endif // QT_NO_FSCOMPLETER
2457  QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)),
2459  QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)),
2460  q, SLOT(_q_updateOkButton()));
2461 
2462  QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(returnPressed()), q, SLOT(accept()));
2463 
2464  // filetype
2465  qFileDialogUi->fileTypeCombo->setDuplicatesEnabled(false);
2466  qFileDialogUi->fileTypeCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
2467  qFileDialogUi->fileTypeCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
2468  QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(int)),
2469  q, SLOT(_q_useNameFilter(int)));
2470  QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(QString)),
2471  q, SIGNAL(filterSelected(QString)));
2472 
2473  qFileDialogUi->listView->init(this);
2474  qFileDialogUi->listView->setModel(model);
2475  QObject::connect(qFileDialogUi->listView, SIGNAL(activated(QModelIndex)),
2477  QObject::connect(qFileDialogUi->listView, SIGNAL(customContextMenuRequested(QPoint)),
2479 #ifndef QT_NO_SHORTCUT
2480  QShortcut *shortcut = new QShortcut(qFileDialogUi->listView);
2481  shortcut->setKey(QKeySequence(QLatin1String("Delete")));
2482  QObject::connect(shortcut, SIGNAL(activated()), q, SLOT(_q_deleteCurrent()));
2483 #endif
2484 
2485  qFileDialogUi->treeView->init(this);
2486  qFileDialogUi->treeView->setModel(model);
2487  QHeaderView *treeHeader = qFileDialogUi->treeView->header();
2488  QFontMetrics fm(q->font());
2489  treeHeader->resizeSection(0, fm.width(QLatin1String("wwwwwwwwwwwwwwwwwwwwwwwwww")));
2490  treeHeader->resizeSection(1, fm.width(QLatin1String("128.88 GB")));
2491  treeHeader->resizeSection(2, fm.width(QLatin1String("mp3Folder")));
2492  treeHeader->resizeSection(3, fm.width(QLatin1String("10/29/81 02:02PM")));
2494 
2495  QActionGroup *showActionGroup = new QActionGroup(q);
2496  showActionGroup->setExclusive(false);
2497  QObject::connect(showActionGroup, SIGNAL(triggered(QAction*)),
2498  q, SLOT(_q_showHeader(QAction*)));;
2499 
2500  QAbstractItemModel *abstractModel = model;
2501 #ifndef QT_NO_PROXYMODEL
2502  if (proxyModel)
2503  abstractModel = proxyModel;
2504 #endif
2505  for (int i = 1; i < abstractModel->columnCount(QModelIndex()); ++i) {
2506  QAction *showHeader = new QAction(showActionGroup);
2507  showHeader->setCheckable(true);
2508  showHeader->setChecked(true);
2509  treeHeader->addAction(showHeader);
2510  }
2511 
2512  QScopedPointer<QItemSelectionModel> selModel(qFileDialogUi->treeView->selectionModel());
2513  qFileDialogUi->treeView->setSelectionModel(qFileDialogUi->listView->selectionModel());
2514 
2515  QObject::connect(qFileDialogUi->treeView, SIGNAL(activated(QModelIndex)),
2517  QObject::connect(qFileDialogUi->treeView, SIGNAL(customContextMenuRequested(QPoint)),
2519 #ifndef QT_NO_SHORTCUT
2520  shortcut = new QShortcut(qFileDialogUi->treeView);
2521  shortcut->setKey(QKeySequence(QLatin1String("Delete")));
2522  QObject::connect(shortcut, SIGNAL(activated()), q, SLOT(_q_deleteCurrent()));
2523 #endif
2524 
2525  // Selections
2526  QItemSelectionModel *selections = qFileDialogUi->listView->selectionModel();
2527  QObject::connect(selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
2528  q, SLOT(_q_selectionChanged()));
2529  QObject::connect(selections, SIGNAL(currentChanged(QModelIndex,QModelIndex)),
2531  qFileDialogUi->splitter->setStretchFactor(qFileDialogUi->splitter->indexOf(qFileDialogUi->splitter->widget(1)), QSizePolicy::Expanding);
2532 
2534 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
The QItemSelectionModel class keeps track of a view&#39;s selected items.
The QFileSystemModel class provides a data model for the local filesystem.
void _q_showContextMenu(const QPoint &position)
void _q_enterDirectory(const QModelIndex &index)
This is called when the user double clicks on a file with the corresponding model item index...
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QAbstractProxyModel * proxyModel
void setNameFilterDisables(bool enable)
void setCheckable(bool)
Definition: qaction.cpp:1094
#define SLOT(a)
Definition: qobjectdefs.h:226
void _q_autoCompleteFileName(const QString &)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void _q_deleteCurrent()
Deletes the currently selected item in the dialog.
void _q_pathChanged(const QString &)
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
void resizeSection(int logicalIndex, int size)
Resizes the section specified by logicalIndex to size measured in pixels.
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
Definition: qwidget.cpp:7596
void addAction(QAction *action)
Appends the action action to this widget&#39;s list of actions.
Definition: qwidget.cpp:3317
The QActionGroup class groups actions together.
Definition: qactiongroup.h:57
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
The QShortcut class is used to create keyboard shortcuts.
Definition: qshortcut.h:57
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
#define Q_Q(Class)
Definition: qglobal.h:2483
void _q_fileRenamed(const QString &path, const QString oldName, const QString newName)
void _q_selectionChanged()
This is called when the model index corresponding to the current file is changed from index to curren...
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void setKey(const QKeySequence &key)
Definition: qshortcut.cpp:254
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
The QAbstractItemModel class provides the abstract interface for item model classes.
void setExclusive(bool)
The QItemSelection class manages information about selected items in a model.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition: qkeysequence.h:72
QCompleter that can deal with QFileSystemModel.
void setChecked(bool)
Definition: qaction.cpp:1138
QFSCompleter * completer
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QModelIndex class is used to locate data in a data model.
void _q_useNameFilter(int index)
Sets the current name filter to be nameFilter and update the qFileDialogUi->fileNameEdit when in Acce...
void _q_goToDirectory(const QString &)
Changes the file dialog&#39;s current directory to the one specified by path.
void _q_rowsInserted(const QModelIndex &parent)
When parent is root and rows have been inserted when none was there before then select the first one...
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
Definition: qurl.cpp:6374
void setReadOnly(bool enable)
void _q_goToUrl(const QUrl &url)
void _q_currentChanged(const QModelIndex &index)
void _q_showHeader(QAction *)
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi
The QHeaderView class provides a header row or header column for item views.
Definition: qheaderview.h:58
static QString homePath()
Returns the absolute path of the user&#39;s home directory.
Definition: qdir.cpp:1942

◆ currentView()

QAbstractItemView * QFileDialogPrivate::currentView ( ) const

Definition at line 1508 of file qfiledialog.cpp.

Referenced by _q_createDirectory(), and QFileDialogLineEdit::keyPressEvent().

1508  {
1509  if (!qFileDialogUi->stackedWidget)
1510  return 0;
1511  if (qFileDialogUi->stackedWidget->currentWidget() == qFileDialogUi->listView->parent())
1512  return qFileDialogUi->listView;
1513  return qFileDialogUi->treeView;
1514 }
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ deleteNativeDialog_sys()

void QFileDialogPrivate::deleteNativeDialog_sys ( )

Definition at line 758 of file qfiledialog_mac.mm.

Referenced by rootPath().

759 {
760 #ifndef QT_MAC_USE_COCOA
761  if (mDialog)
762  NavDialogDispose(mDialog);
763  mDialog = 0;
764  mDialogStarted = false;
765 #else
767  [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate) release];
768  mDelegate = 0;
769 #endif
770  nativeDialogInUse = false;
771 }
NavDialogRef mDialog
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ dialogResultCode_sys()

QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys ( )

Definition at line 1189 of file qfiledialog_mac.mm.

Referenced by rootPath().

1190 {
1191 #ifndef QT_MAC_USE_COCOA
1192  NavUserAction result = NavDialogGetUserAction(mDialog);
1193  if (result == kNavUserActionCancel || result == kNavUserActionNone)
1194  return QDialog::Rejected;
1195  else
1196  return QDialog::Accepted;
1197 #else
1199  return [delegate dialogResultCode];
1200 #endif
1201 }
NavDialogRef mDialog
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ directory_sys()

QString QFileDialogPrivate::directory_sys ( ) const

Definition at line 630 of file qfiledialog_mac.mm.

Referenced by rootPath().

631 {
632 #ifndef QT_MAC_USE_COCOA
633  return mCurrentLocation;
634 #else
637  return qt_mac_NSStringToQString([delegate->mSavePanel directory]);
638 #endif
639 }
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ emitFilesSelected()

void QFileDialogPrivate::emitFilesSelected ( const QStringList files)

Definition at line 642 of file qfiledialog.cpp.

643 {
644  Q_Q(QFileDialog);
645  emit q->filesSelected(files);
646  if (files.count() == 1)
647  emit q->fileSelected(files.first());
648 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282

◆ filterForMode()

QDir::Filters QFileDialogPrivate::filterForMode ( QDir::Filters  filters) const
inline

Definition at line 170 of file qfiledialog_p.h.

171  {
174  filters &= ~QDir::Files;
175  } else {
177  }
178  return filters;
179  }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
QFileDialog::FileMode fileMode
static const char *const filters[3]

◆ getEnvironmentVariable()

QString QFileDialogPrivate::getEnvironmentVariable ( const QString string)

Definition at line 3348 of file qfiledialog.cpp.

Referenced by _q_goToDirectory(), and _q_updateOkButton().

3349 {
3350 #ifdef Q_OS_UNIX
3351  if (string.size() > 1 && string.startsWith(QLatin1Char('$'))) {
3352  return QString::fromLocal8Bit(getenv(string.mid(1).toLatin1().constData()));
3353  }
3354 #else
3355  if (string.size() > 2 && string.startsWith(QLatin1Char('%')) && string.endsWith(QLatin1Char('%'))) {
3356  return QString::fromLocal8Bit(qgetenv(string.mid(1, string.size() - 2).toLatin1().constData()));
3357  }
3358 #endif
3359  return string;
3360 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ hideCarbonNavServicesDialog()

bool QFileDialogPrivate::hideCarbonNavServicesDialog ( )

Definition at line 1096 of file qfiledialog_mac.mm.

1097 {
1098  if (!mDialogClosed){
1099  mDialogClosed = true;
1100  NavCustomControl(mDialog, kNavCtlCancel, 0);
1101  }
1102  return true;
1103 }
NavDialogRef mDialog

◆ init()

void QFileDialogPrivate::init ( const QString directory = QString(),
const QString nameFilter = QString(),
const QString caption = QString() 
)
Warning
This function is not part of the public interface.

Create widgets, layout and set default values

Definition at line 2365 of file qfiledialog.cpp.

2367 {
2368  Q_Q(QFileDialog);
2369  if (!caption.isEmpty()) {
2370  useDefaultCaption = false;
2371  setWindowTitle = caption;
2372  q->setWindowTitle(caption);
2373  }
2374 
2375  createWidgets();
2378  q->setFileMode(fileMode);
2379 
2380 #ifndef QT_NO_SETTINGS
2381  QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
2382  settings.beginGroup(QLatin1String("Qt"));
2383  if (!directory.isEmpty())
2385  q->restoreState(settings.value(QLatin1String("filedialog")).toByteArray());
2386 #endif
2387 
2388 #if defined(Q_EMBEDDED_SMALLSCREEN)
2389  qFileDialogUi->lookInLabel->setVisible(false);
2390  qFileDialogUi->fileNameLabel->setVisible(false);
2391  qFileDialogUi->fileTypeLabel->setVisible(false);
2392  qFileDialogUi->sidebar->hide();
2393 #endif
2394  // Default case
2395  if (!nameFilter.isEmpty())
2396  q->setNameFilter(nameFilter);
2397  q->setAcceptMode(QFileDialog::AcceptOpen);
2398  q->setDirectory(workingDirectory(directory));
2399  q->selectFile(initialSelection(directory));
2400 
2402  q->resize(q->sizeHint());
2403 }
The QSettings class provides persistent platform-independent application settings.
Definition: qsettings.h:73
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QString workingDirectory(const QString &path)
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QFileDialog::FileMode fileMode
void setLastVisitedDirectory(const QString &dir)
static QString initialSelection(const QString &path)
void createMenuActions()
Create actions which will be used in the right click.
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ initialSelection()

QString QFileDialogPrivate::initialSelection ( const QString path)
static

Definition at line 2225 of file qfiledialog.cpp.

Referenced by QFileDialog::getOpenFileName(), QFileDialog::getOpenFileNames(), QFileDialog::getSaveFileName(), and init().

2226 {
2227  if (!path.isEmpty()) {
2228  QFileInfo info(path);
2229  if (!info.isDir())
2230  return info.fileName();
2231  }
2232  return QString();
2233 }
static mach_timebase_info_data_t info
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60

◆ itemViewKeyboardEvent()

bool QFileDialogPrivate::itemViewKeyboardEvent ( QKeyEvent event)
Warning
This function is not part of the public interface.

For the list and tree view watch keys to goto parent and back in the history

returns true if handled

Definition at line 3321 of file qfiledialog.cpp.

Referenced by QFileDialogListView::keyPressEvent(), and QFileDialogTreeView::keyPressEvent().

3321  {
3322 
3323  Q_Q(QFileDialog);
3324  switch (event->key()) {
3325  case Qt::Key_Backspace:
3327  return true;
3328  case Qt::Key_Back:
3329 #ifdef QT_KEYPAD_NAVIGATION
3330  if (QApplication::keypadNavigationEnabled())
3331  return false;
3332 #endif
3333  case Qt::Key_Left:
3334  if (event->key() == Qt::Key_Back || event->modifiers() == Qt::AltModifier) {
3336  return true;
3337  }
3338  break;
3339  case Qt::Key_Escape:
3340  q->hide();
3341  return true;
3342  default:
3343  break;
3344  }
3345  return false;
3346 }
void _q_navigateBackward()
Navigates to the last directory viewed in the dialog.
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
int key() const
Returns the code of the key that was pressed or released.
Definition: qevent.h:231
void _q_navigateToParent()
Navigates to the parent directory of the currently displayed directory in the dialog.

◆ lineEdit()

QLineEdit * QFileDialogPrivate::lineEdit ( ) const

Definition at line 1516 of file qfiledialog.cpp.

Referenced by _q_autoCompleteFileName(), _q_enterDirectory(), _q_fileRenamed(), _q_selectionChanged(), _q_updateOkButton(), _q_useNameFilter(), and typedFiles().

1516  {
1517  return (QLineEdit*)qFileDialogUi->fileNameEdit;
1518 }
The QLineEdit widget is a one-line text editor.
Definition: qlineedit.h:66
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ mac_nativeDialogModalHelp()

void QFileDialogPrivate::mac_nativeDialogModalHelp ( )
virtual

Reimplemented from QDialogPrivate.

Definition at line 1160 of file qfiledialog_mac.mm.

1161 {
1162  // Do a queued meta-call to open the native modal dialog so it opens after the new
1163  // event loop has started to execute (in QDialog::exec). Using a timer rather than
1164  // a queued meta call is intentional to ensure that the call is only delivered when
1165  // [NSApp run] runs (timers are handeled special in cocoa). If NSApp is not
1166  // running (which is the case if e.g a top-most QEventLoop has been
1167  // interrupted, and the second-most event loop has not yet been reactivated (regardless
1168  // if [NSApp run] is still on the stack)), showing a native modal dialog will fail.
1169  if (nativeDialogInUse){
1170  Q_Q(QFileDialog);
1172  }
1173 }
#define SLOT(a)
Definition: qobjectdefs.h:226
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
bool singleShot
This static function calls a slot after a given time interval.
Definition: qtimer.h:59

◆ mapFromSource()

QModelIndex QFileDialogPrivate::mapFromSource ( const QModelIndex index) const
inline

Definition at line 396 of file qfiledialog_p.h.

Referenced by _q_goToDirectory(), select(), and setRootIndex().

396  {
397 #ifdef QT_NO_PROXYMODEL
398  return index;
399 #else
400  return proxyModel ? proxyModel->mapFromSource(index) : index;
401 #endif
402 }
QAbstractProxyModel * proxyModel
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const =0
Reimplement this function to return the model index in the proxy model that corresponds to the source...
quint16 index

◆ mapToSource()

QModelIndex QFileDialogPrivate::mapToSource ( const QModelIndex index) const
inline

Definition at line 389 of file qfiledialog_p.h.

Referenced by _q_deleteCurrent(), _q_enterDirectory(), _q_selectionChanged(), _q_showContextMenu(), and rootIndex().

389  {
390 #ifdef QT_NO_PROXYMODEL
391  return index;
392 #else
393  return proxyModel ? proxyModel->mapToSource(index) : index;
394 #endif
395 }
QAbstractProxyModel * proxyModel
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const =0
Reimplement this function to return the model index in the source model that corresponds to the proxy...
quint16 index

◆ maxNameLength()

int QFileDialogPrivate::maxNameLength ( const QString path)
inline

Definition at line 142 of file qfiledialog_p.h.

Referenced by _q_updateOkButton(), and QFileDialog::accept().

142  {
143 #if defined(Q_OS_UNIX)
144  return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
145 #elif defined(Q_OS_WIN)
146 #ifndef Q_OS_WINCE
147  DWORD maxLength;
148  QString drive = path.left(3);
149  if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
150  return -1;
151  return maxLength;
152 #else
153  Q_UNUSED(path);
154  return MAX_PATH;
155 #endif //Q_OS_WINCE
156 #else
157  Q_UNUSED(path);
158 #endif
159  return -1;
160  }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QWidgetData data
Definition: qwidget_p.h:755
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
#define FALSE
Synonym for false.
Definition: qglobal.h:1019
static QByteArray encodeName(const QString &fileName)
By default, this function converts fileName to the local 8-bit encoding determined by the user&#39;s loca...
Definition: qfile.cpp:528
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290

◆ QNSOpenSavePanelDelegate_directoryEntered()

void QFileDialogPrivate::QNSOpenSavePanelDelegate_directoryEntered ( const QString newDir)

Definition at line 598 of file qfiledialog_mac.mm.

599 {
600  setLastVisitedDirectory(newDir);
601  emit q_func()->directoryEntered(newDir);
602 }
#define emit
Definition: qobjectdefs.h:76
void setLastVisitedDirectory(const QString &dir)

◆ QNSOpenSavePanelDelegate_filterSelected()

void QFileDialogPrivate::QNSOpenSavePanelDelegate_filterSelected ( int  menuIndex)

Definition at line 604 of file qfiledialog_mac.mm.

605 {
606  emit q_func()->filterSelected(nameFilters.at(menuIndex));
607 }
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
QStringList nameFilters

◆ QNSOpenSavePanelDelegate_panelClosed()

void QFileDialogPrivate::QNSOpenSavePanelDelegate_panelClosed ( bool  accepted)

Definition at line 590 of file qfiledialog_mac.mm.

591 {
592  if (accepted)
593  q_func()->accept();
594  else
595  q_func()->reject();
596 }

◆ QNSOpenSavePanelDelegate_selectionChanged()

void QFileDialogPrivate::QNSOpenSavePanelDelegate_selectionChanged ( const QString newPath)

Definition at line 585 of file qfiledialog_mac.mm.

586 {
587  emit q_func()->currentChanged(newPath);
588 }
#define emit
Definition: qobjectdefs.h:76

◆ qt_mac_filedialog_event_proc()

void QFileDialogPrivate::qt_mac_filedialog_event_proc ( const NavEventCallbackMessage  msg,
NavCBRecPtr  p,
NavCallBackUserData  data 
)
static

Definition at line 842 of file qfiledialog_mac.mm.

Referenced by createNavServicesDialog().

844 {
845  QFileDialogPrivate *fileDialogPrivate = static_cast<QFileDialogPrivate *>(data);
846 
847  switch(msg) {
848  case kNavCBPopupMenuSelect: {
849  NavMenuItemSpec *s = static_cast<NavMenuItemSpec *>(p->eventData.eventDataParms.param);
850  if (int(s->menuType) != fileDialogPrivate->filterInfo.currentSelection) {
851  fileDialogPrivate->filterInfo.currentSelection = s->menuType;
852  emit fileDialogPrivate->q_func()->filterSelected(fileDialogPrivate->nameFilters.at(s->menuType));
853  }
854  if (fileDialogPrivate->acceptMode == QFileDialog::AcceptSave) {
855  QString base = QCFString::toQString(NavDialogGetSaveFileName(p->context));
856  QFileInfo fi(base);
857  base = fi.completeBaseName();
858  const QtMacFilterName &fn = fileDialogPrivate->filterInfo.filters.at(
859  fileDialogPrivate->filterInfo.currentSelection);
860  QStringList reg = fn.regexp.split(QLatin1String(";"), QString::SkipEmptyParts);
861  if (reg.count()) {
862  QString r = reg.first();
863  r = r.right(r.length()-1); // Strip the *
864  base += r; //"." + QString::number(s->menuType);
865  }
866  NavDialogSetSaveFileName(p->context, QCFString::toCFStringRef(base));
867  }
868 #ifdef DEBUG_FILEDIALOG_FILTERS
869  qDebug("QFileDialogPrivate::qt_mac_filedialog_event_proc:%d - Selected a filter: %ld", __LINE__, s->menuType);
870 #endif
871  break; }
872  case kNavCBStart:{
873  fileDialogPrivate->mDialogStarted = true;
874  // Set selected file:
875  QModelIndexList indexes = fileDialogPrivate->qFileDialogUi->listView->selectionModel()->selectedRows();
876  QString selected;
877  if (!indexes.isEmpty())
878  selected = indexes.at(0).data(QFileSystemModel::FilePathRole).toString();
879  else
880  selected = fileDialogPrivate->typedFiles().value(0);
881  fileDialogPrivate->selectFile_sys(selected);
882  fileDialogPrivate->selectNameFilter_sys(fileDialogPrivate->qFileDialogUi->fileTypeCombo->currentText());
883  break; }
884  case kNavCBSelectEntry:{
885  // Event: Current selection has changed.
886  QStringList prevSelectionList = fileDialogPrivate->mCurrentSelectionList;
887  fileDialogPrivate->mCurrentSelectionList.clear();
888  QString fileNameToEmit;
889 
890  AEDescList *descList = (AEDescList *)p->eventData.eventDataParms.param;
891  // Get the number of files selected:
892  UInt8 strBuffer[1024];
893  long count;
894  OSErr err = AECountItems(descList, &count);
895  if (err != noErr || !count)
896  break;
897 
898  for (long index=1; index<=count; ++index) {
899  FSRef ref;
900  err = AEGetNthPtr(descList, index, typeFSRef, 0, 0, &ref, sizeof(ref), 0);
901  if (err != noErr)
902  break;
903  FSRefMakePath(&ref, strBuffer, 1024);
904  QString selected = QString::fromUtf8((const char *)strBuffer);
905  fileDialogPrivate->mCurrentSelectionList << selected;
906  if (!prevSelectionList.contains(selected))
907  fileNameToEmit = selected;
908  }
909 
910  if (!fileNameToEmit.isEmpty() && fileNameToEmit != fileDialogPrivate->mCurrentSelection)
911  emit fileDialogPrivate->q_func()->currentChanged(fileNameToEmit);
912  fileDialogPrivate->mCurrentSelection = fileNameToEmit;
913  break; }
914  case kNavCBShowDesktop:
915  case kNavCBNewLocation:{
916  // Event: Current directory has changed.
917  AEDesc *desc = (AEDesc *)p->eventData.eventDataParms.param;
918  FSRef ref;
919  AEGetDescData(desc, &ref, sizeof(ref));
920  UInt8 *strBuffer = (UInt8 *)malloc(1024);
921  FSRefMakePath(&ref, strBuffer, 1024);
922  QString newLocation = QString::fromUtf8((const char *)strBuffer);
923  free(strBuffer);
924  if (fileDialogPrivate->mCurrentLocation != newLocation){
925  fileDialogPrivate->mCurrentLocation = newLocation;
926  QFileDialog::FileMode mode = fileDialogPrivate->fileMode;
927  if (mode == QFileDialog::AnyFile || mode == QFileDialog::ExistingFile
928  || mode == QFileDialog::ExistingFiles){
929  // When changing directory, the current selection is cleared if
930  // we are supposed to be selecting files only:
931  if (!fileDialogPrivate->mCurrentSelection.isEmpty()){
932  fileDialogPrivate->mCurrentSelectionList.clear();
933  fileDialogPrivate->mCurrentSelection.clear();
934  emit fileDialogPrivate->q_func()->currentChanged(fileDialogPrivate->mCurrentSelection);
935  }
936  }
937  fileDialogPrivate->setLastVisitedDirectory(newLocation);
938  emit fileDialogPrivate->q_func()->directoryEntered(newLocation);
939  }
940  break; }
941  case kNavCBAccept:
942  fileDialogPrivate->mDialogClosed = true;
943  fileDialogPrivate->q_func()->accept();
944  break;
945  case kNavCBCancel:
946  fileDialogPrivate->mDialogClosed = true;
947  fileDialogPrivate->q_func()->reject();
948  break;
949  }
950 }
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
QFileDialog::AcceptMode acceptMode
void selectFile_sys(const QString &filename)
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
static CFStringRef toCFStringRef(const QString &str)
Definition: qcore_mac.cpp:69
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
static QString toQString(CFStringRef cfstr)
Definition: qcore_mac.cpp:47
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
static const uint base
Definition: qurl.cpp:268
QStringList mCurrentSelectionList
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWidgetData data
Definition: qwidget_p.h:755
QStringList typedFiles() const
Q_CORE_EXPORT void qDebug(const char *,...)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QList< QtMacFilterName > filters
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
struct AEDesc AEDescList
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.
Definition: qstringlist.h:172
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.
Definition: qstring.cpp:3682
T value(int i) const
Returns the value at index position i in the list.
Definition: qlist.h:661
void clear()
Removes all items from the list.
Definition: qlist.h:764
QStringList nameFilters
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
FileMode
This enum is used to indicate what the user may select in the file dialog; i.
Definition: qfiledialog.h:83
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723
quint16 index
void setLastVisitedDirectory(const QString &dir)
struct QFileDialogPrivate::QtMacNavFilterInfo filterInfo
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ qt_mac_filedialog_filter_proc()

Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc ( AEDesc *  theItem,
void *  info,
void *  data,
NavFilterModes   
)
static

Definition at line 795 of file qfiledialog_mac.mm.

Referenced by createNavServicesDialog().

797 {
798  QFileDialogPrivate *fileDialogPrivate = static_cast<QFileDialogPrivate *>(data);
799 
800  if (!fileDialogPrivate || fileDialogPrivate->filterInfo.filters.isEmpty()
801  || (fileDialogPrivate->filterInfo.currentSelection < 0
802  && fileDialogPrivate->filterInfo.currentSelection
803  >= fileDialogPrivate->filterInfo.filters.size()))
804  return true;
805 
806  NavFileOrFolderInfo *theInfo = static_cast<NavFileOrFolderInfo *>(info);
807  QString file;
808  QString path;
809  const QtMacFilterName &fn
810  = fileDialogPrivate->filterInfo.filters.at(fileDialogPrivate->filterInfo.currentSelection);
811  if (theItem->descriptorType == typeFSRef) {
812  FSRef ref;
813  AEGetDescData(theItem, &ref, sizeof(ref));
814  UInt8 str_buffer[1024];
815  FSRefMakePath(&ref, str_buffer, 1024);
816  path = QString::fromUtf8(reinterpret_cast<const char *>(str_buffer));
817  int slsh = path.lastIndexOf(QLatin1Char('/'));
818  if (slsh != -1)
819  file = path.right(path.length() - slsh - 1);
820  else
821  file = path;
822  }
823  QStringList reg = fn.regexp.split(QLatin1String(";"));
824  for (QStringList::const_iterator it = reg.constBegin(); it != reg.constEnd(); ++it) {
826 #ifdef DEBUG_FILEDIALOG_FILTERS
827  qDebug("QFileDialogPrivate::qt_mac_filedialog_filter_proc:%d, asked to filter.. %s (%s)", __LINE__,
828  qPrintable(file), qPrintable(*it));
829 #endif
830  if (rg.exactMatch(file))
831  return true;
832  }
833 
834  if (theInfo->isFolder) {
835  if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:qt_mac_QStringToNSString(path)])
836  return false;
837  return true;
838  }
839  return false;
840 }
static mach_timebase_info_data_t info
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
#define it(className, varName)
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
QWidgetData data
Definition: qwidget_p.h:755
Q_CORE_EXPORT void qDebug(const char *,...)
friend class const_iterator
Definition: qlist.h:264
QList< QtMacFilterName > filters
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
QString right(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n rightmost characters of the string.
Definition: qstring.cpp:3682
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:3000
struct QFileDialogPrivate::QtMacNavFilterInfo filterInfo
#define qPrintable(string)
Definition: qglobal.h:1750
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ removeDirectory()

bool QFileDialogPrivate::removeDirectory ( const QString path)

Definition at line 2916 of file qfiledialog.cpp.

Referenced by _q_deleteCurrent().

2917 {
2918  QModelIndex modelIndex = model->index(path);
2919  return model->remove(modelIndex);
2920 }
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
bool remove(const QModelIndex &index) const
Removes the model item index from the file system model and deletes the corresponding file from the f...
QFileSystemModel * model

◆ retranslateStrings()

void QFileDialogPrivate::retranslateStrings ( )

Definition at line 607 of file qfiledialog.cpp.

Referenced by init().

608 {
609  Q_Q(QFileDialog);
610  /* WIDGETS */
611  if (defaultFileTypes)
612  q->setNameFilter(QFileDialog::tr("All Files (*)"));
613 
614  QList<QAction*> actions = qFileDialogUi->treeView->header()->actions();
615  QAbstractItemModel *abstractModel = model;
616 #ifndef QT_NO_PROXYMODEL
617  if (proxyModel)
618  abstractModel = proxyModel;
619 #endif
620  int total = qMin(abstractModel->columnCount(QModelIndex()), actions.count() + 1);
621  for (int i = 1; i < total; ++i) {
622  actions.at(i - 1)->setText(QFileDialog::tr("Show ") + abstractModel->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString());
623  }
624 
625  /* MENU ACTIONS */
626  renameAction->setText(QFileDialog::tr("&Rename"));
627  deleteAction->setText(QFileDialog::tr("&Delete"));
628  showHiddenAction->setText(QFileDialog::tr("Show &hidden files"));
629  newFolderAction->setText(QFileDialog::tr("&New Folder"));
630  qFileDialogUi->retranslateUi(q);
631 
634  q->setLabelText(QFileDialog::FileName, QFileDialog::tr("Directory:"));
635  } else {
636  q->setLabelText(QFileDialog::FileName, QFileDialog::tr("File &name:"));
637  }
639  }
640 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QAbstractProxyModel * proxyModel
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
#define Q_Q(Class)
Definition: qglobal.h:2483
QAction * renameAction
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QAction * newFolderAction
void setText(const QString &text)
Definition: qaction.cpp:860
QFileDialog::FileMode fileMode
QAction * showHiddenAction
The QAbstractItemModel class provides the abstract interface for item model classes.
QAction * deleteAction
The QModelIndex class is used to locate data in a data model.
QList< QAction * > actions
Definition: qwidget_p.h:760
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ retranslateWindowTitle()

void QFileDialogPrivate::retranslateWindowTitle ( )

Definition at line 586 of file qfiledialog.cpp.

587 {
588  Q_Q(QFileDialog);
589  if (!useDefaultCaption || setWindowTitle != q->windowTitle())
590  return;
593  q->setWindowTitle(QFileDialog::tr("Find Directory"));
594  else
595  q->setWindowTitle(QFileDialog::tr("Open"));
596  } else
597  q->setWindowTitle(QFileDialog::tr("Save As"));
598 
599  setWindowTitle = q->windowTitle();
600 }
QFileDialog::AcceptMode acceptMode
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
QFileDialog::FileMode fileMode

◆ rootIndex()

QModelIndex QFileDialogPrivate::rootIndex ( ) const
inline

Definition at line 1504 of file qfiledialog.cpp.

Referenced by _q_createDirectory().

1504  {
1505  return mapToSource(qFileDialogUi->listView->rootIndex());
1506 }
QModelIndex mapToSource(const QModelIndex &index) const
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ rootPath()

QString QFileDialogPrivate::rootPath ( ) const
inline

Definition at line 404 of file qfiledialog_p.h.

Referenced by _q_fileRenamed(), and addDefaultSuffixToFiles().

404  {
405  return model->rootPath();
406 }
QString rootPath() const
The currently set root path.
QFileSystemModel * model

◆ select()

QModelIndex QFileDialogPrivate::select ( const QModelIndex index) const
inline

Definition at line 1533 of file qfiledialog.cpp.

Referenced by _q_autoCompleteFileName(), and _q_createDirectory().

1533  {
1534  Q_ASSERT(index.isValid() ? index.model() == model : true);
1535 
1536  QModelIndex idx = mapFromSource(index);
1537  if (idx.isValid() && !qFileDialogUi->listView->selectionModel()->isSelected(idx))
1538  qFileDialogUi->listView->selectionModel()->select(idx,
1540  return idx;
1541 }
QModelIndex mapFromSource(const QModelIndex &index) const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QModelIndex class is used to locate data in a data model.
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ selectedFiles_sys()

QStringList QFileDialogPrivate::selectedFiles_sys ( ) const

Definition at line 682 of file qfiledialog_mac.mm.

Referenced by rootPath().

683 {
684 #ifndef QT_MAC_USE_COCOA
685  if (q_func()->acceptMode() == QFileDialog::AcceptOpen){
686  return mCurrentSelectionList;
687  } else {
688  return QStringList() << mCurrentLocation + QLatin1Char('/')
689  + QCFString::toQString(NavDialogGetSaveFileName(mDialog));
690  }
691 #else
694  return [delegate selectedFiles];
695 #endif
696 }
QFileDialog::AcceptMode acceptMode
static QString toQString(CFStringRef cfstr)
Definition: qcore_mac.cpp:47
QStringList mCurrentSelectionList
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
NavDialogRef mDialog
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ selectedNameFilter_sys()

QString QFileDialogPrivate::selectedNameFilter_sys ( ) const

Definition at line 746 of file qfiledialog_mac.mm.

Referenced by rootPath().

747 {
748 #ifndef QT_MAC_USE_COCOA
750 #else
753  int index = [delegate->mPopUpButton indexOfSelectedItem];
754 #endif
755  return index != -1 ? nameFilters.at(index) : QString();
756 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QStringList nameFilters
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
quint16 index
struct QFileDialogPrivate::QtMacNavFilterInfo filterInfo

◆ selectFile_sys()

void QFileDialogPrivate::selectFile_sys ( const QString filename)

Definition at line 641 of file qfiledialog_mac.mm.

Referenced by qt_mac_filedialog_event_proc(), and rootPath().

642 {
643  QString filePath = filename;
644  if (QDir::isRelativePath(filePath))
645  filePath = QFileInfo(directory_sys(), filePath).filePath();
646 
647 #ifndef QT_MAC_USE_COCOA
648  // Update the selection list immidiatly, so
649  // subsequent calls to selectedFiles() gets correct:
651  mCurrentSelectionList << filename;
652  if (mCurrentSelection != filename){
653  mCurrentSelection = filename;
654  emit q_func()->currentChanged(mCurrentSelection);
655  }
656 
657  AEDescList descList;
658  if (AECreateList(0, 0, false, &descList) != noErr)
659  return;
660 
661  FSRef fsRef;
662  if (qt_mac_create_fsref(filePath, &fsRef) == noErr) {
663  AEDesc desc;
664  if (AECreateDesc(typeFSRef, &fsRef, sizeof(FSRef), &desc) == noErr){
665  if (AEPutDesc(&descList, 0, &desc) == noErr)
666  NavCustomControl(mDialog, kNavCtlSetSelection, (void*)&descList);
667  }
668  }
669 
670  // Type the file name into the save dialog's text field:
671  UInt8 *strBuffer = (UInt8 *)malloc(1024);
672  qt_mac_to_pascal_string(QFileInfo(filename).fileName(), strBuffer);
673  NavCustomControl(mDialog, kNavCtlSetEditFileName, strBuffer);
674  free(strBuffer);
675 #else
676  // There seems to no way to select a file once the dialog is running.
677  // So do the next best thing, set the file's directory:
678  setDirectory_sys(QFileInfo(filePath).absolutePath());
679 #endif
680 }
static bool isRelativePath(const QString &path)
Returns true if path is relative; returns false if it is absolute.
Definition: qdir.cpp:2210
The QString class provides a Unicode character string.
Definition: qstring.h:83
QStringList mCurrentSelectionList
OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref)
Definition: qcore_mac.cpp:125
#define emit
Definition: qobjectdefs.h:76
struct AEDesc AEDescList
QString directory_sys() const
void clear()
Removes all items from the list.
Definition: qlist.h:764
NavDialogRef mDialog
void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding, int len)
Definition: qcore_mac.cpp:91
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
Definition: qfileinfo.cpp:707
void setDirectory_sys(const QString &directory)
static QString fileName(const QString &fileUrl)

◆ selectNameFilter_sys()

void QFileDialogPrivate::selectNameFilter_sys ( const QString filter)

Definition at line 728 of file qfiledialog_mac.mm.

Referenced by qt_mac_filedialog_event_proc(), and rootPath().

729 {
730  int index = nameFilters.indexOf(filter);
731  if (index != -1) {
732 #ifndef QT_MAC_USE_COCOA
733  NavMenuItemSpec navSpec;
734  bzero(&navSpec, sizeof(NavMenuItemSpec));
735  navSpec.menuType = index;
736  NavCustomControl(mDialog, kNavCtlSelectCustomType, &navSpec);
737 #else
740  [delegate->mPopUpButton selectItemAtIndex:index];
741  [delegate filterChanged:nil];
742 #endif
743  }
744 }
int indexOf(const QRegExp &rx, int from=0) const
Returns the index position of the first exact match of rx in the list, searching forward from index p...
Definition: qstringlist.h:195
QStringList nameFilters
NavDialogRef mDialog
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
quint16 index

◆ setDirectory_sys()

void QFileDialogPrivate::setDirectory_sys ( const QString directory)

Definition at line 609 of file qfiledialog_mac.mm.

Referenced by rootPath().

610 {
611 #ifndef QT_MAC_USE_COCOA
612  if (directory == mCurrentLocation)
613  return;
614  mCurrentLocation = directory;
615  emit q_func()->directoryEntered(mCurrentLocation);
616 
617  FSRef fsRef;
618  if (qt_mac_create_fsref(directory, &fsRef) == noErr) {
619  AEDesc desc;
620  if (AECreateDesc(typeFSRef, &fsRef, sizeof(FSRef), &desc) == noErr)
621  NavCustomControl(mDialog, kNavCtlSetLocation, (void*)&desc);
622  }
623 #else
626  [delegate->mSavePanel setDirectory:qt_mac_QStringToNSString(directory)];
627 #endif
628 }
OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref)
Definition: qcore_mac.cpp:125
#define emit
Definition: qobjectdefs.h:76
NavDialogRef mDialog
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ setFilter_sys()

void QFileDialogPrivate::setFilter_sys ( )

Definition at line 710 of file qfiledialog_mac.mm.

Referenced by rootPath().

711 {
712 #ifndef QT_MAC_USE_COCOA
713 #else
714  Q_Q(QFileDialog);
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]];
722  [delegate->mSavePanel setNameFieldLabel:[delegate strip:qFileDialogUi->fileNameLabel->text()]];
723 
724  [delegate updateProperties];
725 #endif
726 }
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
QFileDialog::FileMode fileMode
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
QDir::Filters filter() const
Returns the filter specified for the directory model.
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ setLastVisitedDirectory()

void QFileDialogPrivate::setLastVisitedDirectory ( const QString dir)

Definition at line 602 of file qfiledialog.cpp.

Referenced by init(), and qt_mac_filedialog_event_proc().

603 {
604  *lastVisitedDir() = dir;
605 }

◆ setNameFilters_sys()

void QFileDialogPrivate::setNameFilters_sys ( const QStringList filters)

Definition at line 698 of file qfiledialog_mac.mm.

Referenced by rootPath().

699 {
700 #ifndef QT_MAC_USE_COCOA
701  Q_UNUSED(filters);
702 #else
705  bool hideDetails = q_func()->testOption(QFileDialog::HideNameFilterDetails);
706  [delegate setNameFilters:filters hideDetails:hideDetails];
707 #endif
708 }
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ setRootIndex()

void QFileDialogPrivate::setRootIndex ( const QModelIndex index) const
inline

Definition at line 1523 of file qfiledialog.cpp.

1523  {
1524  Q_ASSERT(index.isValid() ? index.model() == model : true);
1525  QModelIndex idx = mapFromSource(index);
1526  qFileDialogUi->treeView->setRootIndex(idx);
1527  qFileDialogUi->listView->setRootIndex(idx);
1528 }
QModelIndex mapFromSource(const QModelIndex &index) const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QModelIndex class is used to locate data in a data model.
QFileSystemModel * model
QScopedPointer< Ui_QFileDialog > qFileDialogUi

◆ setVisible_sys()

bool QFileDialogPrivate::setVisible_sys ( bool  visible)

Definition at line 773 of file qfiledialog_mac.mm.

Referenced by rootPath().

774 {
775  Q_Q(QFileDialog);
776  if (!visible == q->isHidden())
777  return false;
778 
779  if (q->windowFlags() & Qt::WindowStaysOnTopHint) {
780  // The native file dialog tries all it can to stay
781  // on the NSModalPanel level. And it might also show
782  // its own "create directory" dialog that we cannot control.
783  // So we need to use the non-native version in this case...
784  return false;
785  }
786 
787 #ifndef QT_MAC_USE_COCOA
789 #else
790  return visible ? showCocoaFilePanel() : hideCocoaFilePanel();
791 #endif
792 }
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ showCarbonNavServicesDialog()

bool QFileDialogPrivate::showCarbonNavServicesDialog ( )

Definition at line 1084 of file qfiledialog_mac.mm.

1085 {
1086  Q_Q(QFileDialog);
1087  if (q->acceptMode() == QFileDialog::AcceptSave && q->windowModality() == Qt::NonModal)
1088  return false; // cannot do native no-modal save dialogs.
1090  mDialogClosed = false;
1091  if (q->windowModality() != Qt::ApplicationModal)
1092  NavDialogRun(mDialog);
1093  return true;
1094 }
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
NavDialogRef mDialog

◆ toInternal()

static QString QFileDialogPrivate::toInternal ( const QString path)
inlinestatic

Definition at line 183 of file qfiledialog_p.h.

Referenced by addDefaultSuffixToFiles(), and typedFiles().

184  {
185 #if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
186  QString n(path);
187  for (int i = 0; i < (int)n.length(); ++i)
188  if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/');
189 #if defined(Q_OS_WINCE)
190  if ((n.size() > 1) && (n.startsWith(QLatin1String("//"))))
191  n = n.mid(1);
192 #endif
193  return n;
194 #else // the compile should optimize away this
195  return path;
196 #endif
197  }
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ typedFiles()

QStringList QFileDialogPrivate::typedFiles ( ) const

Returns the text in the line edit which can be one or more file names

Definition at line 980 of file qfiledialog.cpp.

Referenced by _q_autoCompleteFileName(), and qt_mac_filedialog_event_proc().

981 {
982 #ifdef Q_OS_UNIX
983  Q_Q(const QFileDialog);
984 #endif
985  QStringList files;
986  QString editText = lineEdit()->text();
987  if (!editText.contains(QLatin1Char('"'))) {
988 #ifdef Q_OS_UNIX
989  const QString prefix = q->directory().absolutePath() + QDir::separator();
990  if (QFile::exists(prefix + editText))
991  files << editText;
992  else
993  files << qt_tildeExpansion(editText);
994 #else
995  files << editText;
996 #endif
997  } else {
998  // " is used to separate files like so: "file1" "file2" "file3" ...
999  // ### need escape character for filenames with quotes (")
1000  QStringList tokens = editText.split(QLatin1Char('\"'));
1001  for (int i=0; i<tokens.size(); ++i) {
1002  if ((i % 2) == 0)
1003  continue; // Every even token is a separator
1004 #ifdef Q_OS_UNIX
1005  const QString token = tokens.at(i);
1006  const QString prefix = q->directory().absolutePath() + QDir::separator();
1007  if (QFile::exists(prefix + token))
1008  files << token;
1009  else
1010  files << qt_tildeExpansion(token);
1011 #else
1012  files << toInternal(tokens.at(i));
1013 #endif
1014  }
1015  }
1016  return addDefaultSuffixToFiles(files);
1017 }
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded=0)
QStringList addDefaultSuffixToFiles(const QStringList filesToFix) const
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QChar separator()
Returns the native directory separator: "/" under Unix (including Mac OS X) and "\\" under Windows...
Definition: qdir.cpp:1831
The QFileDialog class provides a dialog that allow users to select files or directories.
Definition: qfiledialog.h:66
#define Q_Q(Class)
Definition: qglobal.h:2483
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
Definition: qfile.cpp:626
QString text
the line edit&#39;s text
Definition: qlineedit.h:72
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QLineEdit * lineEdit() const
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static QString toInternal(const QString &path)
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...
Definition: qstring.cpp:6526
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ workingDirectory()

QString QFileDialogPrivate::workingDirectory ( const QString path)
static

Definition at line 2205 of file qfiledialog.cpp.

Referenced by QFileDialog::getExistingDirectory(), QFileDialog::getOpenFileName(), QFileDialog::getOpenFileNames(), QFileDialog::getSaveFileName(), and init().

2206 {
2207  if (!path.isEmpty()) {
2208  QString directory = _qt_get_directory(path);
2209  if (!directory.isEmpty())
2210  return directory;
2211  }
2212  QString directory = _qt_get_directory(*lastVisitedDir());
2213  if (!directory.isEmpty())
2214  return directory;
2215  return QDir::currentPath();
2216 }
static QString _qt_get_directory(const QString &path)
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QString currentPath()
Returns the absolute path of the application&#39;s current directory.
Definition: qdir.cpp:1875
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704

Properties

◆ acceptLabel

QString QFileDialogPrivate::acceptLabel

Definition at line 323 of file qfiledialog_p.h.

Referenced by _q_updateOkButton().

◆ acceptMode

QFileDialog::AcceptMode QFileDialogPrivate::acceptMode

◆ completer

QFSCompleter* QFileDialogPrivate::completer

Definition at line 238 of file qfiledialog_p.h.

Referenced by createWidgets().

◆ confirmOverwrite

bool QFileDialogPrivate::confirmOverwrite

Definition at line 243 of file qfiledialog_p.h.

Referenced by QFileDialog::accept().

◆ currentHistory

QStringList QFileDialogPrivate::currentHistory

◆ currentHistoryLocation

int QFileDialogPrivate::currentHistoryLocation

Definition at line 248 of file qfiledialog_p.h.

Referenced by _q_navigateBackward(), _q_navigateForward(), and _q_pathChanged().

◆ defaultFileTypes

bool QFileDialogPrivate::defaultFileTypes

Definition at line 256 of file qfiledialog_p.h.

Referenced by retranslateStrings().

◆ defaultSuffix

QString QFileDialogPrivate::defaultSuffix

Definition at line 244 of file qfiledialog_p.h.

Referenced by addDefaultSuffixToFiles().

◆ deleteAction

QAction* QFileDialogPrivate::deleteAction

Definition at line 251 of file qfiledialog_p.h.

Referenced by _q_showContextMenu(), createMenuActions(), and retranslateStrings().

◆ fileMode

QFileDialog::FileMode QFileDialogPrivate::fileMode

◆ fileNameLabelExplicitlySat

bool QFileDialogPrivate::fileNameLabelExplicitlySat

Definition at line 257 of file qfiledialog_p.h.

Referenced by retranslateStrings().

◆ filterInfo

struct QFileDialogPrivate::QtMacNavFilterInfo QFileDialogPrivate::filterInfo

◆ mCurrentLocation

QString QFileDialogPrivate::mCurrentLocation

Definition at line 286 of file qfiledialog_p.h.

Referenced by qt_mac_filedialog_event_proc().

◆ mCurrentSelection

QString QFileDialogPrivate::mCurrentSelection

Definition at line 287 of file qfiledialog_p.h.

Referenced by qt_mac_filedialog_event_proc().

◆ mCurrentSelectionList

QStringList QFileDialogPrivate::mCurrentSelectionList

Definition at line 288 of file qfiledialog_p.h.

Referenced by qt_mac_filedialog_event_proc().

◆ mDelegate

void* QFileDialogPrivate::mDelegate

Definition at line 281 of file qfiledialog_p.h.

◆ mDialog

NavDialogRef QFileDialogPrivate::mDialog

Definition at line 283 of file qfiledialog_p.h.

◆ mDialogClosed

bool QFileDialogPrivate::mDialogClosed

Definition at line 285 of file qfiledialog_p.h.

Referenced by qt_mac_filedialog_event_proc().

◆ mDialogStarted

bool QFileDialogPrivate::mDialogStarted

Definition at line 284 of file qfiledialog_p.h.

Referenced by qt_mac_filedialog_event_proc().

◆ memberToDisconnectOnClose

QByteArray QFileDialogPrivate::memberToDisconnectOnClose

Definition at line 326 of file qfiledialog_p.h.

◆ model

QFileSystemModel* QFileDialogPrivate::model

◆ nameFilters

QStringList QFileDialogPrivate::nameFilters

◆ nativeDialogInUse

bool QFileDialogPrivate::nativeDialogInUse

Definition at line 261 of file qfiledialog_p.h.

Referenced by canBeNativeDialog().

◆ newFolderAction

QAction* QFileDialogPrivate::newFolderAction

Definition at line 253 of file qfiledialog_p.h.

Referenced by _q_showContextMenu(), createMenuActions(), and retranslateStrings().

◆ opts

QFileDialog::Options QFileDialogPrivate::opts

Definition at line 329 of file qfiledialog_p.h.

Referenced by canBeNativeDialog().

◆ proxyModel

QAbstractProxyModel* QFileDialogPrivate::proxyModel

◆ qFileDialogUi

QScopedPointer<Ui_QFileDialog> QFileDialogPrivate::qFileDialogUi

◆ receiverToDisconnectOnClose

QPointer<QObject> QFileDialogPrivate::receiverToDisconnectOnClose

Definition at line 325 of file qfiledialog_p.h.

◆ renameAction

QAction* QFileDialogPrivate::renameAction

Definition at line 250 of file qfiledialog_p.h.

Referenced by _q_showContextMenu(), createMenuActions(), and retranslateStrings().

◆ setWindowTitle

QString QFileDialogPrivate::setWindowTitle

Definition at line 245 of file qfiledialog_p.h.

Referenced by init(), and retranslateWindowTitle().

◆ showHiddenAction

QAction* QFileDialogPrivate::showHiddenAction

◆ signalToDisconnectOnClose

QByteArray QFileDialogPrivate::signalToDisconnectOnClose

Definition at line 327 of file qfiledialog_p.h.

◆ useDefaultCaption

bool QFileDialogPrivate::useDefaultCaption

Definition at line 255 of file qfiledialog_p.h.

Referenced by init(), and retranslateWindowTitle().

◆ watching

QStringList QFileDialogPrivate::watching

Definition at line 234 of file qfiledialog_p.h.


The documentation for this class was generated from the following files: