6#include <QtCore/qloggingcategory.h>
7#include <QtGui/qwindow.h>
8#include <QtQml/qqmlcontext.h>
9#include <QtQml/qqmlinfo.h>
10#include <QtQuick/qquickwindow.h>
11#include <QtQuickDialogs2Utils/private/qquickfilenamefilter_p.h>
12#include <QtQuickTemplates2/private/qquickdialog_p.h>
13#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
14#include <QtQuickTemplates2/private/qquickpopupanchors_p.h>
20Q_LOGGING_CATEGORY(lcQuickPlatformFileDialog,
"qt.quick.dialogs.quickplatformfiledialog")
32 qCDebug(lcQuickPlatformFileDialog) <<
"creating non-native Qt Quick FileDialog with parent" <<
parent;
40 qmlWarning(
parent) <<
"No QQmlContext for QQuickPlatformFileDialog; can't create non-native FileDialog implementation";
44 const auto dialogQmlUrl =
QUrl(
QStringLiteral(
"qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/qml/FileDialog.qml"));
46 if (!fileDialogComponent.
isReady()) {
50 m_dialog = qobject_cast<QQuickFileDialogImpl*>(fileDialogComponent.
create());
56 m_dialog->setParent(
this);
106 if (m_dialog->isVisible()) {
107 qWarning() <<
"Cannot set an initial selectedFile while FileDialog is open";
140 m_pendingNameFilter =
filter;
150 qCWarning(lcQuickPlatformFileDialog) <<
"exec() is not supported for the Qt Quick FileDialog fallback";
161 qCDebug(lcQuickPlatformFileDialog) <<
"show called with flags" <<
flags <<
162 "modality" << modality <<
"parent" <<
parent;
169 auto quickWindow = qobject_cast<QQuickWindow*>(
parent);
171 qmlInfo(this->
parent()) <<
"Parent window (" << parent <<
") of non-native dialog is not a QQuickWindow";
175 m_dialog->resetParentItem();
178 popupPrivate->getAnchors()->setCenterIn(m_dialog->parentItem());
184 m_pendingNameFilter.
clear();
193 qCDebug(lcQuickPlatformFileDialog) <<
"- calling setCurrentFolder(QDir()) on quick dialog" <<
parent;
217#include "moc_qquickplatformfiledialog_p.cpp"
QList< QUrl > initiallySelectedFiles() const
bool isLabelExplicitlySet(DialogLabel label)
QString labelText(DialogLabel label) const
QString windowTitle() const
bool isEmpty() const noexcept
QObject * parent() const
Returns a pointer to the parent object.
void setParent(QObject *parent)
Makes the object a child of parent.
The QQmlComponent class encapsulates a QML component definition.
bool isReady() const
Returns true if status() == QQmlComponent::Ready.
Q_INVOKABLE QString errorString() const
\qmlmethod string Component::errorString()
virtual QObject * create(QQmlContext *context=nullptr)
Create an object instance from this component, within the specified context.
QQmlEngine * engine() const
Return the context's QQmlEngine, or \nullptr if the context has no QQmlEngine or the QQmlEngine was d...
void setTitle(const QString &title)
void setRejectLabel(const QString &label)
void setAcceptLabel(const QString &label)
void filterSelected(const QString &filter)
void fileSelected(const QUrl &fileUrl)
void setOptions(const QSharedPointer< QFileDialogOptions > &options)
void selectedFileChanged(const QUrl &selectedFileUrl)
void setCurrentFolder(const QUrl ¤tFolder, SetReason setReason=SetReason::External)
void selectNameFilter(const QString &filter)
QQuickFileNameFilter * selectedNameFilter
void setInitialCurrentFolderAndSelectedFile(const QUrl &file)
void currentFolderChanged(const QUrl &folderUrl)
\macro QT_RESTRICTED_CAST_FROM_ASCII
void clear()
Clears the contents of the string and makes it null.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
QQmlContext * qmlContext(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static QString absolutePath(const QString &path)
#define QStringLiteral(str)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
file setParent(multiPart)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent