QSqlIndex Class

QSqlIndex クラスは、データベースのインデックスを操作および記述する関数を提供します。詳細...

ヘッダ #include <QSqlIndex>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sql)
target_link_libraries(mytarget PRIVATE Qt6::Sql)
qmake: QT += sql
継承: QSqlRecord

プロパティ

パブリック機能

QSqlIndex(const QString &cursorname = QString(), const QString &name = QString())
QSqlIndex(const QSqlIndex &other)
(since 6.6) QSqlIndex(QSqlIndex &&other)
~QSqlIndex()
void append(const QSqlField &field)
void append(const QSqlField &field, bool desc)
QString cursorName() const
bool isDescending(int i) const
QString name() const
void setCursorName(const QString &cursorName)
void setDescending(int i, bool desc)
void setName(const QString &name)
(since 6.6) QSqlIndex &operator=(QSqlIndex &&other)
QSqlIndex &operator=(const QSqlIndex &other)

詳細説明

インデックスは、データベース内の1つのテーブルまたはビューを参照します。インデックスを構成するフィールドに関する情報は、SQL 文を生成するために使用することができます。

プロパティのドキュメント

[since 6.8] cursorName : QString

このプロパティは、インデックスが関連付けられているカーソルの名前を保持する。

このプロパティは Qt 6.8 で導入されました。

アクセス関数:

QString cursorName() const
void setCursorName(const QString &cursorName)

[since 6.8] name : QString

このプロパティはインデックスの名前を保持します。

このプロパティは Qt 6.8 で導入されました。

アクセス関数です:

QString name() const
void setName(const QString &name)

メンバ関数のドキュメント

[explicit] QSqlIndex::QSqlIndex(const QString &cursorname = QString(), const QString &name = QString())

カーソル名cursorname とインデックス名name を用いて空のインデックスを構築する。

QSqlIndex::QSqlIndex(const QSqlIndex &other)

other のコピーを作成する。

[noexcept, since 6.6] QSqlIndex::QSqlIndex(QSqlIndex &&other)

Move -other から新しい QSqlIndex を構築します。

注意: 移動元のオブジェクトother は部分的に形成された状態に置かれ、有効な操作は破壊と新しい値の割り当てのみです。

この関数は Qt 6.6 で導入されました。

[noexcept] QSqlIndex::~QSqlIndex()

オブジェクトを破棄し、割り当てられたリソースを解放する。

void QSqlIndex::append(const QSqlField &field)

field フィールドをインデックス付きフィールドのリストに追加します。フィールドは昇順で追加されます。

void QSqlIndex::append(const QSqlField &field, bool desc)

これはオーバーロードされた関数です。

インデックス付きフィールドのリストにフィールドfield を追加します。desc が true でない限り、フィールドは昇順で追加されます。

QString QSqlIndex::cursorName() const

カーソル名を返す。

注: プロパティ cursorName のゲッター関数。

setCursorName()も参照してください

bool QSqlIndex::isDescending(int i) const

インデックス内のフィールドi が降順にソートされている場合はtrue を返し、そうでない場合はfalse を返す。

QString QSqlIndex::name() const

名前を返す。

注: プロパティ名のゲッター関数。

setName()も参照してください

void QSqlIndex::setCursorName(const QString &cursorName)

cursorNamecursorName に設定する。

注: プロパティcursorName に対するセッター関数。

cursorName()も参照してください

void QSqlIndex::setDescending(int i, bool desc)

desc が真の場合、フィールドi は降順にソートされる。そうでない場合、フィールドi は昇順にソートされる(デフォルト)。フィールドが存在しない場合は何も起こらない。

isDescending()も参照のこと

void QSqlIndex::setName(const QString &name)

namename に設定する。

注: プロパティname に対するセッター関数。

name()も参照してください

[noexcept, since 6.6] QSqlIndex &QSqlIndex::operator=(QSqlIndex &&other)

Move-assignother をこのQSqlIndex インスタンスに割り当てる。

注意: 移動元のオブジェクトother は、部分的に形成された状態に置かれます。この状態では、有効な操作は破壊と新しい値の割り当てだけです。

この関数は Qt 6.6 で導入されました。

QSqlIndex &QSqlIndex::operator=(const QSqlIndex &other)

other に等しいインデックスを設定する。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.