From 294da15696eefd101e19694e0b9842357bfe9321 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 19 Jan 2024 20:52:43 +0100 Subject: [PATCH] QSqlIndex: add Q_PROPERTY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/sql/kernel/qsqlindex.cpp | 34 +++++++++++++++++++--------------- src/sql/kernel/qsqlindex.h | 6 ++++++ 2 files changed, 25 insertions(+), 15 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,20 +84,22 @@ 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 } /*! - \fn QString QSqlIndex::cursorName() const - - Returns the name of the cursor which the index is associated with. + \property QSqlIndex::cursorName + \since 6.8 + This property holds the name of the cursor which the index + is associated with. */ - - /*! - Sets the name of the cursor that the index is associated with to - \a cursorName. + \fn QString QSqlIndex::cursorName() const + Returns the \l 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 #include #include +#include #include +// 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;