Review comments

This commit is contained in:
Nyall Dawson 2019-04-30 12:53:57 +10:00
parent c12fd877ed
commit 1d80fe8a19
4 changed files with 21 additions and 11 deletions

View File

@ -30,17 +30,21 @@ Constructor for QgsFindFilesByPatternWidget, with the specified ``parent`` widge
QStringList files() const;
%Docstring
Returns the list of files found by the dialog.
Returns the list of files found by the dialog. This may be empty if
no matching files were found.
.. seealso:: :py:func:`filesFound`
.. seealso:: :py:func:`findComplete`
%End
signals:
void filesFound( const QStringList &files );
void findComplete( const QStringList &files );
%Docstring
Emitted after files are found in the dialog.
The ``files`` argument contains a list of all matching files found. This may be empty if
no matching files were found.
.. seealso:: :py:func:`files`
%End
@ -66,7 +70,8 @@ Constructor for QgsFindFilesByPatternDialog, with the specified ``parent`` widge
QStringList files() const;
%Docstring
Returns the list of files found by the dialog.
Returns the list of files found by the dialog. This may be empty if
no matching files were found.
%End
};

View File

@ -96,7 +96,7 @@ class BatchPanelFillWidget(QToolButton):
def __init__(self, parameterDefinition, column, panel, parent=None):
super().__init__(parent)
self.setBackgroundRole(QPalette.Window)
self.setBackgroundRole(QPalette.Button)
self.setAutoFillBackground(True)
self.parameterDefinition = parameterDefinition

View File

@ -103,7 +103,7 @@ void QgsFindFilesByPatternWidget::find()
disconnect( mFindButton, &QPushButton::clicked, this, &QgsFindFilesByPatternWidget::cancel );
connect( mFindButton, &QPushButton::clicked, this, &QgsFindFilesByPatternWidget::find );
emit filesFound( mFiles );
emit findComplete( mFiles );
}
void QgsFindFilesByPatternWidget::cancel()
@ -135,7 +135,7 @@ QgsFindFilesByPatternDialog::QgsFindFilesByPatternDialog( QWidget *parent )
setLayout( vLayout );
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
connect( mWidget, &QgsFindFilesByPatternWidget::filesFound, this, [ = ]( const QStringList & files )
connect( mWidget, &QgsFindFilesByPatternWidget::findComplete, this, [ = ]( const QStringList & files )
{
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( !files.empty() );
} );

View File

@ -41,8 +41,9 @@ class GUI_EXPORT QgsFindFilesByPatternWidget : public QWidget, private Ui::QgsFi
QgsFindFilesByPatternWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
/**
* Returns the list of files found by the dialog.
* \see filesFound()
* Returns the list of files found by the dialog. This may be empty if
* no matching files were found.
* \see findComplete()
*/
QStringList files() const { return mFiles; }
@ -51,9 +52,12 @@ class GUI_EXPORT QgsFindFilesByPatternWidget : public QWidget, private Ui::QgsFi
/**
* Emitted after files are found in the dialog.
*
* The \a files argument contains a list of all matching files found. This may be empty if
* no matching files were found.
*
* \see files()
*/
void filesFound( const QStringList &files );
void findComplete( const QStringList &files );
private slots:
@ -84,7 +88,8 @@ class GUI_EXPORT QgsFindFilesByPatternDialog : public QDialog
QgsFindFilesByPatternDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr );
/**
* Returns the list of files found by the dialog.
* Returns the list of files found by the dialog. This may be empty if
* no matching files were found.
*/
QStringList files() const;