File indexing completed on 2025-01-26 05:06:20
0001 /* 0002 SPDX-FileCopyrightText: 2014 Eike Hein <hein@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 #include <QUrl> 0011 0012 class QFileDialog; 0013 0014 class DirectoryPicker : public QObject 0015 { 0016 Q_OBJECT 0017 0018 Q_PROPERTY(QUrl url READ url NOTIFY urlChanged) 0019 0020 public: 0021 explicit DirectoryPicker(QObject *parent = nullptr); 0022 ~DirectoryPicker() override; 0023 0024 QUrl url() const; 0025 0026 Q_INVOKABLE void open(); 0027 0028 Q_SIGNALS: 0029 void urlChanged() const; 0030 0031 private Q_SLOTS: 0032 void dialogAccepted(); 0033 0034 private: 0035 QFileDialog *m_dialog = nullptr; 0036 QUrl m_url; 0037 };