KD Reports API Documentation  2.2
KDReportsErrorDetails.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #include "KDReportsErrorDetails.h"
13 #include <QObject>
14 
16  : d(new ErrorDetailsPrivate)
17 {
18 }
19 
21  : d(new ErrorDetailsPrivate)
22 {
24 }
25 
27 {
28  if (!hasError()) {
29  return QString();
30  }
31 
32  if (d->m_line != -1) {
33  return QObject::tr("Error on line %1, column %2: %3").arg(line()).arg(column()).arg(driverMessage());
34  } else {
35  return driverMessage();
36  }
37 }
38 
40 {
41  return d->m_line;
42 }
43 
45 {
46  return d->m_column;
47 }
48 
50 {
51  return d->m_hasError;
52 }
53 
55 {
56  return d->m_message;
57 }
58 
60 {
61  d->m_hasError = true;
62  d->m_line = line;
63 }
64 
66 {
67  d->m_hasError = true;
68  d->m_column = column;
69 }
70 
71 void KDReports::ErrorDetails::setDriverMessage(const QString &message)
72 {
73  d->m_hasError = true;
74  d->m_message = message;
75 }
76 
78 {
79 }
80 
82  : d(new ErrorDetailsPrivate(*other.d))
83 {
84 }
85 
87 {
88  ErrorDetails copy(other);
89  swap(copy);
90  return *this;
91 }
92 
94 {
95  qSwap(d, other.d);
96 }
QT_BEGIN_NAMESPACE void qSwap(KDReports::ErrorDetails &lhs, KDReports::ErrorDetails &rhs)
void setDriverMessage(const QString &message)
ErrorDetails & operator=(const ErrorDetails &other)
void swap(ErrorDetails &other)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-reports/
Generated by doxygen 1.9.1