亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qsqlrelationaltablemodel.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtSql module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qsqlrelationaltablemodel.h"#include "qhash.h"#include "qstringlist.h"#include "qsqldatabase.h"#include "qsqldriver.h"#include "qsqlerror.h"#include "qsqlfield.h"#include "qsqlindex.h"#include "qsqlquery.h"#include "qsqlrecord.h"#include "qsqltablemodel_p.h"#include "qdebug.h"/*!    \class QSqlRelation    \brief The QSqlRelation class stores information about an SQL foreign key.    QSqlRelation is a helper class for QSqlRelationalTableModel. See    QSqlRelationalTableModel::setRelation() and    QSqlRelationalTableModel::relation() for details.    \sa QSqlRelationalTableModel, QSqlRelationalDelegate,        {Relational Table Model Example}*//*!    \fn QSqlRelation::QSqlRelation()    Constructs an invalid QSqlRelation object.    For such an object, the tableName(), indexColumn(), and    displayColumn() functions return an empty string.    \sa isValid()*//*!    \fn QSqlRelation::QSqlRelation(const QString &tableName, const QString &indexColumn,                                   const QString &displayColumn)    Constructs a QSqlRelation object, where \a tableName is the SQL    table name to which a foreign key refers, \a indexColumn is the    foreign key, and \a displayColumn is the field that should be    presented to the user.    \sa tableName(), indexColumn(), displayColumn()*//*!    \fn QString QSqlRelation::tableName() const    Returns the name of the table to which a foreign key refers.*//*!    \fn QString QSqlRelation::indexColumn() const    Returns the index column from table tableName() to which a    foreign key refers.*//*!    \fn QString QSqlRelation::displayColumn() const    Returns the column from table tableName() that should be    presented to the user instead of a foreign key.*//*!    \fn bool QSqlRelation::isValid() const    Returns true if the QSqlRelation object is valid; otherwise    returns false.*/struct QRelation{    QRelation(): model(0) {}    QSqlRelation rel;    QSqlTableModel *model;    QHash<int, QVariant> displayValues;};class QSqlRelationalTableModelPrivate: public QSqlTableModelPrivate{    Q_DECLARE_PUBLIC(QSqlRelationalTableModel)public:    QSqlRelationalTableModelPrivate()        : QSqlTableModelPrivate()    {}    QString escapedRelationField(const QString &tableName, const QString &fieldName) const;    int nameToIndex(const QString &name) const;    mutable QVector<QRelation> relations;    QSqlRecord baseRec; // the record without relations    void clearChanges();    void clearEditBuffer();    void revertCachedRow(int row);    void translateFieldNames(int row, QSqlRecord &values) const;};static void qAppendWhereClause(QString &query, const QString &clause1, const QString &clause2){    if (clause1.isEmpty() && clause2.isEmpty())        return;    if (clause1.isEmpty() || clause2.isEmpty())        query.append(QLatin1String(" WHERE (")).append(clause1).append(clause2);    else        query.append(QLatin1String(" WHERE (")).append(clause1).append(                        QLatin1String(") AND (")).append(clause2);    query.append(QLatin1String(") "));}void QSqlRelationalTableModelPrivate::clearChanges(){    for (int i = 0; i < relations.count(); ++i) {        QRelation &rel = relations[i];        delete rel.model;        rel.displayValues.clear();    }}void QSqlRelationalTableModelPrivate::revertCachedRow(int row){    if (cache.value(row).op == QSqlTableModelPrivate::Insert) {        for (int i = 0; i < relations.count(); ++i) {            const QHash<int, QVariant> displayValues = relations.at(i).displayValues;            QHash<int, QVariant> newValues;            for (QHash<int, QVariant>::const_iterator it = displayValues.constBegin();                 it != displayValues.constEnd(); ++it) {                newValues[it.key() > row ? it.key() - 1 : it.key()] = it.value();            }            relations[i].displayValues = newValues;        }    }    QSqlTableModelPrivate::revertCachedRow(row);}int QSqlRelationalTableModelPrivate::nameToIndex(const QString &name) const{    return baseRec.indexOf(name);}void QSqlRelationalTableModelPrivate::clearEditBuffer(){    editBuffer = baseRec;}/*!    \class QSqlRelationalTableModel    \brief The QSqlRelationalTableModel class provides an editable    data model for a single database table, with foreign key support.    \ingroup database    \module sql    QSqlRelationalTableModel acts like QSqlTableModel, but allows    columns to be set as foreign keys into other database tables.    \table    \row \o \inlineimage noforeignkeys.png         \o \inlineimage foreignkeys.png    \endtable    The screenshot on the left shows a plain QSqlTableModel in a    QTableView. Foreign keys (\c city and \c country) aren't resolved    to human-readable values. The screenshot on the right shows a    QSqlRelationalTableModel, with foreign keys resolved into    human-readable text strings.    The following code snippet shows how the QSqlRelationalTableModel    was set up:    \quotefromfile sql/relationaltablemodel/relationaltablemodel.cpp    \skipto model->setTable    \printline model->setTable    \skipto setRelation    \printline setRelation    \printline setRelation    The setRelation() function calls establish a relationship between    two tables. The first call specifies that column 2 in table \c    employee is a foreign key that maps with field \c id of table \c    city, and that the view should present the \c{city}'s \c name    field to the user. The second call does something similar with    column 3.    If you use a read-write QSqlRelationalTableModel, you probably    want to use QSqlRelationalDelegate on the view. Unlike the default    delegate, QSqlRelationalDelegate provides a combobox for fields    that are foreign keys into other tables. To use the class, simply    call QAbstractItemView::setItemDelegate() on the view with an    instance of QSqlRelationalDelegate:    \quotefromfile sql/relationaltablemodel/relationaltablemodel.cpp    \skipto QTableView *view = new    \printuntil setItemDelegate    The \l{sql/relationaltablemodel} example illustrates how to use    QSqlRelationalTableModel in conjunction with    QSqlRelationalDelegate to provide tables with foreigh key    support.    \image relationaltable.png    Notes:    \list    \o The table's primary key may not contain a relation to       another table.    \o If a relational table contains keys that refer to non-existent       rows in the referenced table, the rows containing the invalid       keys will not be exposed through the model. The user or the       database is responsible for keeping referential integrity.    \endlist    \sa QSqlRelation, QSqlRelationalDelegate,        {Relational Table Model Example}*//*!    Creates an empty QSqlRelationalTableModel and sets the parent to \a parent    and the database connection to \a db. If \a db is not valid, the    default database connection will be used.*/QSqlRelationalTableModel::QSqlRelationalTableModel(QObject *parent, QSqlDatabase db)    : QSqlTableModel(*new QSqlRelationalTableModelPrivate, parent, db){}/*!    Destroys the object and frees any allocated resources.*/QSqlRelationalTableModel::~QSqlRelationalTableModel(){}/*!    \reimp*/QVariant QSqlRelationalTableModel::data(const QModelIndex &index, int role) const{    Q_D(const QSqlRelationalTableModel);    if (role == Qt::DisplayRole && index.column() > 0 && index.column() < d->relations.count()) {        const QVariant v = d->relations.at(index.column()).displayValues.value(index.row());        if (v.isValid())            return v;    }    return QSqlTableModel::data(index, role);}/*!    Sets the data for the \a role in the item with the specified \a    index to the \a value given. Depending on the edit strategy, the

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
懂色av一区二区夜夜嗨| 国产午夜亚洲精品不卡| 国产欧美一区二区精品性色超碰| 亚洲精品网站在线观看| 激情综合网av| 欧美女孩性生活视频| 国产精品不卡一区| 国产美女在线精品| 欧美一区二区观看视频| 亚洲在线视频网站| av在线综合网| 中文幕一区二区三区久久蜜桃| 美腿丝袜在线亚洲一区| 欧美日韩免费在线视频| 亚洲欧美日韩一区二区三区在线观看| 国产一区二区三区高清播放| 日韩一区二区在线观看| 视频一区欧美精品| 欧美亚洲愉拍一区二区| 亚洲男人天堂av网| 成人av电影免费在线播放| 欧美韩国一区二区| 国产成人精品在线看| 久久久五月婷婷| 国产激情偷乱视频一区二区三区| 日韩欧美成人一区| 精品中文字幕一区二区小辣椒| 欧美高清dvd| 秋霞电影一区二区| 日韩欧美一二三四区| 久久99精品久久久久久动态图| 宅男噜噜噜66一区二区66| 婷婷激情综合网| 日韩一区二区三区四区五区六区| 日韩**一区毛片| 欧美大尺度电影在线| 国产综合色产在线精品| 国产午夜精品理论片a级大结局| 国产成人激情av| 国产精品无码永久免费888| 99精品视频在线免费观看| 亚洲乱码国产乱码精品精98午夜| 色婷婷久久99综合精品jk白丝| 亚洲人成网站色在线观看| 欧美性色aⅴ视频一区日韩精品| 亚洲电影你懂得| 精品免费一区二区三区| 高清av一区二区| 亚洲美女视频一区| 欧美蜜桃一区二区三区| 美国十次综合导航| 日本一区二区成人在线| 欧美性受xxxx| 久久福利资源站| 综合激情成人伊人| 欧美日韩一区二区三区高清| 久久精品国产一区二区三| 中文欧美字幕免费| 欧美精品久久天天躁| 国产乱子轮精品视频| 亚洲婷婷国产精品电影人久久| 欧美精品日韩精品| 国产91清纯白嫩初高中在线观看| 亚洲日本韩国一区| 日韩午夜精品电影| 成人av网址在线观看| 午夜欧美在线一二页| 久久久久久综合| 欧美久久婷婷综合色| 国产毛片精品视频| 亚洲福利一区二区三区| 日本一区二区不卡视频| 7777精品伊人久久久大香线蕉| 成人网在线播放| 三级在线观看一区二区| 日韩毛片高清在线播放| 日韩精品在线网站| 欧美亚洲精品一区| 丰满岳乱妇一区二区三区 | 精品噜噜噜噜久久久久久久久试看| 国产成a人亚洲精品| 日韩av一二三| 亚洲一区欧美一区| 亚洲视频一二区| 久久久久久久久久久久久久久99| 欧美日韩久久一区二区| av在线不卡免费看| 国内精品视频一区二区三区八戒| 亚洲国产cao| 1000部国产精品成人观看| 久久久亚洲综合| 精品区一区二区| 欧美高清精品3d| 欧美日韩精品一二三区| 色综合欧美在线| 99久久综合色| 成人高清视频在线观看| 国模一区二区三区白浆| 日韩精品一二三四| 亚欧色一区w666天堂| 亚洲国产另类av| 亚洲一区欧美一区| 亚洲午夜久久久久久久久久久| 亚洲欧美一区二区三区国产精品| 国产日韩欧美一区二区三区乱码 | 亚洲乱码精品一二三四区日韩在线| 久久久久青草大香线综合精品| 日韩一区二区免费电影| 538在线一区二区精品国产| 欧美日韩免费视频| 欧美日韩精品欧美日韩精品| 欧洲精品在线观看| 91电影在线观看| 91久久精品午夜一区二区| 色噜噜久久综合| 日本韩国一区二区三区视频| 91欧美一区二区| 欧美日韩一区二区三区四区五区 | 奇米影视一区二区三区| 蜜桃一区二区三区在线| 免费观看日韩av| 国产资源精品在线观看| 国产精品一区二区在线播放| 成人性视频免费网站| 99久久综合狠狠综合久久| 色婷婷久久久亚洲一区二区三区| 欧美亚洲禁片免费| 日韩色在线观看| 久久综合九色综合欧美98 | 99热99精品| 在线免费不卡电影| 在线播放亚洲一区| 精品sm捆绑视频| 国产精品电影院| 视频一区二区不卡| 国产大陆a不卡| 色综合久久久久| 日韩精品一区二区在线观看| 国产人久久人人人人爽| 亚洲综合丝袜美腿| 蜜桃在线一区二区三区| 不卡区在线中文字幕| 欧美午夜免费电影| 精品欧美黑人一区二区三区| 国产精品视频在线看| 婷婷国产v国产偷v亚洲高清| 国产麻豆视频精品| 欧美综合欧美视频| 久久九九全国免费| 亚洲18女电影在线观看| 成人网在线播放| 日韩午夜激情电影| 亚洲靠逼com| 国产一区二区美女| 欧美视频一区二区在线观看| 久久久亚洲精华液精华液精华液| 亚洲综合小说图片| 国产精品系列在线观看| 欧美日韩另类国产亚洲欧美一级| www激情久久| 亚洲成人黄色小说| 不卡一区二区三区四区| 日韩精品一区二区三区三区免费 | 国产综合成人久久大片91| 色www精品视频在线观看| 欧美电影免费观看高清完整版在线| 最新久久zyz资源站| 男人的天堂久久精品| 91激情在线视频| 国产欧美一区视频| 久久99国产精品尤物| 欧美日韩一级大片网址| 综合婷婷亚洲小说| 国产成人av自拍| 精品美女被调教视频大全网站| 亚洲成人黄色小说| 色婷婷精品久久二区二区蜜臂av | 久久嫩草精品久久久久| 日韩成人午夜电影| 欧美在线观看禁18| 日韩毛片在线免费观看| 成人国产精品免费网站| 欧美激情一区二区三区在线| 精东粉嫩av免费一区二区三区| 欧美精品一卡二卡| 亚洲国产精品嫩草影院| 欧美羞羞免费网站| 亚洲图片有声小说| 欧美丝袜第三区| 亚洲国产一区在线观看| 欧美性猛交一区二区三区精品| 最新欧美精品一区二区三区| av在线播放成人| 国产精品入口麻豆九色| 成人一区在线观看| 国产农村妇女毛片精品久久麻豆 | 在线不卡一区二区| 午夜天堂影视香蕉久久| 欧美电影在线免费观看| 日韩电影免费在线看|