diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-01-19 20:52:43 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-01-24 20:35:09 +0000 |
commit | 294da15696eefd101e19694e0b9842357bfe9321 (patch) | |
tree | 8fa991abc09e921c8f8bb2fbbb3dfcb1a0108f51 | |
parent | c10530fd97ca0f0e5a36ccdd1f57f72b12f44a27 (diff) |
QSqlIndex: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.
Task-number: QTBUG-120566
Change-Id: Iaf844eb6f60427dab7fba6ac20b16ffa11f217b8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
-rw-r--r-- | src/sql/kernel/qsqlindex.cpp | 32 | ||||
-rw-r--r-- | src/sql/kernel/qsqlindex.h | 6 |
2 files changed, 24 insertions, 14 deletions
diff --git a/src/sql/kernel/qsqlindex.cpp b/src/sql/kernel/qsqlindex.cpp index 77af6f0fb8..b315f4c52b 100644 --- a/src/sql/kernel/qsqlindex.cpp +++ b/src/sql/kernel/qsqlindex.cpp @@ -84,21 +84,23 @@ QSqlIndex::~QSqlIndex() } /*! - Sets the name of the index to \a name. + \property QSqlIndex::name + \since 6.8 + This property holds the name of the index. +*/ +/*! + \fn QString QSqlIndex::name() const + Returns the \l name. +*/ +/*! + Sets \l name to \a name. */ - void QSqlIndex::setName(const QString& name) { nm = name; } /*! - \fn QString QSqlIndex::name() const - - Returns the name of the index. -*/ - -/*! Appends the field \a field to the list of indexed fields. The field is appended with an ascending sort order. */ @@ -166,15 +168,17 @@ QString QSqlIndex::createField(int i, const QString& prefix, bool verbose) const } /*! + \property QSqlIndex::cursorName + \since 6.8 + This property holds the name of the cursor which the index + is associated with. +*/ +/*! \fn QString QSqlIndex::cursorName() const - - Returns the name of the cursor which the index is associated with. + Returns the \l cursorName. */ - - /*! - Sets the name of the cursor that the index is associated with to - \a cursorName. + Sets \l cursorName to \a cursorName. */ void QSqlIndex::setCursorName(const QString& cursorName) { diff --git a/src/sql/kernel/qsqlindex.h b/src/sql/kernel/qsqlindex.h index f011e64353..409cb463e3 100644 --- a/src/sql/kernel/qsqlindex.h +++ b/src/sql/kernel/qsqlindex.h @@ -7,14 +7,20 @@ #include <QtSql/qtsqlglobal.h> #include <QtSql/qsqlrecord.h> #include <QtCore/qlist.h> +#include <QtCore/qmetaobject.h> #include <QtCore/qstring.h> +// clazy:excludeall=qproperty-without-notify QT_BEGIN_NAMESPACE class Q_SQL_EXPORT QSqlIndex : public QSqlRecord { + Q_GADGET public: + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName) + explicit QSqlIndex(const QString &cursorName = QString(), const QString &name = QString()); QSqlIndex(const QSqlIndex &other); QSqlIndex(QSqlIndex &&other) noexcept = default; |