21 #include <QHBoxLayout>
23 #include <QSpacerItem>
24 #include <QVBoxLayout>
29 QMap<IVP1System*,QWidget*>& sys2tabpage,
31 const QList<QPair<IVP1System*,bool> >& system2switchable,
32 QMap<QCheckBox*,IVP1System*>& checkbox2system,
34 QWidget * extrawidget,
bool nobgdcolorsel)
39 QList<QPair<QWidget*,QString> > controllerTabs;
40 for (
IVP1System*
s : systemsWithControllersAllowed) {
41 QWidget*
w =
s->controllerWidget();
43 controllerTabs << QPair<QWidget*,QString>(
w,
s->name());
44 sys2tabpage.insert(
s,
w);
49 QWidget * tab_general =
new QWidget(0);
50 QVBoxLayout * vboxLayout1 =
new QVBoxLayout(tab_general);
51 vboxLayout1->setSpacing(6);
52 vboxLayout1->setMargin(9);
53 QHBoxLayout * hboxLayout =
new QHBoxLayout();
54 hboxLayout->setSpacing(6);
55 hboxLayout->setMargin(0);
56 QLabel * tab_general_label =
new QLabel(tab_general);
57 tab_general_label->setText(
"No systems can be switched on/off in this channel.");
58 hboxLayout->addWidget(tab_general_label);
59 QSpacerItem * spacerItem =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
60 hboxLayout->addItem(spacerItem);
61 vboxLayout1->addLayout(hboxLayout);
62 QHBoxLayout * hboxLayout1 =
new QHBoxLayout();
63 hboxLayout1->setSpacing(0);
64 hboxLayout1->setMargin(0);
65 QSpacerItem * spacerItem1 =
new QSpacerItem(25, 2, QSizePolicy::Fixed, QSizePolicy::Fixed);
66 hboxLayout1->addItem(spacerItem1);
67 QVBoxLayout *vboxLayout_checkboxes =
new QVBoxLayout();
68 vboxLayout_checkboxes->setSpacing(6);
69 vboxLayout_checkboxes->setMargin(0);
70 hboxLayout1->addLayout(vboxLayout_checkboxes);
71 QSpacerItem * spacerItem2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
72 hboxLayout1->addItem(spacerItem2);
73 vboxLayout1->addLayout(hboxLayout1);
76 for (
int i = 0;
i < system2switchable.count(); ++
i) {
77 QCheckBox * checkBox =
new QCheckBox(tab_general);
78 checkBox->setText(system2switchable.at(
i).first->name());
79 QString
info(system2switchable.at(
i).first->information());
81 checkBox->setToolTip(
info);
82 checkBox->setChecked(
true);
83 vboxLayout_checkboxes->addWidget(checkBox);
84 if (system2switchable.at(
i).second) {
85 tab_general_label->setText(
"Select active systems:");
86 checkbox2system.insert(checkBox,system2switchable.at(
i).first);
88 checkBox->setEnabled(
false);
95 QHBoxLayout * hboxLayout2 =
new QHBoxLayout();
96 hboxLayout2->setSpacing(6);
97 hboxLayout2->setMargin(0);
98 hboxLayout2->addWidget(colorselectbutton);
99 hboxLayout2->addWidget(
new QLabel(
"Set background"));
100 QSpacerItem * spacerItem4 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
101 hboxLayout2->addItem(spacerItem4);
102 QSpacerItem * spacerItem5 =
new QSpacerItem(10, 10, QSizePolicy::Minimum,QSizePolicy::Fixed);
103 vboxLayout1->addItem(spacerItem5);
104 vboxLayout1->addLayout(hboxLayout2);
109 extrawidget->setParent(tab_general);
110 QHBoxLayout * hboxLayout_extra =
new QHBoxLayout();
111 hboxLayout_extra->setSpacing(6);
112 hboxLayout_extra->setMargin(0);
113 hboxLayout_extra->addWidget(extrawidget);
114 QSpacerItem * spacerItem_extra1 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
115 hboxLayout_extra->addItem(spacerItem_extra1);
116 QSpacerItem * spacerItem_extra2 =
new QSpacerItem(10, 10, QSizePolicy::Minimum,QSizePolicy::Fixed);
117 vboxLayout1->addItem(spacerItem_extra2);
118 vboxLayout1->addLayout(hboxLayout_extra);
119 QSpacerItem * spacerItem_extra3 =
new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
120 vboxLayout1->addItem(spacerItem_extra3);
123 QSpacerItem * spacerItem3 =
new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
124 vboxLayout1->addItem(spacerItem3);
127 if (controllerTabs.empty()) {
133 tabWidget->addTab(tab_general,
"General");
136 for (
int i = 0;
i<controllerTabs.count();++
i) {
137 controllerTabs.at(
i).first->setParent(tabWidget);
138 tabWidget->addTab(controllerTabs.at(
i).first,controllerTabs.at(
i).second);
142 tabWidget->setCurrentIndex(0);