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 <QtQuickTemplates2/private/qquickdialog_p.h>
12#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
13#include <QtQuickTemplates2/private/qquickpopupanchors_p.h>
19Q_LOGGING_CATEGORY(lcQuickPlatformFolderDialog,
"qt.quick.dialogs.quickplatformfolderdialog")
31 qCDebug(lcQuickPlatformFolderDialog) <<
"creating non-native Qt Quick FolderDialog with parent" <<
parent;
39 qmlWarning(
parent) <<
"No QQmlContext for QQuickPlatformFolderDialog; can't create non-native FolderDialog implementation";
43 const auto dialogQmlUrl =
QUrl(
QStringLiteral(
"qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/qml/FolderDialog.qml"));
45 if (!folderDialogComponent.
isReady()) {
49 m_dialog = qobject_cast<QQuickFolderDialogImpl*>(folderDialogComponent.
create());
55 m_dialog->setParent(
this);
66 if (m_dialog->currentFolder().isEmpty())
125 qCWarning(lcQuickPlatformFolderDialog) <<
"exec() is not supported for the Qt Quick FolderDialog fallback";
130 qCDebug(lcQuickPlatformFolderDialog) <<
"show called with flags" <<
flags <<
131 "modality" << modality <<
"parent" <<
parent;
138 auto quickWindow = qobject_cast<QQuickWindow*>(
parent);
140 qmlInfo(this->
parent()) <<
"Parent window (" << parent <<
") of non-native dialog is not a QQuickWindow";
144 m_dialog->resetParentItem();
147 popupPrivate->getAnchors()->setCenterIn(m_dialog->parentItem());
176#include "moc_qquickplatformfolderdialog_p.cpp"
bool isLabelExplicitlySet(DialogLabel label)
QString labelText(DialogLabel label) const
QString windowTitle() const
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 setAcceptLabel(const QString &label)
void setSelectedFolder(const QUrl &selectedFolder)
void setCurrentFolder(const QUrl &folder)
void setRejectLabel(const QString &label)
void selectedFolderChanged(const QUrl &folderUrl)
void setOptions(const QSharedPointer< QFileDialogOptions > &options)
void currentFolderChanged(const QUrl &folderUrl)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
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