QGIS API Documentation  2.14.0-Essen
qgsauthconfigidedit.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthconfigidedit.h
3  ---------------------
4  begin : September, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer at boundlessgeo dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSAUTHCONFIGIDEDIT_H
18 #define QGSAUTHCONFIGIDEDIT_H
19 
20 #include "ui_qgsauthconfigidedit.h"
21 
22 #include <QWidget>
23 
29 class GUI_EXPORT QgsAuthConfigIdEdit : public QWidget, private Ui::QgsAuthConfigIdEdit
30 {
31  Q_OBJECT
32 
33  public:
40  explicit QgsAuthConfigIdEdit( QWidget *parent = nullptr, const QString &authcfg = QString(), bool allowEmpty = true );
42 
44  QString const configId();
45 
47  bool allowEmptyId() { return mAllowEmpty;}
48 
50  bool validate();
51 
52  signals:
54  void validityChanged( bool valid );
55 
56  public slots:
58  void setAuthConfigId( const QString &authcfg );
59 
61  void setAllowEmptyId( bool allowed );
62 
64  void clear();
65 
66  private slots:
67  void updateValidityStyle( bool valid );
68 
69  void on_btnLock_toggled( bool checked );
70 
71  void on_leAuthCfg_textChanged( const QString &txt );
72 
73  private:
74  bool isAlphaNumeric( const QString &authcfg );
75 
76  QString mAuthCfgOrig;
77  bool mValid;
78  bool mAllowEmpty;
79 };
80 
81 #endif // QGSAUTHCONFIGIDEDIT_H
bool allowEmptyId()
Whether to allow no ID to be set.
Custom widget for editing an authentication configuration ID.