-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaskErrorDialog.cpp
67 lines (53 loc) · 1.51 KB
/
askErrorDialog.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <QListView.h>
#include <QTextBrowser.h>
#include <QLabel.h>
#include "askErrorDialog.h"
#include "brfData.h"
#include "iniData.h"
class ErrListModel: public QAbstractListModel{
public:
ErrListModel():QAbstractListModel(0){}
int rowCount(const QModelIndex& i) const {return 5;}
QVariant data(const QModelIndex& i, int role)const{
if (role == Qt::DisplayRole) {
return QString("<b>Cazz</b>!");
}
if (role == Qt::DecorationRole) {
return QVariant();
}
return QVariant();
}
};
void AskErrorDialog::setup(){
setBaseSize(300,240);
//QListView* lv= new QListView(this);
//model = new ErrListModel();
//setWindowTitle("BrfEdit - errors in module set");
//lv->setModel(model);
//lv->setGeometry(0,0,100,100);
//this->layout();
te = new QTextBrowser(this);
te->setReadOnly(true);
te->setGeometry(20,20,280,200);
//QLabel *label = new QLabel(tr("porcamadonna"),this);
//te->openLinks(true);
inidata->findErrors();
te->setText(inidata->errorList.join("<p>"));
connect(te,SIGNAL( anchorClicked(QUrl)),
this, SLOT(linkClicked(QUrl)) );
i = j = kind = -1;
resize(320, 240);
}
AskErrorDialog::AskErrorDialog(QWidget* parent, IniData &i):QDialog(parent)
{
inidata = &i;
setup();
}
void AskErrorDialog::linkClicked(const QUrl&l){
QString s = l.toString();
sscanf(s.toAscii().data(), "#%d.%d.%d",&i, &j, &kind);
accept();
}
AskErrorDialog::~AskErrorDialog(){
//delete model;
}