summaryrefslogtreecommitdiffstats
path: root/Source/CPack
ModeNameSize
d---------IFW492logstatsplain
-rw-r--r--OSXLauncherScript.scpt3102logstatsplain
d---------WiX1108logstatsplain
-rw-r--r--cmCPackArchiveGenerator.cxx13641logstatsplain
-rw-r--r--cmCPackArchiveGenerator.h2768logstatsplain
-rw-r--r--cmCPackBundleGenerator.cxx8265logstatsplain
-rw-r--r--cmCPackBundleGenerator.h901logstatsplain
-rw-r--r--cmCPackComponentGroup.cxx818logstatsplain
-rw-r--r--cmCPackComponentGroup.h4693logstatsplain
-rw-r--r--cmCPackConfigure.h.in148logstatsplain
-rw-r--r--cmCPackCygwinBinaryGenerator.cxx2431logstatsplain
-rw-r--r--cmCPackCygwinBinaryGenerator.h713logstatsplain
-rw-r--r--cmCPackCygwinSourceGenerator.cxx5627logstatsplain
-rw-r--r--cmCPackCygwinSourceGenerator.h799logstatsplain
-rw-r--r--cmCPackDebGenerator.cxx33051logstatsplain
-rw-r--r--cmCPackDebGenerator.h1959logstatsplain
-rw-r--r--cmCPackDragNDropGenerator.cxx31581logstatsplain
-rw-r--r--cmCPackDragNDropGenerator.h2398logstatsplain
-rw-r--r--cmCPackExternalGenerator.cxx10324logstatsplain
-rw-r--r--cmCPackExternalGenerator.h2672logstatsplain
-rw-r--r--cmCPackFreeBSDGenerator.cxx14217logstatsplain
-rw-r--r--cmCPackFreeBSDGenerator.h872logstatsplain
-rw-r--r--cmCPackGenerator.cxx60572logstatsplain
-rw-r--r--cmCPackGenerator.h12409logstatsplain
-rw-r--r--cmCPackGeneratorFactory.cxx6191logstatsplain
-rw-r--r--cmCPackGeneratorFactory.h1211logstatsplain
-rw-r--r--cmCPackLog.cxx3987logstatsplain
-rw-r--r--cmCPackLog.h3980logstatsplain
-rw-r--r--cmCPackNSISGenerator.cxx36338logstatsplain
-rw-r--r--cmCPackNSISGenerator.h2945logstatsplain
-rw-r--r--cmCPackNuGetGenerator.cxx5055logstatsplain
-rw-r--r--cmCPackNuGetGenerator.h1073logstatsplain
-rw-r--r--cmCPackPKGGenerator.cxx15204logstatsplain
-rw-r--r--cmCPackPKGGenerator.h3769logstatsplain
-rw-r--r--cmCPackPackageMakerGenerator.cxx22054logstatsplain
-rw-r--r--cmCPackPackageMakerGenerator.h1668logstatsplain
-rw-r--r--cmCPackProductBuildGenerator.cxx9245logstatsplain
-rw-r--r--cmCPackProductBuildGenerator.h1627logstatsplain
-rw-r--r--cmCPackRPMGenerator.cxx16436logstatsplain
-rw-r--r--cmCPackRPMGenerator.h2052logstatsplain
-rw-r--r--cmCPackSTGZGenerator.cxx3341logstatsplain
-rw-r--r--cmCPackSTGZGenerator.h757logstatsplain
-rw-r--r--cpack.cxx17487logstatsplain
span class="hl com"> \ingroup database \inmodule QtSql 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: \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 16 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: \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 21 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: \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 22 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: \snippet doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp 0 \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() */ void QSqlQueryModel::setQuery(const QSqlQuery &query) { Q_D(QSqlQueryModel); QSqlRecord newRec = query.record(); bool columnsChanged = (newRec != d->rec); bool hasQuerySize = query.driver()->hasFeature(QSqlDriver::QuerySize); bool hasNewData = (newRec != QSqlRecord()) || !query.lastError().isValid(); if (d->colOffsets.size() != newRec.count() || columnsChanged) d->initColOffsets(newRec.count()); bool mustClearModel = d->bottom.isValid(); if (mustClearModel) { d->atEnd = true; beginRemoveRows(QModelIndex(), 0, qMax(d->bottom.row(), 0)); d->bottom = QModelIndex(); } d->error = QSqlError(); d->query = query; d->rec = newRec; if (mustClearModel) endRemoveRows(); d->atEnd = false; if (columnsChanged && hasNewData) reset(); if (!query.isActive() || query.isForwardOnly()) { d->atEnd = true; d->bottom = QModelIndex(); if (query.isForwardOnly()) d->error = QSqlError(QLatin1String("Forward-only queries " "cannot be used in a data model"),