QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
#include <qgsnewnamedialog.h>
Public Slots | |
void | nameChanged () |
Signals | |
void | newNameChanged () |
Emitted when the name is changed in the dialog. More... | |
Public Member Functions | |
QgsNewNameDialog (const QString &source=QString(), const QString &initial=QString(), const QStringList &extensions=QStringList(), const QStringList &existing=QStringList(), const QRegExp ®exp=QRegExp(), Qt::CaseSensitivity cs=Qt::CaseSensitive, QWidget *parent=nullptr, Qt::WindowFlags flags=QgsGuiUtils::ModalDialogFlags) | |
New dialog constructor. More... | |
QString | conflictingNameWarning () const |
Returns the string used for warning users if a conflicting name exists. More... | |
QString | hintString () const |
Returns the hint string for the dialog (the text shown above the name input box). More... | |
QString | name () const |
Name entered by user. More... | |
bool | overwriteEnabled () const |
Returns whether users are permitted to overwrite existing names. More... | |
void | setConflictingNameWarning (const QString &string) |
Sets the string used for warning users if a conflicting name exists. More... | |
void | setHintString (const QString &hintString) |
Sets the hint string for the dialog (the text shown above the name input box). More... | |
void | setOverwriteEnabled (bool enabled) |
Sets whether users are permitted to overwrite existing names. More... | |
Public Member Functions inherited from QgsDialog | |
QgsDialog (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Close, Qt::Orientation orientation=Qt::Horizontal) | |
Constructor for QgsDialog. More... | |
QDialogButtonBox * | buttonBox () |
Returns the button box. More... | |
QVBoxLayout * | layout () |
Returns the central layout. Widgets added to it must have this dialog as parent. More... | |
Static Public Member Functions | |
static bool | exists (const QString &name, const QStringList &extensions, const QStringList &existing, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
Test if name or name with at least one extension exists. More... | |
Protected Member Functions | |
QString | highlightText (const QString &text) |
Static Protected Member Functions | |
static QStringList | fullNames (const QString &name, const QStringList &extensions) |
static QStringList | matching (const QStringList &newNames, const QStringList &existingNames, Qt::CaseSensitivity cs=Qt::CaseSensitive) |
Protected Attributes | |
Qt::CaseSensitivity | mCaseSensitivity |
QString | mConflictingNameWarning |
QLabel * | mErrorLabel = nullptr |
QStringList | mExiting |
QStringList | mExtensions |
QLabel * | mHintLabel = nullptr |
QLineEdit * | mLineEdit = nullptr |
QLabel * | mNamesLabel = nullptr |
List of names with extensions. More... | |
QString | mOkString |
bool | mOverwriteEnabled = true |
QRegExp | mRegexp |
Protected Attributes inherited from QgsDialog | |
QDialogButtonBox * | mButtonBox = nullptr |
QVBoxLayout * | mLayout = nullptr |
New name, for example new layer name dialog. If existing names are provided, the dialog warns users if an entered name already exists.
Definition at line 32 of file qgsnewnamedialog.h.
QgsNewNameDialog::QgsNewNameDialog | ( | const QString & | source = QString() , |
const QString & | initial = QString() , |
||
const QStringList & | extensions = QStringList() , |
||
const QStringList & | existing = QStringList() , |
||
const QRegExp & | regexp = QRegExp() , |
||
Qt::CaseSensitivity | cs = Qt::CaseSensitive , |
||
QWidget * | parent = nullptr , |
||
Qt::WindowFlags | flags = QgsGuiUtils::ModalDialogFlags |
||
) |
New dialog constructor.
source | original data source name, e.g. original layer name of the layer to be copied |
initial | initial name |
extensions | base name extensions, e.g. raster base name band extensions or vector layer type extensions |
existing | existing names |
regexp | regular expression to be used as validator, for example db tables should have "[A-Za-z_][A-Za-z0-9_]+" |
cs | case sensitivity for new name to existing names comparison |
parent | |
flags |
Definition at line 26 of file qgsnewnamedialog.cpp.
|
inline |
Returns the string used for warning users if a conflicting name exists.
Definition at line 99 of file qgsnewnamedialog.h.
|
static |
Test if name or name with at least one extension exists.
name | name or base name |
extensions | base name extensions |
existing | existing names |
cs | case sensitivity for new name to existing names comparison |
true
if name exists Definition at line 206 of file qgsnewnamedialog.cpp.
|
staticprotected |
Definition at line 170 of file qgsnewnamedialog.cpp.
|
protected |
Definition at line 112 of file qgsnewnamedialog.cpp.
QString QgsNewNameDialog::hintString | ( | ) | const |
Returns the hint string for the dialog (the text shown above the name input box).
Definition at line 95 of file qgsnewnamedialog.cpp.
|
staticprotected |
Definition at line 186 of file qgsnewnamedialog.cpp.
QString QgsNewNameDialog::name | ( | ) | const |
Name entered by user.
Definition at line 165 of file qgsnewnamedialog.cpp.
|
slot |
Definition at line 117 of file qgsnewnamedialog.cpp.
|
signal |
Emitted when the name is changed in the dialog.
|
inline |
Returns whether users are permitted to overwrite existing names.
Definition at line 84 of file qgsnewnamedialog.h.
void QgsNewNameDialog::setConflictingNameWarning | ( | const QString & | string | ) |
Sets the string used for warning users if a conflicting name exists.
string | warning string. If empty a default warning string will be used. |
Definition at line 106 of file qgsnewnamedialog.cpp.
void QgsNewNameDialog::setHintString | ( | const QString & | hintString | ) |
Sets the hint string for the dialog (the text shown above the name input box).
hintString | hint text |
Definition at line 90 of file qgsnewnamedialog.cpp.
void QgsNewNameDialog::setOverwriteEnabled | ( | bool | enabled | ) |
Sets whether users are permitted to overwrite existing names.
If true
, then the dialog will reflect that the new name will overwrite an existing name. If false
, then the dialog will not accept names which already exist.
Definition at line 100 of file qgsnewnamedialog.cpp.
|
protected |
Definition at line 135 of file qgsnewnamedialog.h.
|
protected |
Definition at line 144 of file qgsnewnamedialog.h.
|
protected |
Definition at line 140 of file qgsnewnamedialog.h.
|
protected |
Definition at line 133 of file qgsnewnamedialog.h.
|
protected |
Definition at line 134 of file qgsnewnamedialog.h.
|
protected |
Definition at line 136 of file qgsnewnamedialog.h.
|
protected |
Definition at line 137 of file qgsnewnamedialog.h.
|
protected |
List of names with extensions.
Definition at line 139 of file qgsnewnamedialog.h.
|
protected |
Definition at line 141 of file qgsnewnamedialog.h.
|
protected |
Definition at line 143 of file qgsnewnamedialog.h.
|
protected |
Definition at line 142 of file qgsnewnamedialog.h.