File indexing completed on 2024-07-07 03:51:04

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2017 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0004     Work sponsored by the LiMux project of the city of Munich
0005 
0006     SPDX-License-Identifier: LGPL-2.0-only
0007 */
0008 
0009 #include "kfilecustomdialog.h"
0010 
0011 #include <QApplication>
0012 #include <QDebug>
0013 #include <QDialog>
0014 #include <QLabel>
0015 #include <QObject>
0016 #include <QUrl>
0017 
0018 int main(int argc, char **argv)
0019 {
0020     QApplication::setApplicationName(QStringLiteral("KFileCustomDialogTest_gui"));
0021     QApplication app(argc, argv);
0022 
0023     KFileCustomDialog dlg;
0024     KFileWidget *fileWidget = dlg.fileWidget();
0025     fileWidget->setMode(KFile::Directory);
0026     dlg.setOperationMode(KFileWidget::Opening);
0027     dlg.setWindowTitle(QStringLiteral("Select folder"));
0028 
0029     dlg.connect(dlg.fileWidget(), &KFileWidget::accepted, &app, [&dlg]() {
0030         qDebug() << "Selected dir URL:" << dlg.fileWidget()->selectedUrl();
0031     });
0032     dlg.show();
0033 
0034     return app.exec();
0035 }