QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsfindfilesbypatternwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfindfilesbypatternwidget.h
3  -----------------------------
4  begin : April 2019
5  copyright : (C) 2019 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSFINDFILESBYPATTERNWIDGET_H
17 #define QGSFINDFILESBYPATTERNWIDGET_H
18 
19 #include "ui_qgsfindfilesbypatternwidget.h"
20 #include "qgis_gui.h"
21 
22 #include <QDialog>
23 
24 class QDialogButtonBox;
25 
32 class GUI_EXPORT QgsFindFilesByPatternWidget : public QWidget, private Ui::QgsFindFilesByPatternWidgetBase
33 {
34  Q_OBJECT
35 
36  public:
37 
41  QgsFindFilesByPatternWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
42 
48  QStringList files() const { return mFiles; }
49 
50  signals:
51 
60  void findComplete( const QStringList &files );
61 
62  private slots:
63 
64  void find();
65  void cancel();
66 
67  private:
68 
69  bool mCanceled = false;
70  QStringList mFiles;
71 };
72 
79 class GUI_EXPORT QgsFindFilesByPatternDialog : public QDialog
80 {
81  Q_OBJECT
82 
83  public:
84 
88  QgsFindFilesByPatternDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr );
89 
94  QStringList files() const;
95 
96  private:
97 
98  QgsFindFilesByPatternWidget *mWidget = nullptr;
99  QDialogButtonBox *mButtonBox = nullptr;
100 
101 };
102 
103 #endif // QGSFINDFILESBYPATTERNWIDGET_H
QgsFindFilesByPatternWidget::files
QStringList files() const
Returns the list of files found by the dialog.
Definition: qgsfindfilesbypatternwidget.h:48
QgsFindFilesByPatternDialog
A dialog for finding files (recursively) by file pattern.
Definition: qgsfindfilesbypatternwidget.h:80
QgsFindFilesByPatternWidget
A reusable widget for finding files (recursively) by file pattern.
Definition: qgsfindfilesbypatternwidget.h:33
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
QgsFindFilesByPatternWidget::findComplete
void findComplete(const QStringList &files)
Emitted after files are found in the dialog.