QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
23
24#include <QWidget>
25
26#define SIP_NO_FILE
27
34class GUI_EXPORT QgsAuthConfigIdEdit : public QWidget, private Ui::QgsAuthConfigIdEdit
35{
36 Q_OBJECT
37
38 public:
45 explicit QgsAuthConfigIdEdit( QWidget *parent = nullptr, const QString &authcfg = QString(), bool allowEmpty = true );
46
48 QString configId();
49
51 bool allowEmptyId() const { return mAllowEmpty; }
52
54 bool validate();
55
56 signals:
58 void validityChanged( bool valid );
59
60 public slots:
62 void setAuthConfigId( const QString &authcfg );
63
65 void setAllowEmptyId( bool allowed );
66
68 void clear();
69
70 private slots:
71 void updateValidityStyle( bool valid );
72
73 void btnLock_toggled( bool checked );
74
75 void leAuthCfg_textChanged( const QString &txt );
76
77 private:
78 bool isAlphaNumeric( const QString &authcfg );
79
80 QString mAuthCfgOrig;
81 bool mValid = false;
82 bool mAllowEmpty;
83};
84
85#endif // QGSAUTHCONFIGIDEDIT_H
QgsAuthConfigIdEdit(QWidget *parent=nullptr, const QString &authcfg=QString(), bool allowEmpty=true)
Widget to unlock and edit an authentication configuration ID.
void setAuthConfigId(const QString &authcfg)
Sets the authentication configuration ID, storing it, and validating the passed value.
void validityChanged(bool valid)
Validity of the ID has changed.
void setAllowEmptyId(bool allowed)
Sets whether to allow no ID to be set.
void clear()
Clear all of the widget's editing state and contents.
bool allowEmptyId() const
Whether to allow no ID to be set.
QString configId()
The authentication configuration ID, if valid, otherwise an empty QString.