Exemplo n.º 1
0
bool XSqlQuery::exec()
{
  qApp->setOverrideCursor(Qt::WaitCursor);
  bool returnValue = false;

  if(_data && _data->_emulatePrepare)
  {
// In 4.4.1 Qt started supporting true prepared queries on the PostgreSQL driver and this
// caused several problems with all our code and the way it worked so this is a modified copy
// of their code to use the implemented prepare if we have that option set so we can use the method
// that works best in the case we are using it for.
    if (lastError().isValid())
      ((XSqlResultHelper*)result())->setLastError(QSqlError());

    returnValue = ((XSqlResultHelper*)result())->XSqlResultHelper::exec();
  }
  else
    returnValue = QSqlQuery::exec();
  qApp->restoreOverrideCursor();

  if (_data)
    _data->_currRecord = record();

  if(false == returnValue)
    notifyErrorListeners(this);

  return returnValue;
}
Exemplo n.º 2
0
bool XSqlQuery::exec(const char *pSql)
{
  qApp->setOverrideCursor(Qt::waitCursor);
  bool returnValue = QSqlQuery::exec(QString(pSql));
  qApp->restoreOverrideCursor();

  if(false == returnValue)
    notifyErrorListeners(this);

  return returnValue;
}
Exemplo n.º 3
0
bool XSqlQuery::exec(const QString &pSql)
{
  qApp->setOverrideCursor(Qt::WaitCursor);
  bool returnValue = QSqlQuery::exec(pSql);
  qApp->restoreOverrideCursor();

  if (_data)
    _data->_currRecord = record();

  if(false == returnValue)
    notifyErrorListeners(this);

  return returnValue;
}