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

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

?? qsqlquerymodel.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 "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()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区不卡在线视频 午夜欧美不卡在| 成人黄动漫网站免费app| 国产精品白丝av| 91精品福利视频| 久久美女艺术照精彩视频福利播放 | 岛国精品一区二区| 欧美日本在线观看| 综合精品久久久| 国产主播一区二区三区| 欧美二区三区91| 亚洲自拍另类综合| 色综合久久综合| 国产日韩欧美电影| 国产一区二区视频在线| 欧美一级一区二区| 五月激情六月综合| 欧美三级资源在线| 亚洲动漫第一页| 日本国产一区二区| 亚洲尤物在线视频观看| 91国产精品成人| 亚洲日本va午夜在线影院| 成人午夜视频网站| 中文字幕免费不卡| 成人免费毛片app| 国产欧美一区二区精品仙草咪| 麻豆91小视频| 欧美大黄免费观看| 韩国成人在线视频| 日韩区在线观看| 精品制服美女久久| 欧美成人官网二区| 国内成+人亚洲+欧美+综合在线 | 色天使色偷偷av一区二区| 国产精品亲子伦对白| 国产成人丝袜美腿| 国产精品午夜在线| 91蜜桃视频在线| 亚洲成人精品一区二区| 欧美高清激情brazzers| 日韩中文字幕区一区有砖一区 | 日韩精品一区二区三区中文精品| 日韩中文字幕区一区有砖一区| 制服丝袜av成人在线看| 久热成人在线视频| 国产亚洲女人久久久久毛片| proumb性欧美在线观看| 亚洲精品网站在线观看| 91麻豆精品国产| 久久99久久99小草精品免视看| 久久久久国产一区二区三区四区| 国产91在线看| 亚洲综合丁香婷婷六月香| 欧美伦理视频网站| 国产伦理精品不卡| 中文字幕在线播放不卡一区| 欧美日免费三级在线| 久久av老司机精品网站导航| 日本一区二区成人| 欧美羞羞免费网站| 国产一区二区看久久| 中文字幕一区免费在线观看| 欧美日韩欧美一区二区| 国产美女主播视频一区| 一区二区三区免费网站| 精品国免费一区二区三区| 99精品在线免费| 日本系列欧美系列| 亚洲欧洲www| 精品日韩在线一区| 97精品国产露脸对白| 美女网站一区二区| 亚洲精品va在线观看| 欧美精品一区二区三区在线| 欧洲中文字幕精品| 国产精品影视在线观看| 亚洲成a人v欧美综合天堂 | 欧美日韩精品欧美日韩精品| 激情综合色综合久久| 一区二区三区中文字幕| 精品久久久久久久人人人人传媒 | 不卡的av在线| 六月婷婷色综合| 一区二区久久久| 国产女同性恋一区二区| 欧美一级电影网站| 日本韩国一区二区三区视频| 国产精品系列在线观看| 老司机精品视频在线| 亚洲成av人片一区二区梦乃| 国产精品美女久久久久久久网站| 日韩欧美一区二区视频| 欧美日韩视频在线观看一区二区三区 | 国产婷婷一区二区| 欧美精品123区| 91传媒视频在线播放| 成人精品在线视频观看| 久久精品国产精品青草| 午夜国产不卡在线观看视频| 中文字幕在线观看不卡视频| 国产视频一区在线播放| 精品国产制服丝袜高跟| 欧美精品丝袜久久久中文字幕| 色美美综合视频| 成人午夜伦理影院| 国产精品一区二区久久不卡| 久久精品国产秦先生| 日韩电影在线看| 婷婷丁香激情综合| 亚洲国产成人av好男人在线观看| 亚洲精品视频在线观看网站| 一区二区中文字幕在线| 国产精品国产三级国产有无不卡| 久久久久久久久久久久久夜| 欧美va在线播放| 日韩免费在线观看| 精品久久久久一区| 久久久久亚洲综合| 国产拍揄自揄精品视频麻豆| 久久久久国产精品人| 亚洲国产精品二十页| 国产欧美日韩综合精品一区二区| 2024国产精品| 国产欧美日韩在线| 亚洲欧洲一区二区在线播放| 亚洲精品一二三| 亚洲一区二区欧美激情| 午夜精品久久久久| 美女免费视频一区二区| 国产在线不卡一卡二卡三卡四卡| 国产在线视视频有精品| 国产精品一区二区三区网站| 国产91高潮流白浆在线麻豆| 99久久婷婷国产综合精品| 在线看不卡av| 日韩精品中文字幕在线不卡尤物 | 日本高清无吗v一区| 精品视频全国免费看| 欧美一区二区三区小说| 久久综合成人精品亚洲另类欧美 | 国产精品国产精品国产专区不蜜| 亚洲人成亚洲人成在线观看图片| 依依成人精品视频| 天天做天天摸天天爽国产一区| 韩国毛片一区二区三区| 国产精品久久久久久久岛一牛影视 | 亚洲在线免费播放| 蜜桃视频在线一区| 成人小视频免费在线观看| 欧美亚洲动漫制服丝袜| 日韩亚洲国产中文字幕欧美| 久久久久久影视| 一区二区三区日韩在线观看| 久久精品国产久精国产爱| 成人av午夜影院| 欧美蜜桃一区二区三区| 久久亚洲欧美国产精品乐播| 国产精品久久久久9999吃药| 免费观看日韩av| av不卡免费电影| 欧美一级二级三级蜜桃| 1000精品久久久久久久久| 天天免费综合色| 岛国一区二区三区| 日韩欧美在线综合网| 亚洲精品老司机| 国产成人精品影视| 777色狠狠一区二区三区| 国产精品美女久久久久aⅴ国产馆| 日本欧美久久久久免费播放网| 成人性色生活片| 欧美一个色资源| 一区二区三区中文字幕电影| 国产精品乡下勾搭老头1| 91精品国产一区二区三区| 中文字幕亚洲区| 国内成人免费视频| 69堂国产成人免费视频| 亚洲欧美视频一区| 成人一级视频在线观看| 日韩欧美色综合网站| 午夜欧美大尺度福利影院在线看| 99热在这里有精品免费| 久久久午夜精品理论片中文字幕| 日韩电影在线观看网站| 欧美系列亚洲系列| 亚洲精品乱码久久久久久久久 | 日韩精品电影一区亚洲| 色综合久久综合| 国产精品乱码一区二三区小蝌蚪| 麻豆freexxxx性91精品| 欧美一级免费大片| 首页亚洲欧美制服丝腿| 欧美色视频在线观看| 一区二区三区中文在线观看| 99riav久久精品riav| **性色生活片久久毛片| fc2成人免费人成在线观看播放| 久久精品日产第一区二区三区高清版| 毛片一区二区三区|