KD Reports API Documentation
2.2
src
KDReports
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
"
12
#include "
KDReportsErrorDetails_p.h
"
13
#include <QObject>
14
15
KDReports::ErrorDetails::ErrorDetails
()
16
: d(new
ErrorDetailsPrivate
)
17
{
18
}
19
20
KDReports::ErrorDetails::ErrorDetails
(
const
QString &message)
21
: d(new
ErrorDetailsPrivate
)
22
{
23
setDriverMessage
(
message
);
24
}
25
26
QString
KDReports::ErrorDetails::message
()
const
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
39
int
KDReports::ErrorDetails::line
()
const
40
{
41
return
d->m_line;
42
}
43
44
int
KDReports::ErrorDetails::column
()
const
45
{
46
return
d->m_column;
47
}
48
49
bool
KDReports::ErrorDetails::hasError
()
const
50
{
51
return
d->m_hasError;
52
}
53
54
QString
KDReports::ErrorDetails::driverMessage
()
const
55
{
56
return
d->m_message;
57
}
58
59
void
KDReports::ErrorDetails::setLine
(
int
line)
60
{
61
d->m_hasError =
true
;
62
d->m_line = line;
63
}
64
65
void
KDReports::ErrorDetails::setColumn
(
int
column)
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
77
KDReports::ErrorDetails::~ErrorDetails
()
78
{
79
}
80
81
KDReports::ErrorDetails::ErrorDetails
(
const
ErrorDetails
&other)
82
: d(new
ErrorDetailsPrivate
(*other.d))
83
{
84
}
85
86
KDReports::ErrorDetails
&
KDReports::ErrorDetails::operator=
(
const
ErrorDetails
&other)
87
{
88
ErrorDetails
copy(other);
89
swap(copy);
90
return
*
this
;
91
}
92
93
void
KDReports::ErrorDetails::swap
(
ErrorDetails
&other)
94
{
95
qSwap
(d, other.d);
96
}
KDReportsErrorDetails.h
qSwap
QT_BEGIN_NAMESPACE void qSwap(KDReports::ErrorDetails &lhs, KDReports::ErrorDetails &rhs)
Definition:
KDReportsErrorDetails.h:68
KDReportsErrorDetails_p.h
KDReports::ErrorDetailsPrivate
Definition:
KDReportsErrorDetails_p.h:31
KDReports::ErrorDetails
Definition:
KDReportsErrorDetails.h:26
KDReports::ErrorDetails::column
int column() const
Definition:
KDReportsErrorDetails.cpp:44
KDReports::ErrorDetails::setColumn
void setColumn(int column)
Definition:
KDReportsErrorDetails.cpp:65
KDReports::ErrorDetails::message
QString message() const
Definition:
KDReportsErrorDetails.cpp:26
KDReports::ErrorDetails::driverMessage
QString driverMessage() const
Definition:
KDReportsErrorDetails.cpp:54
KDReports::ErrorDetails::ErrorDetails
ErrorDetails()
Definition:
KDReportsErrorDetails.cpp:15
KDReports::ErrorDetails::hasError
bool hasError() const
Definition:
KDReportsErrorDetails.cpp:49
KDReports::ErrorDetails::line
int line() const
Definition:
KDReportsErrorDetails.cpp:39
KDReports::ErrorDetails::setDriverMessage
void setDriverMessage(const QString &message)
Definition:
KDReportsErrorDetails.cpp:71
KDReports::ErrorDetails::operator=
ErrorDetails & operator=(const ErrorDetails &other)
Definition:
KDReportsErrorDetails.cpp:86
KDReports::ErrorDetails::setLine
void setLine(int line)
Definition:
KDReportsErrorDetails.cpp:59
KDReports::ErrorDetails::swap
void swap(ErrorDetails &other)
Definition:
KDReportsErrorDetails.cpp:93
KDReports::ErrorDetails::~ErrorDetails
~ErrorDetails()
Definition:
KDReportsErrorDetails.cpp:77
© 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