-
Notifications
You must be signed in to change notification settings - Fork 7
/
askErrorsDialog.cpp
74 lines (56 loc) · 1.48 KB
/
askErrorsDialog.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
68
69
70
71
72
73
#include "askErrorsDialog.h"
#include "ui_askErrorsDialog.h"
AskErrorsDialog::AskErrorsDialog(QWidget *parent, IniData &i) :
QDialog(parent),
m_ui(new Ui::AskErrorsDialog)
{
m_ui->setupUi(this);
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 = m_ui->textBrowser;
te->setReadOnly(true);
te->setText("<b>Bold</b> and a <a href=\"#1.1.1\">link</a>");
//te->setGeometry(20,20,280,200);
//QLabel *label = new QLabel(tr("porcamadonna"),this);
//te->openLinks(true);
connect(te,SIGNAL( anchorClicked(QUrl)),
this, SLOT(linkClicked(QUrl)) );
//resize(320, 240);
}
AskErrorsDialog::~AskErrorsDialog()
{
delete m_ui;
}
void AskErrorsDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
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 AskErrorsDialog::linkClicked(const QUrl&l){
accept();
}