Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:09:18

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QSQLINDEX_H
0005 #define QSQLINDEX_H
0006 
0007 #include <QtSql/qtsqlglobal.h>
0008 #include <QtSql/qsqlrecord.h>
0009 #include <QtCore/qlist.h>
0010 #include <QtCore/qstring.h>
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 
0015 class Q_SQL_EXPORT QSqlIndex : public QSqlRecord
0016 {
0017 public:
0018     explicit QSqlIndex(const QString &cursorName = QString(), const QString &name = QString());
0019     QSqlIndex(const QSqlIndex &other);
0020     QSqlIndex(QSqlIndex &&other) noexcept = default;
0021     ~QSqlIndex();
0022     QSqlIndex &operator=(const QSqlIndex &other);
0023     QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QSqlIndex)
0024 
0025     void swap(QSqlIndex &other) noexcept {
0026         QSqlRecord::swap(other);
0027         cursor.swap(other.cursor);
0028         nm.swap(other.nm);
0029         sorts.swap(other.sorts);
0030     };
0031 
0032     void setCursorName(const QString &cursorName);
0033     inline QString cursorName() const { return cursor; }
0034     void setName(const QString& name);
0035     inline QString name() const { return nm; }
0036 
0037     void append(const QSqlField &field);
0038     void append(const QSqlField &field, bool desc);
0039 
0040     bool isDescending(int i) const;
0041     void setDescending(int i, bool desc);
0042 
0043 private:
0044     // ### Qt7: move to d-ptr
0045     QString cursor;
0046     QString nm;
0047     QList<bool> sorts;
0048 };
0049 
0050 Q_DECLARE_SHARED(QSqlIndex)
0051 
0052 QT_END_NAMESPACE
0053 
0054 #endif // QSQLINDEX_H