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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qsqlquerymodel.cpp

?? QT 開發(fā)環(huán)境里面一個很重要的文件
?? 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 "qsqlquerymodel.h"#include <qdebug.h>#include <qsqldriver.h>#include <qsqlfield.h>#include "qsqlquerymodel_p.h"#define QSQL_PREFETCH 255void QSqlQueryModelPrivate::prefetch(int limit){    Q_Q(QSqlQueryModel);    if (atEnd || limit <= bottom.row() || bottom.column() == -1)        return;    QModelIndex newBottom;    const int oldBottomRow = qMax(bottom.row(), 0);    // try to seek directly    if (query.seek(limit)) {        newBottom = q->createIndex(limit, bottom.column());    } else {        // have to seek back to our old position for MS Access        int i = oldBottomRow;        if (query.seek(i)) {            while (query.next())                ++i;            newBottom = q->createIndex(i, bottom.column());        } else {            // empty or invalid query            newBottom = q->createIndex(-1, bottom.column());        }        atEnd = true; // this is the end.    }    if (newBottom.row() >= 0 && newBottom.row() > bottom.row()) {        q->beginInsertRows(QModelIndex(), bottom.row() + 1, newBottom.row());        bottom = newBottom;        q->endInsertRows();    } else {        bottom = newBottom;    }}QSqlQueryModelPrivate::~QSqlQueryModelPrivate(){}/*!    \class QSqlQueryModel    \brief The QSqlQueryModel class provides a read-only data model for SQL    result sets.    \ingroup database    \module sql    QSqlQueryModel is a high-level interface for executing SQL    statements and traversing the result set. It is built on top of    the lower-level QSqlQuery and can be used to provide data to    view classes such as QTableView. For example:    \quotefromfile snippets/sqldatabase/sqldatabase.cpp    \skipto QSqlQueryModel_snippets    \skipto QSqlQueryModel *model    \printuntil show()    We set the model's query, then we set up the labels displayed in    the view header.    QSqlQueryModel can also be used to access a database    programmatically, without binding it to a view:    \skipto QSqlQueryModel model;    \printuntil int salary =    The code snippet above extracts the \c salary field from record 4 in    the result set of the query \c{SELECT * from employee}. Assuming    that \c salary is column 2, we can rewrite the last line as follows:    \skipto int salary =    \printline int salary =    The model is read-only by default. To make it read-write, you    must subclass it and reimplement setData() and flags(). Another    option is to use QSqlTableModel, which provides a read-write    model based on a single database table.    The \l{sql/querymodel} example illustrates how to use    QSqlQueryModel to display the result of a query. It also shows    how to subclass QSqlQueryModel to customize the contents of the    data before showing it to the user, and how to create a    read-write model based on QSqlQueryModel.    If the database doesn't return the amount of selected rows in    a query, the model will fetch rows incrementally.    See fetchMore() for more information.    \sa QSqlTableModel, QSqlRelationalTableModel, QSqlQuery,        {Model/View Programming}, {Query Model Example}*//*!    Creates an empty QSqlQueryModel with the given \a parent. */QSqlQueryModel::QSqlQueryModel(QObject *parent)    : QAbstractTableModel(*new QSqlQueryModelPrivate, parent){}/*! \internal */QSqlQueryModel::QSqlQueryModel(QSqlQueryModelPrivate &dd, QObject *parent)    : QAbstractTableModel(dd, parent){}/*!    Destroys the object and frees any allocated resources.    \sa clear()*/QSqlQueryModel::~QSqlQueryModel(){}/*!    \since 4.1    Fetches more rows from a database.    This only affects databases that don't report back the size of a query    (see QSqlDriver::hasFeature()).    To force fetching of the entire database, you can use the following:    \code    while (myModel->canFetchMore())        myModel->fetchMore();    \endcode    \a parent should always be an invalid QModelIndex.    \sa canFetchMore()*/void QSqlQueryModel::fetchMore(const QModelIndex &parent){    Q_D(QSqlQueryModel);    if (parent.isValid())        return;    d->prefetch(qMax(d->bottom.row(), 0) + QSQL_PREFETCH);}/*!    \since 4.1    Returns true if it is possible to read more rows from the database.    This only affects databases that don't report back the size of a query    (see QSqlDriver::hasFeature()).    \a parent should always be an invalid QModelIndex.    \sa fetchMore() */bool QSqlQueryModel::canFetchMore(const QModelIndex &parent) const{    Q_D(const QSqlQueryModel);    return (!parent.isValid() && !d->atEnd);}/*! \fn int QSqlQueryModel::rowCount(const QModelIndex &parent) const    \since 4.1    If the database supports returning the size of a query    (see QSqlDriver::hasFeature()), the amount of rows of the current    query is returned. Otherwise, returns the amount of rows    currently cached on the client.    \a parent should always be an invalid QModelIndex.    \sa canFetchMore(), QSqlDriver::hasFeature() */int QSqlQueryModel::rowCount(const QModelIndex &index) const{    Q_D(const QSqlQueryModel);    return index.isValid() ? 0 : d->bottom.row() + 1;}/*! \reimp */int QSqlQueryModel::columnCount(const QModelIndex &index) const{    Q_D(const QSqlQueryModel);    return index.isValid() ? 0 : d->rec.count();}/*!    Returns the value for the specified \a item and \a role.    If \a item is out of bounds or if an error occurred, an invalid    QVariant is returned.    \sa lastError()*/QVariant QSqlQueryModel::data(const QModelIndex &item, int role) const{    Q_D(const QSqlQueryModel);    if (!item.isValid())        return QVariant();    QVariant v;    if (role & ~(Qt::DisplayRole | Qt::EditRole))        return v;    if (!d->rec.isGenerated(item.column()))        return v;    QModelIndex dItem = indexInQuery(item);    if (dItem.row() > d->bottom.row())        const_cast<QSqlQueryModelPrivate *>(d)->prefetch(dItem.row());    if (!d->query.seek(dItem.row())) {        d->error = d->query.lastError();        return v;    }    return d->query.value(dItem.column());}/*!    Returns the header data for the given \a role in the \a section    of the header with the specified \a orientation.*/QVariant QSqlQueryModel::headerData(int section, Qt::Orientation orientation, int role) const{    Q_D(const QSqlQueryModel);    if (orientation == Qt::Horizontal) {        QVariant val = d->headers.value(section).value(role);        if (role == Qt::DisplayRole && !val.isValid())            val = d->headers.value(section).value(Qt::EditRole);        if (val.isValid())            return val;        if (role == Qt::DisplayRole && d->rec.count() > section)            return d->rec.fieldName(section);    }    return QAbstractItemModel::headerData(section, orientation, role);}/*!    This virtual function is called whenever the query changes. The    default implementation does nothing.    query() returns the new query.    \sa query(), setQuery() */void QSqlQueryModel::queryChange(){    // do nothing}/*!    Resets the model and sets the data provider to be the given \a    query. Note that the query must be active and must not be    isForwardOnly().    lastError() can be used to retrieve verbose information if there    was an error setting the query.    \sa query(), QSqlQuery::isActive(), QSqlQuery::setForwardOnly(), lastError()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久黄色级2电影| 亚洲一区二区三区三| 欧美巨大另类极品videosbest| 国产精品一区免费在线观看| 老汉av免费一区二区三区| 婷婷中文字幕综合| 亚洲自拍偷拍综合| 亚洲成人777| 日韩成人伦理电影在线观看| 亚洲福利视频一区二区| 夜夜精品视频一区二区| 亚洲一区国产视频| 五月激情丁香一区二区三区| 日韩高清欧美激情| 麻豆精品新av中文字幕| 国产一区二区剧情av在线| 国产一区啦啦啦在线观看| 国产成人啪免费观看软件| 99久久精品免费| 一本大道av伊人久久综合| 日本韩国欧美在线| 制服丝袜一区二区三区| 精品精品国产高清a毛片牛牛| 精品国产区一区| 中文字幕制服丝袜一区二区三区 | 色哟哟在线观看一区二区三区| 成人午夜私人影院| 色偷偷久久一区二区三区| 欧美区视频在线观看| 精品精品欲导航| 国产清纯白嫩初高生在线观看91| 成人免费在线播放视频| 三级在线观看一区二区| 国产一区二区三区精品视频| 成人福利电影精品一区二区在线观看| 色悠悠久久综合| 欧美v国产在线一区二区三区| 国产精品美女一区二区在线观看| 亚洲精品日产精品乱码不卡| 久久av资源网| 欧美亚洲日本一区| 久久久国产一区二区三区四区小说 | 在线成人av网站| 国产欧美一区二区在线| 亚洲福利一二三区| 99久久综合狠狠综合久久| 日韩午夜中文字幕| 亚洲精品成人少妇| 国产精品自拍在线| 欧美精品 国产精品| 一色屋精品亚洲香蕉网站| 日韩中文字幕区一区有砖一区| 成人一区二区三区| 欧美变态tickling挠脚心| 一区二区三区欧美久久| 国产成人综合视频| 日韩欧美在线影院| 亚洲国产精品久久人人爱蜜臀| 成人精品小蝌蚪| 久久久久久久综合狠狠综合| 午夜精品久久久久久久久| 91麻豆蜜桃一区二区三区| 久久久亚洲综合| 久久99精品国产91久久来源| 欧美日韩一级二级| 一二三区精品福利视频| 一本色道久久加勒比精品 | 欧美无砖专区一中文字| 国产精品卡一卡二卡三| 国产精品综合一区二区三区| www精品美女久久久tv| 午夜精品视频在线观看| 欧美三级视频在线| 亚洲国产精品精华液网站| 一本久久a久久精品亚洲| 18成人在线观看| 97精品视频在线观看自产线路二 | 成人永久免费视频| 国产精品私人自拍| eeuss国产一区二区三区| 国产女人18毛片水真多成人如厕| 国产一区二区三区视频在线播放| 日韩欧美资源站| 免费观看日韩av| 久久婷婷一区二区三区| 国产精品一区在线观看你懂的| 久久女同性恋中文字幕| 国产成人在线视频播放| 中文字幕免费在线观看视频一区| 国产不卡一区视频| 亚洲图片激情小说| 欧美私人免费视频| 日本成人中文字幕| 久久中文娱乐网| 成人高清视频在线观看| 亚洲一二三专区| 精品久久久影院| 国产精品99久久久久久久女警 | 国产一区二区三区最好精华液| 精品美女在线观看| 99久久久免费精品国产一区二区| 亚洲欧洲精品一区二区精品久久久 | 欧美日韩aaaaa| 美女网站视频久久| 欧美国产日韩亚洲一区| 在线这里只有精品| 免费成人av在线| 国产精品麻豆欧美日韩ww| 在线观看亚洲精品| 狠狠色丁香久久婷婷综| 自拍av一区二区三区| 91.xcao| 高清不卡一二三区| 水野朝阳av一区二区三区| 久久精品一二三| 欧美日韩免费一区二区三区视频| 精品一区中文字幕| 亚洲精品久久嫩草网站秘色| 日韩免费看的电影| 欧亚洲嫩模精品一区三区| 另类调教123区| 一区二区成人在线观看| 欧美精品一区二区久久婷婷| 色欧美片视频在线观看在线视频| 老司机精品视频一区二区三区| 亚洲码国产岛国毛片在线| 久久综合色综合88| 欧美乱熟臀69xxxxxx| 粉嫩一区二区三区在线看| 日本亚洲电影天堂| 一区二区三区日韩在线观看| 久久午夜国产精品| 欧美刺激午夜性久久久久久久| 色婷婷综合五月| 白白色亚洲国产精品| 久草在线在线精品观看| 亚洲韩国精品一区| 亚洲人成小说网站色在线| 久久久综合激的五月天| 日韩一区二区在线免费观看| 在线免费不卡电影| 91丨国产丨九色丨pron| 不卡的av在线播放| 高清视频一区二区| 国产高清精品在线| 国产在线观看一区二区| 美日韩一区二区| 日韩精品91亚洲二区在线观看| 亚洲人成网站在线| 亚洲你懂的在线视频| 中文字幕一区二区三中文字幕| 国产日韩欧美一区二区三区综合| 精品国精品国产尤物美女| 欧美zozozo| 国产日韩欧美综合在线| 国产精品麻豆久久久| 国产精品成人在线观看| 亚洲蜜臀av乱码久久精品| 中文字幕一区二区三区四区 | 欧美精品一区二区在线播放| 欧美一级黄色录像| 欧美本精品男人aⅴ天堂| 精品欧美一区二区久久| 久久久久久麻豆| 中文字幕在线观看一区二区| **欧美大码日韩| 亚洲曰韩产成在线| 午夜欧美大尺度福利影院在线看| 天天操天天色综合| 精品写真视频在线观看| 成人综合在线视频| 日本电影欧美片| 91精品国产综合久久婷婷香蕉| 91精品国产麻豆| 精品福利av导航| 国产精品毛片无遮挡高清| 亚洲精品菠萝久久久久久久| 亚洲国产精品欧美一二99| 日韩黄色在线观看| 国产乱子伦一区二区三区国色天香| 国产精品影音先锋| 91黄视频在线| 日韩视频在线一区二区| 日本一区二区三区在线观看| 亚洲色图一区二区| 青青草一区二区三区| 国产麻豆精品视频| 欧美午夜不卡在线观看免费| 精品国产91九色蝌蚪| 中文字幕日本不卡| 久久精品国内一区二区三区| 成人精品鲁一区一区二区| 欧美三级午夜理伦三级中视频| 久久综合色一综合色88| 一区二区三区不卡视频| 国产乱淫av一区二区三区| 在线看一区二区| 国产三级精品三级在线专区| 亚洲在线视频网站| 国产91高潮流白浆在线麻豆|