-
Notifications
You must be signed in to change notification settings - Fork 0
/
parseerror.cpp
48 lines (39 loc) · 861 Bytes
/
parseerror.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "parseerror.h"
#include <QDebug>
#include <QAbstractItemModel>
ParseError::ParseError(ParseError* other) :
_line(other->_line),
_column(other->_column),
_error(other->_error),
_block(other->_block),
_uiData(NULL)
{
}
ParseError::ParseError(int line, int column, const QString error, const CodeBlock* block) :
_line(line),
_column(column),
_error(error),
_block(block),
_uiData(NULL)
{
}
QVariant
ParseError::data(const QModelIndex &index, int role) const
{
if (role == Qt::DisplayRole)
{
//qDebug() << index << role;
switch(index.column())
{
case 0:
return QVariant(_line);
break;
case 1:
return QVariant(_column);
break;
default:
return _error;
}
}
return QVariant();
}