13 : QDialog(parent)
14 ,
m_ui(
new Ui::Preferences)
15{
17 setObjectName("Preferences");
18
19 QSettings settings;
20 auto item = new QListWidgetItem("Attribute Foreground");
21 item->setToolTip("Foreground colour for attributes");
22 item->setForeground(settings.value("attribute/foreground").value<QColor>());
23 m_ui->attribute_list->addItem(item);
24
25 item = new QListWidgetItem("Attribute Background");
26 item->setToolTip("Normal background colour for attributes");
27 item->setBackground(settings.value("attribute/background").value<QColor>());
28 m_ui->attribute_list->addItem(item);
29
30 item = new QListWidgetItem("Attribute Default-Background");
31 item->setToolTip("Background colour for attributes set to their default value");
32 item->setBackground(settings.value("attribute/default-background").value<QColor>());
33 m_ui->attribute_list->addItem(item);
34
35 item = new QListWidgetItem("Relationship Foreground");
36 item->setToolTip("Foreground colour for relationships");
37 item->setForeground(settings.value("relationship/foreground").value<QColor>());
38 m_ui->relationship_list->addItem(item);
39
40 item = new QListWidgetItem("Relationship Background");
41 item->setToolTip("background colour for relationships");
42 item->setBackground(settings.value("relationship/background").value<QColor>());
43 m_ui->relationship_list->addItem(item);
44
45 item = new QListWidgetItem("Readonly Foreground");
46 item->setToolTip("Foreground text colour for readonly items");
47 item->setForeground(settings.value("readonly/foreground").value<QColor>());
48 m_ui->read_only_list->addItem(item);
49
50 item = new QListWidgetItem("Readonly Background");
51 item->setToolTip("Background text colour for readonly items");
52 item->setBackground(settings.value("readonly/background").value<QColor>());
53 m_ui->read_only_list->addItem(item);
54
55 connect(
m_ui->attribute_list, SIGNAL(itemActivated(QListWidgetItem*)),
this, SLOT(
set_color(QListWidgetItem*)));
56 connect(
m_ui->relationship_list, SIGNAL(itemActivated(QListWidgetItem*)),
this, SLOT(
set_color(QListWidgetItem*)));
57 connect(
m_ui->read_only_list, SIGNAL(itemActivated(QListWidgetItem*)),
this, SLOT(
set_color(QListWidgetItem*)));
58}
void set_color(QListWidgetItem *)