Qt 4.8
Classes | Functions
qsqlrelationaltablemodel.cpp File Reference
#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"

Go to the source code of this file.

Classes

class  QRelatedTableModel
 
struct  QRelation
 
class  QSqlRelationalTableModelPrivate
 

Functions

static void qAppendWhereClause (QString &query, const QString &clause1, const QString &clause2)
 

Function Documentation

◆ qAppendWhereClause()

static void qAppendWhereClause ( QString query,
const QString clause1,
const QString clause2 
)
static

Definition at line 297 of file qsqlrelationaltablemodel.cpp.

Referenced by QSqlRelationalTableModel::selectStatement().

298 {
299  if (clause1.isEmpty() && clause2.isEmpty())
300  return;
301  if (clause1.isEmpty() || clause2.isEmpty())
302  query.append(QLatin1String(" WHERE (")).append(clause1).append(clause2);
303  else
304  query.append(QLatin1String(" WHERE (")).append(clause1).append(
305  QLatin1String(") AND (")).append(clause2);
306  query.append(QLatin1String(") "));
307 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QString & append(QChar c)
Definition: qstring.cpp:1777